<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-CA">
	<id>http://nikosapi.org/w/index.php?action=history&amp;feed=atom&amp;title=PXE_boot_Ubuntu_from_a_Debian_server</id>
	<title>PXE boot Ubuntu from a Debian server - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://nikosapi.org/w/index.php?action=history&amp;feed=atom&amp;title=PXE_boot_Ubuntu_from_a_Debian_server"/>
	<link rel="alternate" type="text/html" href="http://nikosapi.org/w/index.php?title=PXE_boot_Ubuntu_from_a_Debian_server&amp;action=history"/>
	<updated>2026-05-09T18:50:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>http://nikosapi.org/w/index.php?title=PXE_boot_Ubuntu_from_a_Debian_server&amp;diff=51&amp;oldid=prev</id>
		<title>Nikosapi: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://nikosapi.org/w/index.php?title=PXE_boot_Ubuntu_from_a_Debian_server&amp;diff=51&amp;oldid=prev"/>
		<updated>2013-09-14T02:16:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-CA&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:16, 14 September 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-CA&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Nikosapi</name></author>
	</entry>
	<entry>
		<id>http://nikosapi.org/w/index.php?title=PXE_boot_Ubuntu_from_a_Debian_server&amp;diff=50&amp;oldid=prev</id>
		<title>Nikosapi at 15:59, 24 April 2011</title>
		<link rel="alternate" type="text/html" href="http://nikosapi.org/w/index.php?title=PXE_boot_Ubuntu_from_a_Debian_server&amp;diff=50&amp;oldid=prev"/>
		<updated>2011-04-24T15:59:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This guide will help you set up a server from which you can boot diskless clients over the network. This is dissimilar from LTSP because all the processing gets done on the client side (aka &amp;quot;a fat client&amp;quot;) instead of on the server. Here the server is only used as the client&amp;#039;s root filesystem which means that you don&amp;#039;t need a fancy server to support multiple clients (although the clients must have relatively modern hardware).&lt;br /&gt;
&lt;br /&gt;
In this guide Debian will be running on the server and the clients will be booting Ubuntu 10.10.&lt;br /&gt;
&lt;br /&gt;
==Install Debian on the server==&lt;br /&gt;
This is pretty straightforward, install from the &amp;quot;netinst&amp;quot; disk and select &amp;quot;Standard system&amp;quot; when asked what software to install.&lt;br /&gt;
&lt;br /&gt;
==Set up the Ubuntu chroot==&lt;br /&gt;
In order to boot from Ubuntu on the client machine we need an Ubuntu userland somewhere on the server (I chose /opt/chroots). The reason why we have to download debootstrap is because the version included in the Debian repos doesn&amp;#039;t contain the scripts necessary to install Ubuntu 10.10.&lt;br /&gt;
 aptitude install binutils&lt;br /&gt;
 wget http://http.us.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.29_all.deb&lt;br /&gt;
 dpkg -i debootstrap_1.0.29_all.deb&lt;br /&gt;
 mkdir -p /opt/chroots/ubuntu10.10&lt;br /&gt;
 debootstrap --arch i386 maverick /opt/chroots/ubuntu10.10 http://archive.ubuntu.com/ubuntu/&lt;br /&gt;
&lt;br /&gt;
==Enter the Ubuntu chroot==&lt;br /&gt;
Now we need to do a bit of configuration before this distro will be bootable. Firstly, enter the chroot:&lt;br /&gt;
 chroot /opt/chroots/ubuntu10.10/&lt;br /&gt;
Run locale-gen to prevent annoying error messages from aptitude:&lt;br /&gt;
 locale-gen en_CA.UTF-8 # change &amp;quot;en_CA.UTF-8&amp;quot; to your current locale&lt;br /&gt;
Make up a hostname to help differentiate the chroot from the server:&lt;br /&gt;
 echo &amp;quot;ubuntuchroot&amp;quot; &amp;gt; /etc/hostname&lt;br /&gt;
Set up some dns servers (opendns is used in this example):&lt;br /&gt;
 echo -e &amp;quot;nameserver 208.67.222.222\nnameserver 208.67.220.220&amp;quot; &amp;gt; /etc/resolv.conf&lt;br /&gt;
Set up a nice apt sources.list:&lt;br /&gt;
 { for distro in maverick maverick-updates maverick-security; do&lt;br /&gt;
     for type in deb deb-src; do&lt;br /&gt;
         echo -n &amp;quot;$type http://archive.ubuntu.com/ubuntu $distro &amp;quot;&lt;br /&gt;
         echo main restricted universe multiverse&lt;br /&gt;
     done&lt;br /&gt;
 done; } &amp;gt; /etc/apt/sources.list&lt;br /&gt;
That script should yield an /etc/apt/sources.list that looks something like this:&lt;br /&gt;
 deb http://archive.ubuntu.com/ubuntu maverick main restricted universe multiverse&lt;br /&gt;
 deb-src http://archive.ubuntu.com/ubuntu maverick main restricted universe multiverse&lt;br /&gt;
 deb http://archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse&lt;br /&gt;
 deb-src http://archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse&lt;br /&gt;
 deb http://archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse&lt;br /&gt;
 deb-src http://archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse&lt;br /&gt;
&lt;br /&gt;
Update your apt cache and install a kernel image:&lt;br /&gt;
 aptitude update&lt;br /&gt;
 aptitude install linux-image-generic&lt;br /&gt;
Modify the initramfs config to support booting over NFS (change BOOT=local to BOOT=nfs):&lt;br /&gt;
 sed -i &amp;#039;s/BOOT=local/BOOT=nfs/&amp;#039; /etc/initramfs-tools/initramfs.conf&lt;br /&gt;
Add the NFS root filesystem mountpoint to /etc/fstab (setting up the NFS server is described later on):&lt;br /&gt;
 echo &amp;quot;NFS_SERVER_IP:/opt/chroots/ubuntu10.10   /   nfs    rw,noatime,nolock,vers=3   0   0&amp;quot; &amp;gt; /etc/fstab&lt;br /&gt;
Update the installed initramfs:&lt;br /&gt;
 update-initramfs -ck all&lt;br /&gt;
Set a root password:&lt;br /&gt;
 passwd # follow the prompts&lt;br /&gt;
&lt;br /&gt;
==Install and configure the TFTP server==&lt;br /&gt;
The bootloader, kernel and initrd are transfered over TFTP, so naturally we have to set up a TFTP server. (Make sure you&amp;#039;ve exited the Ubuntu chroot at this point)&lt;br /&gt;
&lt;br /&gt;
Install the TFTP server:&lt;br /&gt;
 aptitude install tftpd-hpa&lt;br /&gt;
Make the base directory that tftpd will serve from:&lt;br /&gt;
 mkdir /opt/tftpboot&lt;br /&gt;
Change the line in /etc/inetd.conf that looks like this:&lt;br /&gt;
 tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot&lt;br /&gt;
To this:&lt;br /&gt;
 tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /opt/tftpboot&lt;br /&gt;
And restart the inetd daemon:&lt;br /&gt;
 /etc/init.d/openbsd-inetd restart&lt;br /&gt;
&lt;br /&gt;
==Install and configure PXELINUX==&lt;br /&gt;
PXELINUX is a bootloader that works over PXE, we use it to boot the Ubuntu kernel over the network.&lt;br /&gt;
&lt;br /&gt;
Install the PXELINUX image:&lt;br /&gt;
 aptitude install syslinux-common&lt;br /&gt;
Copy over the bootloader:&lt;br /&gt;
 cp /usr/lib/syslinux/pxelinux.0 /opt/tftpboot/&lt;br /&gt;
Make a boot directory and copy over the kernel and initrd images:&lt;br /&gt;
 mkdir /opt/tftpboot/boot&lt;br /&gt;
 cp -L /opt/chroots/ubuntu10.10/initrd.img /opt/tftpboot/boot/&lt;br /&gt;
 cp -L /opt/chroots/ubuntu10.10/vmlinuz /opt/tftpboot/boot/&lt;br /&gt;
Create a directory to hold the default PXELINUX config file:&lt;br /&gt;
 mkdir /opt/tftpboot/pxelinux.cfg&lt;br /&gt;
Add the following to the PXELINUX config file, /opt/tftpboot/pxelinux.cfg/default:&lt;br /&gt;
 default ubuntu-10.10&lt;br /&gt;
 timeout 1&lt;br /&gt;
 prompt 1&lt;br /&gt;
 serial 0 9600&lt;br /&gt;
 display display.msg&lt;br /&gt;
 &lt;br /&gt;
 label ubuntu-10.10&lt;br /&gt;
     kernel boot/vmlinuz&lt;br /&gt;
     append initrd=boot/initrd.img root=/dev/nfs nfsroot=NFS_SERVER_IP:/opt/chroots/ubuntu10.10 ip=dhcp rw&lt;br /&gt;
Replace &amp;#039;&amp;#039;&amp;#039;NFS_SERVER_IP&amp;#039;&amp;#039;&amp;#039; with the IP address of the Debian server; hostnames are not allowed as dns isn&amp;#039;t available that early in the boot process.&lt;br /&gt;
&lt;br /&gt;
Create a file that will display various boot options to the user:&lt;br /&gt;
 echo -e &amp;quot;\nBOOT OPTIONS\nubuntu-10.10&amp;quot; &amp;gt; /opt/tftpboot/display.msg&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s what the directory structure looks like:&lt;br /&gt;
 /opt:&lt;br /&gt;
     chroots/ tftpboot/&lt;br /&gt;
 /opt/chroots:&lt;br /&gt;
     ubuntu10.10/&lt;br /&gt;
 /opt/tftpboot:&lt;br /&gt;
     boot/ display.msg pxelinux.0 pxelinux.cfg/&lt;br /&gt;
 /opt/tftpboot/boot:&lt;br /&gt;
     initrd.img vmlinuz&lt;br /&gt;
 /opt/tftpboot/pxelinux.cfg:&lt;br /&gt;
     default&lt;br /&gt;
&lt;br /&gt;
==Configure NFS==&lt;br /&gt;
We use NFS to mount the root filesystem over the network, here&amp;#039;s how to set it up.&lt;br /&gt;
&lt;br /&gt;
Install the required packages:&lt;br /&gt;
 aptitude install nfs-kernel-server nfs-server&lt;br /&gt;
Add something like the following to /etc/exports (eg. replace A.B.C with 192.168.0):&lt;br /&gt;
 /opt/chroots/ A.B.C.0/255.255.255.0(rw,no_root_squash,no_subtree_check)&lt;br /&gt;
Export the NFS share(s):&lt;br /&gt;
 exportfs -ra&lt;br /&gt;
&lt;br /&gt;
==Configure DHCP==&lt;br /&gt;
In order for PXE to find a boot server it uses a special DHCP option. This is very easy to set up if you have a router running DD-WRT.&lt;br /&gt;
&lt;br /&gt;
Go the following section:&lt;br /&gt;
 Services-&amp;gt;Services-&amp;gt;Additional DNSMasq Options&lt;br /&gt;
Add the following string:&lt;br /&gt;
 dhcp-boot=pxelinux.0,some-server,A.B.C.D&lt;br /&gt;
Where &amp;quot;some-server&amp;quot; is the hostname of the server and A.B.C.D is it&amp;#039;s IP address.&lt;br /&gt;
&lt;br /&gt;
==You&amp;#039;re done! Kinda...==&lt;br /&gt;
At this point you should be able to boot off any computer that supports PXE booting. The next sections cover what to do once you&amp;#039;re running on the client computer.&lt;br /&gt;
&lt;br /&gt;
==Installing a desktop environment==&lt;br /&gt;
The bootstrapped version of Ubuntu that you&amp;#039;re left with is very minimal, so let&amp;#039;s install the standard Ubuntu desktop.&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s as easy as:&lt;br /&gt;
 aptitude install ubuntu-desktop&lt;br /&gt;
&lt;br /&gt;
This will take a long while because everything is being installed over the network (unless you&amp;#039;re lucky enough to be using gigabit). It&amp;#039;s important to install from the client because a lot of things won&amp;#039;t install properly from the chroot on the server.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;BOLD NOTE:&amp;#039;&amp;#039;&amp;#039; After the installation completes the first thing you should do is disable NetworkManager. If you don&amp;#039;t, NM has a bad habit of killing you network connection right before GDM starts which means you&amp;#039;ll lose access to /.&lt;br /&gt;
&lt;br /&gt;
Disable it like so:&lt;br /&gt;
 update-rc.d -f NetworkManager remove&lt;br /&gt;
&lt;br /&gt;
==Optional: Add memtest86+ as a boot option==&lt;br /&gt;
A PXE boot server is a great way to have access to utilities like memtest86+, here&amp;#039;s how to set it up.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This doesn&amp;#039;t work, and I&amp;#039;m not sure why, see: http://forum.canardpc.com/showthread.php?t=28864&lt;br /&gt;
&lt;br /&gt;
Install memtest86+ on the server:&lt;br /&gt;
 aptitude install memtest86+&lt;br /&gt;
Copy over the memtest86+ binary:&lt;br /&gt;
 cp /boot/memtest86+.bin /opt/tftpboot/boot/&lt;br /&gt;
Add the following to the bottom of /opt/tftpboot/pxelinux.cfg/default:&lt;br /&gt;
 label memtest86&lt;br /&gt;
     kernel boot/memtest86+.bin &lt;br /&gt;
Add the listing to display.msg:&lt;br /&gt;
 echo memtest86 &amp;gt;&amp;gt; /opt/tftpboot/display.msg&lt;br /&gt;
&lt;br /&gt;
==TODO==&lt;br /&gt;
This guide is far from complete. Here are things that still need to be done/added:&lt;br /&gt;
* Security considerations (nfs auth, etc)&lt;br /&gt;
* More comprehensive DHCP setup info&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
* [http://www.howtoforge.com/pxe_booting_debian Similar tutorial on howtoforge]&lt;br /&gt;
* [http://www.linux.org/docs/ldp/howto/Diskless-root-NFS-other-HOWTO-4.html Info on kernel boot options relating to nfsroot]&lt;br /&gt;
* [http://www.rom-o-matic.net/ ROM-o-Matic - make PXE bootdisks for PCs with broken/non-existant PXE support]&lt;br /&gt;
* [http://syslinux.zytor.com/wiki/index.php/PXELINUX The PXELINUX wiki]&lt;br /&gt;
* [http://pxe.dev.aboveaverageurl.com/index.php/Main_Page Lots of PXE booting information]&lt;/div&gt;</summary>
		<author><name>Nikosapi</name></author>
	</entry>
</feed>