FreeBSD is used as a server to install ubuntu8.0420.toppxe diskless workstation

Source: Internet
Author: User
Tags server installation and configuration
There are many articles on using Linux as a server to install javastupxe without a disk. I use FreeBSD as a server to install it. FreeBSD's necessary network service settings are relatively easy, And FreeBSD is a very stable and efficient operating system. 1. Server installation and configuration 1. Install FreeBSD7.0 on the server operating system. For simplicity, do not install anything related to X, but install ports. Root permissions are required for the following operations. 2. Run the following command to install the DHCP server:

There are many articles on Ubuntu PXE diskless website installation using Linux as a server. I installed it using FreeBSD as a server. FreeBSD's necessary network service settings are relatively easy, And FreeBSD is a very stable and efficient operating system.

I. Server installation and configuration

1. Install the server operating system
Install FreeBSD 7.0. You do not need to install X for simplicity, but ports must be installed.
Root permissions are required for the following operations.

2. Run the following command to install the DHCP service:
Cd/usr/ports/net/isc-dhcp3-server
Make install
After the installation is complete, run the following command to configure the service:
Cd/usr/local/etc
Cp dhcpd. conf. sample dhcpd. conf
Edit/usr/local/etc/dhcpd. conf with the following content)
Authoritative;
Ddns-update-style none;
Subnet 192.168.1.0 netmask 255.255.255.0 {# network and subnet mask, according to your own network parameters
Range 192.168.1.100 192.168.1.120; # address range allocated to diskless clients
Option domain-name-servers 192.168.1.1; # specify the domain name resolution server address of the client
Option routers 192.168.1.1; # specify the client's gateway
Option broadcast-address 192.168.1.255; # broadcast address
Default-lease-time 600;
Max-lease-time 7200;
}
Host ubuntu {# ubuntu is the name of the client machine
Hardware ethernet 00: 0C: 29: 4A: D5: EE; # the MAC address of the NIC enabled by the client,
Filename "pxelinux.0"; # client Startup File Name
Server-name "192.168.1.5"; # the address of the TFTP server. If this parameter is not specified, the local host is used by default.
} # If there are multiple diskless sites, you can refer to the above five lines to add them.

3. Configure the TFTP service
Edit the/etc/inetd. conf file and delete the annotator before the two lines that contain tftp #
Create a TFTP service directory
Mkdir/tftpboot
Mkdir/tftpboot/pxelinux. cfg
Prepare the Startup File
Download syslinux-3.71.tar.gz http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.71.tar.gz
Decompress the package to/root/
Tar xvzf syslinux-3.71.tar.gz-C/root/
Copy the boot file pxelinux.0 to/tftpboot.
Cp/root/syslinux-3.71/core/pxelinux.0/tftpboot/
Create the configuration file/tftpboot/pxelinux. cfg/default for pxelinux.0. The content is as follows:
DEFAULT Ubuntu
LABEL Ubuntu
Kernel vmlinuz
Append initrd = initrd. img root =/dev/nfs nfsroot = 192.168.1.5:/exports ip = dhcp rw
PROMPT 1
TIMEOUT 3

4. Configure the NFS service
Create an NFS service directory
Mkdir/exports
This directory must have sufficient space to accommodate all files without a disk. It is best to mount a separate disk to this directory.
Edit the NFS service configuration file/etc/exports as follows:
/Exports-maproot = 0-network 192.168.1.0-mask 255.255.255.0

5. Set the above services to automatically run at startup
Edit the/etc/rc. conf file with the following content:

Defaultrouter = "192.168.1.1"
Hostname = "FB7.mydomain"
Ifconfig_em0 = "inet 192.168.1.5 netmask 255.255.255.0"
Dhcpd_enable = "YES"
Inetd_enable = "YES"
Rpcbind_enable = "YES"
Nfs_server_enable = "YES"
So far, the server configuration is complete, and the server is restarted once.

Ii. workstation settings

1. Install the system
Install a Ubuntu 8.04 Desktop with a disk, configure the network, use DHCP or a fixed IP address, use the new software management program to install the required software, configure Chinese support, etc, in particular, the NFS client software nfs-common must be installed to upload the wks system files to the server, and initramfs-tools must be installed to generate initrd. imgfile.

2. Generate initrd. img suitable for network startup
First, configure/etc/initramfs-tools/initramfs. conf. The file content is as follows:
MODULES = netboot
BUSYBOX = y
BOOT = nfs
DEVICE = eth0
NFSROOT = auto
Run the following command after saving the disk:
Mkinitramfs-o/root/initrd. img
In this way, the initrd. img suitable for network startup is generated under the/root directory.

3. Upload the wks system file to the server
After the server is started, run the following command on the workstation to mount the Network File System:
Mount 192.168.1.5:/exports/mnt
Upload the wks system file to the server
Cp-ax/./mnt /.
Cp-ax/dev/./mnt/dev /.

4. Modify the network card settings
Edit/mnt/etc/network/interfaces with the following content:
Auto lo
Iface lo inet loopback
Iface eth0 inet manual

5. Modify the file Mount table
Edit/mnt/etc/fstab with the following content:
#/Etc/fstab: static file system information.
#
Proc/proc defaults 0 0
/Dev/nfs defaults 1 1
Run the following command to uninstall the Network File System:
Umount/mnt

Iii. server end final settings

Log on to the server using the root account and run the following command:
Cp/exports/vmlinuz/tftpboot/
Cp/exports/root/initrd. img/tftpboot/
Restart the server, remove the hard disk of the workstation, and set the bios to PXE after boot. the workstation should be started to the graphic logon interface.

Iv. switch device settings

The above-mentioned diskless workstation has no switching device, and there may be problems when running some large programs. You can add the switching device as follows:
Run the following command on the terminal:
Dd if =/dev/zero of = $ HOME/swapfile bs = 1024 count = 512000
Sudo losetup/dev/loop0 $ HOME/swapfile
Sudo mkswap/dev/loop0
Sudo swapon/dev/loop0
Swapon-s
We should see that M swap devices are available, and the performance will be better if there is a local hard disk as swap device.

5. Notes

The display card models of multiple diskless stations should be the same; otherwise, the X Window may fail to start, and the network settings cannot be drum up on the diskless workstation; otherwise, the connection to the NFS server will be interrupted, it is best to hide the network setting tool when the diskless website is killed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.