<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bits &#124; andy smith&#039;s blog &#187; pxelinux</title>
	<atom:link href="http://andys.org.uk/bits/tag/pxelinux/feed/" rel="self" type="application/rss+xml" />
	<link>http://andys.org.uk/bits</link>
	<description>random stuff from the mind of a twenty-something professional geek</description>
	<lastBuildDate>Sat, 21 Jan 2012 18:36:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PXE booting a Debian Squeeze install</title>
		<link>http://andys.org.uk/bits/2010/03/22/pxe-booting-a-debian-squeeze-install/</link>
		<comments>http://andys.org.uk/bits/2010/03/22/pxe-booting-a-debian-squeeze-install/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 12:42:49 +0000</pubDate>
		<dc:creator>Andy Smith</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[pxeboot]]></category>
		<category><![CDATA[pxelinux]]></category>
		<category><![CDATA[squeeze]]></category>

		<guid isPermaLink="false">http://andys.org.uk/bits/?p=78</guid>
		<description><![CDATA[Update: I&#8217;ve not tested myself, but the comment from Sombunall below points out that package names for the TFTP server and the DHCP server have changed since I wrote this post! It&#8217;s often the case that there&#8217;s no easy way of installing a machine that doesn&#8217;t have any removable media. For instance, I have an [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Update</strong>: I&#8217;ve not tested myself, but the <a href="http://andys.org.uk/bits/2010/03/22/pxe-booting-a-debian-squeeze-install/comment-page-1/#comment-7994">comment from Sombunall below</a> points out that package names for the TFTP server and the DHCP server have changed since I wrote this post!</em></p>
<p>It&#8217;s often the case that there&#8217;s no easy way of installing a machine that doesn&#8217;t have any removable media. For instance, I have an old <a href="http://h18000.www1.hp.com/products/quickspecs/10021_div/10021_div.HTML">Compaq Deskpro EN</a> that&#8217;s too old to support booting from USB, so using something like <a href="http://http://unetbootin.sourceforge.net/">UNetbootin</a> is out of the question. Luckily, there&#8217;s an an alternative, which is to <a href="http://en.wikipedia.org/wiki/Preboot_Execution_Environment">PXE</a> boot an installer over the network.</p>
<p><span id="more-78"></span><br />
PXE (or <em>Preboot eXecution Environment</em>) is a means of booting a machine over a network,which conveniently removes any requirement for anything special on the machine that&#8217;s to be installed other than an network card. PXE boot (or <em>network boot</em>) support tends to be available in older machines that don&#8217;t support booting from USB, so it&#8217;s a very useful feature to be able to use.</p>
<p>There&#8217;s a very useful article on <a href="http://www.debian-administration.org/articles/478">Debian Administration</a> that covers configuring a Debian machine to act as a PXE boot server to serve out an <a href="http://wiki.debian.org/DebianEtch">etch</a> installer. I personally run <a href="http://www.debian.org/releases/testing/">squeeze</a>, so I&#8217;ve used the article as a basis for setting up a Debian squeeze machine to serve out a squeeze installer.</p>
<h3>Installing the prerequisites</h3>
<p>To start with, we need a TFTP server and a DHCP server. You might already have one (or both) of these installed already, but for the purposes of this we&#8217;ll assume that you haven&#8217;t. So, to get started, install the tftpd-hpa and dhcp3-server packages:-</p>
<blockquote><p><code>apt-get install tftpd-hpa dhcp3-server</code></p></blockquote>
<h3>Configuring DHCPd</h3>
<p>First, make sure that the tftpboot directory exists. This used to be <code>/var/lib/tftpboot</code>, but Debian now uses <code>/srv/tftpboot</code>. The installer should have created it, but just in case, check it exists and if create it if not.</p>
<p>The next step is to add a subnet declaration to <code>/etc/dhcp3/dhcpd.conf</code> for your network. A simple one will be something like this:-</p>
<blockquote>
<pre>subnet 192.168.51.0 netmask 255.255.255.0 {
       range 192.168.51.64 192.168.51.80;
       <span style="color: #008000;">filename "pxelinux.0";
       next-server 192.168.51.1;</span>
       option routers 192.168.51.1;
}</pre>
</blockquote>
<p>If you&#8217;ve already got DHCPd installed and configured, the two lines highlighted in green are the ones you need to add to your existing subnet declaration. The <code>filename</code> option tells PXE clients which file they need to request via TFTP, and the <code>next-server</code> option tells the clients the TFTP server they should use to get it.</p>
<h3>Creating the PXE boot environment</h3>
<p>Before we pull down any of the installer files, we need to create somewhere for those files to go, along with the PXE boot configuration. So, create the <code>pxelinux.cfg</code> and <code>debian/squeeze/i386</code> directories:-</p>
<blockquote>
<pre>mkdir -pv /srv/tftpboot/pxelinux.cfg
mkdir -pv /srv/tftpboot/debian/squeeze/i386</pre>
</blockquote>
<p>Next, create the config for pxelinux in <code>pxelinux.cfg/default</code>:-</p>
<blockquote>
<pre>DISPLAY boot.txt

DEFAULT squeeze_i386_install

LABEL squeeze_i386_install
     kernel debian/squeeze/i386/linux
     append vga=normal initrd=debian/squeeze/i386/initrd.gz  --
LABEL squeeze_i386_linux
     kernel debian/squeeze/i386/linux
     append vga=normal initrd=debian/squeeze/i386/initrd.gz  --
LABEL squeeze_i386_expert
     kernel debian/squeeze/i386/linux
     append priority=low vga=normal initrd=debian/squeeze/i386/initrd.gz  --
LABEL squeeze_i386_rescue
     kernel debian/squeeze/i386/linux
     append vga=normal initrd=debian/squeeze/i386/initrd.gz  rescue/enable=true --
PROMPT 1
TIMEOUT 0</pre>
</blockquote>
<p>Then, create <code>boot.txt</code> in <code>pxelinux.cfg</code>, which is our boot menu:-</p>
<blockquote>
<pre>- Boot Menu -
=============

squeeze_i386_install
squeeze_i386_linux
squeeze_i386_expert
squeeze_i386_rescue</pre>
</blockquote>
<p>Finally, download the installer parts from the Debian FTP mirror:-</p>
<blockquote>
<pre>cd /srv/tftpboot/
wget <a title="http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0" rel="nofollow" href="http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0">http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0</a>
cd /srv/tftpboot/debian/squeeze/i386
wget <a title="http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/linux" rel="nofollow" href="http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/linux">http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/linux</a>
wget <a title="http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz" rel="nofollow" href="http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz">http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz</a></pre>
</blockquote>
<h3>Final steps</h3>
<p>Make sure that tftpd-hpa and dhcp3-server are running:-</p>
<blockquote><p><code>service tftpd-hpa restart<br />
service dhcp3-server restart</code></p></blockquote>
<p>You should now be able to network boot machines into the Debian squeeze installer.</p>
<p>I&#8217;ve also put this on the <a href="http://andys.org.uk/wiki">Bits Wiki</a> as a <a href="http://andys.org.uk/wiki/Guide:PXE_network_booting_Debian_install">guide</a> &#8211; feel free to have a look and add any notes you feel may be useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://andys.org.uk/bits/2010/03/22/pxe-booting-a-debian-squeeze-install/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

