Jan. 24, 2011, 5:19 a.m.
posted by void
Install from a Network Boot Server
Boot your computer directly off a network server and install Ubuntu without using a CD. Most modern computers can search the network for a boot server and load the operating system from it without using a local hard disk. This feature is typically used to boot thin clients that may not contain a hard disk at all, but you can also use it as a clever way to start the Ubuntu installation process without needing an install CD. This hack is perfect if you want to install Ubuntu onto a subnotebook with no CD-ROM drive or need to set up a large number of computers for a cluster, lab, or server farm. Prepare the PXE Boot ServerThe first step is to prepare the PXE boot server that will dish up the Ubuntu install image to your client. The easiest way to set this up is with an existing Linux server you have kicking around. This boot server stores the install image and provides DHCP and TFTP (trivial FTP) services so that computers on the network can find and load the image when they start up. The whole process is triggered by the client connecting to the DHCP server and receiving special instructions telling it to fetch its boot image from the TFTP server instead of from the local hard disk. Configure DHCPIf you don't already have a DHCP server on your network, start by installing the dhcp-server package on the machine that will be your PXE Boot server: $ sudo apt-get install dhcp-server
Then edit /etc/dhcp3/dhcpd/dhcpd.conf and add a stanza similar to this: host pxeinstall {
hardware ethernet 00:00:00:00:00:00:00;
filename "pxelinux.0";
}Substitute the hardware MAC address of your client's Ethernet card in place of the string of zeros. Strictly speaking, you don't need the hardware line at all, but if you include it, your DHCP server will serve up the boot image only to that specific machine, so you won't need to worry about other random machines picking it up and reinstalling Ubuntu over their existing systems. On the other hand, if you're going to do installs on a lot of machines, you can just leave out that line, and every machine that netboots will be able to run the installer. Once you have updated the config restart the DHCP server: $ sudo /etc/init.d/dhcpd restart
Configure TFTPInstall a TFTP server: $ sudo apt-get install tftpd-hpa
Check /etc/inetd.conf and make sure it has a line like this: tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd Next, restart inetd: $ sudo /etc/init.d/inetd restart
Now you need to fetch the netboot install image (type the following all on one line): $ sudo lftp -c "open http://archive.ubuntu.com/ubuntu/dists/dapper/main/installer-i386/current/images/; mirror netboot/"
You will then have a directory called netboot with a number of files in it that need to be placed where the TFTP server can find them. The inetd config line listed earlier shows the path that tftp-hpa uses to store boot imagestypically /var/lib/tftpbootso copy the files there and extract the boot image: $ sudo cp -a netboot/* /var/lib/tftpboot
$ sudo cd /var/lib/tftpboot
$ sudo tar zxf netboot.tar.gz
Boot the ClientIn order to start the install process, your client machine needs to be able to perform a PXE network boot. Most modern machines can do this directly with a BIOS setting, although some older machines may need a special netboot floppy image to start the process. Start up your client machine, use whatever key sequence is necessary to enter the BIOS setup menu, and locate the setting for boot devices. (The key sequence to enter the BIOS is usually something like F2 or Esc.) Set the first boot device to be PXE Boot, Network Boot, or the equivalent; save and exit the BIOS; and let the machine boot up again.
This time, your machine should report that it's looking for a DHCP server before it gets to the stage of trying to boot off the hard disk. After being given an IP address, it will report that it's searching for a PXE boot image. A couple of seconds later, you should see the Ubuntu installer splash screen, and after that, the installation can proceed exactly as normalexcept that all packages will be fetched directly from an Ubuntu mirror rather than from a local CD-ROM. |
- Comment
