Ubuntu Network Install
Introduction
Some days ago I had to install Ubuntu Breezy – a GNU/Linux flavour based on Debian and powered by apt-get – on four machines and I had only one CD-Rom available. And doing some fast calculations you can find out that it’s faster to install through a 100Mbps LAN (~12.5 Mb/s highest peek) than using a normal 52x CD-Rom.
Initially, the idea was to load the boot sector directly from the onboard network card. Unfortunately, I wasn’t able to do so (it skipped network boot as if it didn’t detect anything) and I decided to stick with that sometimes useful floppy disk and include a small boot sector that had the drivers included.
Ready to start?
Setting up the server
First off, you'll need a server where your clients will be connecting. That server must have a small FTP, HTTP and DHCP server and, obviously, an Ubuntu installation CD available. The DHCP allows your clients to connect to your network and the HTTP/FTP server will deliver installation files and package repositories.
Our FTP server will be tftpd-hpa. On Ubuntu/Debian this is a matter of
-
root@server$ apt-get install package-name
and that’s it, everything gets installed and set up. Let’s install everything at once:
-
root@server$ apt-get install tftpd-hpa apache2 dhcp3-server
Now it’s time to copy the content of the Ubuntu cd. Just do
-
root@server:/var/lib/tftpboot$ mkdir ubuntu
-
root@server:/var/lib/tftpboot$ mount -o loop /var/lib/tftpboot/ubuntu-5.10-install-i386.iso /var/lib/tftpboot/ubuntu
In order to get an ISO of your installation CD, you can do (astonish yourself)
-
root@server$ cat /dev/hdb > ubuntu-5.10-install-i386.iso
where hdb is your CD-Rom device. It can be anything else other than hdb so you’d better figure out with dmesg (root@server # dmesg) or doing whatever suits you.
Make a symlink from apache's root to the mounted ISO
-
root@server:/var/www # ln -s /var/lib/tftpboot/ubuntu/
configure the DHCP server according to your network:
-
root@server:~ # cat /etc/dhcp3/dhcpd.conf
-
ping-check = 1;
-
filename = "ubuntu/install/netboot/pxelinux.0";
-
subnet 192.168.1.0
-
netmask 255.255.255.0 {
-
range 192.168.1.10 192.168.1.254;
-
}
-
root@server:~ # /etc/init.d/dhcp3-server restart
-
Stopping DHCP server: dhcpd3.
-
Starting DHCP server: dhcpd3.
And now run the clients. If you were able to see the Ubuntu boot prompt, that’s it. Now you just have to carry on with the installation. Otherwise, if you didn’t see anything and the boot continued as usual – just like happened to me – then keep reading this tutorial.The alternative is, like I said before, using a boot disk with the drivers. Etherboot has what we’re looking for. Download the latest version and read the README file. Then you just have to find out which network card you have and follow the very quick instructions.
Did you like this article?
If this article helped you through then please consider donating. Even $1 USD makes a difference.




[…] I made available a tutorial to help you get started on installing Ubuntu Hoary/Breezy through a network. I’ve used this method to simultaneously install four machines and it worked like charm. […]
Great tutorial! I followed your step and it worked out fine. Some points that new users may miss:
1) you have to enable the dhcp interface or else the dhcp service won’t start up. I believe it’s in /etc/default/.
2) After the client boots from the PXE, make sure to point the mirror to your local server that has the Ubuntu ISO image during the installation. You have to scroll all the way to the top, right before Afghanistan.
Other than that, THANK YOU! This is the most simple of the tutorials I have found for doing a network install with Ubuntu!
Thanks for the guide..
I tried to install Ubuntu 7.10 alpha 3 using your guide but the ISO didn’t include the necessary PXE boot files yet..
You can download them manually from
http://archive.ubuntu.com/ubuntu/dists/gutsy/main/installer-i386/current/images/netboot/
File : netboot.tar.gz
Hi Seb,
Yes, the latest version does not come with the PXE boot files. Thanks for the reference to the location of those files.
Hi,
I am trying to install ubuntu(7or higher) over network without using official ubuntu mirror rather i want to install it from my mounted iso image(install cd) using PXE net booting from my local server.I got success to do it in ubuntu 5.1 disros which is having netbbot option under its install directory but it is missing in higher versions(7 or higher) for that i downloaded netboot.tar.gz file and it is helping me to boot over the network.But when i am manually giving my repository path during installation it is giving errors and stop the installation process.error was something like bad repo addr or addr not valid,release file missing.But the same process was working fine with ubuntu 5.1 distro.
So,if anybody knows how to do that one plz help me.
Thanks.
thanks! this is a great place for a noob to start with! ##pxe in irc.freenode has a good wiki, but its a bit confusing to start-out with.
Thanks for all the tips!
Two things I discovered while following these directions:
1. At least on my Dapper Drake system, the dhcpd-hpa init script on the server sources /etc/default/tftpd-hpa. This file defaults to RUN_DAEMON=”no”. I found “yes” works much better! :^)
2. Make sure you allow tftp (port 69) through the firewall (e.g. Firestarter) on the server.
Here’s my personal experience so far with 7.10, your mileage may vary. Netboot starts OK but I can’t get it to take my repo. I mounted the cdrom and made a symlink from it to /var/www/ubuntu, and I can browse there, but I get the message “The specified Ubuntu archive mirror is either not available, or does not hacve a valid Release file on it. Please try a different mirror.”
For reference, you only need to edit /etc/default/tftpd-hpa if you are not using inetd. The tftpd-hpa install places a line in /etc/inetd.conf, or at least SOMETHING on my system did.
Also note that you MUST have a tftp server ON your dhcp server because PXE uses bootp (right after it uses DHCP.) Good thinking, intel, you dipsticks.
Actually, 7.10 does include a netboot, but you need to get the alternative installer CD not the main one.