HOWTO: Install Ubuntu over a network
I recently bought a laptop with a broken cdrom drive and this is how I’ve managed to put Ubuntu on it. The process is based on this tutorial on the official Ubuntu help site, although it differs slightly in software used and goes into more detail.
The Problem
I have a laptop I want to install Ubuntu on and I can’t use the cdrom. This method is also useful if you want to install Ubuntu on a bunch of machines at the same time without having to deal with the hassle of burning multiple copies of the cd image.
Minimum Requirements
This process is faily complicated and requires a few things that aren’t normally available. First off you need the target computer to support booting over PXE. Most modern BIOS support this nowadays, but if you’re dealing with legacy hardware this could be an issue. The second basic component is another computer which will act as the PXE server. You’ll need to install a dhcp server, a tftp server, and you’ll need to configure it to act as a internet proxy for the target computer. The point is that you need full access to this machine and you’ll need to have both machines connected over a network, preferably ethernet.
My setup
To make the tutorial easier to follow here’s what I have and what it’s called.
Joker (192.168.2.X) is the laptop I want to install Ubuntu on, it is connected through a switch to blackmesa (192.168.2.1) which is another laptop which acts as a router for the house network, it does dhcp, tftp and ip forwarding so that the other computers can get to the internet.
Let’s get started
First we’ll get blackmesa setup to serve the files we need. We’ll need to download the alternate cd image, or one of the minimal install images. The alternate image can be found next to the normal desktop and server images on any of the Ubuntu ftp mirrors. The minimal cd images are linked from a page on the Ubuntu help wiki.
The tutorial uses dnsmasq as the dhcp and tftp server, I used dhcp3-server because that’s what I already had running. dhcp3-server doesn’t have a built-in tftp server so we’ll need one as well.
sudo apt-get install tftpd-hpa tftp-hpa xinetd dhcp3-server
My /etc/dhcp3/dhcpd.conf
file looks like this:
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 80.58.61.250, 80.58.61.254;
range dynamic-bootp 192.168.2.2 192.168.2.254;
default-lease-time 21600;
max-lease-time 43200;
filename "pxelinux.0";
next-server 192.168.2.1;
}
The important lines are the last two. filename
specifies what the file PXE will try to grab is called, pxelinux.0
is the normal value for this and what the file Ubuntu uses is called. next-server
tells the client computer where to find the PXE files. In this case, because the tftp server and the dhcp server are the same the ip number is the same.
Now we copy the files we need for netboot. We mount the iso image as a loop device:
sudo mount -t iso9660 -o loop ubuntu-8.04.1-alternate-i386.iso /media/cdrom
And copy the files we need to the tftp server folder
sudo cp -a /media/cdrom/install/netboot/* /var/lib/tftpboot/
Next we configure the tftp server by creating a new file called /etc/xinetd.d/tftp
, it should look something like this:
service tftp
{
disable = no
socket_type = dgram
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -v -s /var/lib/tftpboot
}
And reboot the tftp service
sudo killall -HUP xinetd
The last thing you need to do is enable the host computer to do ip forwarding so that the client computer can get to the internet and download the packages it needs. To do so is fairly simple:
sudo su
echo 1 > /proc/sys/net/ipv4/ip_forward
If all is well we’re done setting up the host machine, blackmesa in this case.
Onto the client
Telling the client to boot from the network device is very easy but varies wildly from BIOS to BIOS. In my case I had to go into the boot order page and enable Ethernet device and set it as first option. Now when you reboot, your computer will bring up a text based installer. If it doesn’t and it gets stuck grabbing dhcp or comunicating with the tftp server then something is going wrong, in my case the process was so quick I didn’t even see this screen.
Once in the text based installer, continue the install process as you normally would, but remember to disable network booting after you’re done or you’ll get sent to the text based installer when you reboot.
4 Responses to HOWTO: Install Ubuntu over a network
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
-
Categories
- No categories
-
Articles
- October 2014
- May 2011
- April 2011
- January 2011
- December 2010
- November 2010
- September 2010
- August 2010
- July 2010
- February 2010
- December 2009
- August 2009
- June 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003
- August 2003
- July 2003
-
Meta
You have a typo “dchp3-server” -> “dhcp3-server”
Fixed, thanks!
[…] 1, […]
[…] http://theragingche.com/blog/2008/07/27/howto-install-ubuntu-over-a-network/ […]