特殊:Badtitle/NS100:PXEInstallServer:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示2个用户的9个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/PXEInstallServer}} | {{From|https://help.ubuntu.com/community/PXEInstallServer}} | ||
{{Languages| | {{Languages|UbuntuHelp:PXEInstallServer}} | ||
=== Introduction === | === Introduction === | ||
This will guide you through running an Ubuntu server as PXE install server. | This will guide you through running an Ubuntu server as PXE install server. | ||
You'll need to run a DHCP server on your network, not necessarily this server but you do need one. | You'll need to run a DHCP server on your network, not necessarily this server but you do need one. | ||
=== Installing needed packages === | === Installing needed packages === | ||
You'll need to install the following packages <code><nowiki>netkit-inetd, tftpd-hpa</nowiki></code> (see InstallingSoftware). | You'll need to install the following packages <code><nowiki>inetutils-inetd (previously netkit-inetd), tftpd-hpa</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). | ||
If this is also going to be your DHCP server, install dhcp server contained in the follwing package: <code><nowiki>dhcp3-server</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]) | |||
If this is also going to be your DHCP server, install dhcp server contained in the follwing package: <code><nowiki>dhcp3-server</nowiki></code> (see InstallingSoftware) | === Configure tftpd-hpa === | ||
You'll need to tell tftpd-hpa to start its daemon (which it doesn't by default). To do this, edit the /etc/default/tftpd-hpa file, and make sure that it looks something like this: | |||
<pre><nowiki> | |||
#Defaults for tftpd-hpa | |||
RUN_DAEMON="yes" | |||
OPTIONS="-l -s /var/lib/tftpboot" | |||
</nowiki></pre> | |||
Then, run the startup script to actually start the daemon | |||
<pre><nowiki> | |||
/etc/init.d/tftpd-hpa restart | |||
</nowiki></pre> | |||
=== Configure dhcpd === | === Configure dhcpd === | ||
If your pxe server is also your dhcp server, you'll need something like this in /etc/dhcp3/dhcpd.conf | If your pxe server is also your dhcp server, you'll need something like this in /etc/dhcp3/dhcpd.conf | ||
第18行: | 第26行: | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
If you have an existing dhcp server, you should point it to your pxe server by doing something like the following | If you have an existing dhcp server, you should point it to your pxe server by doing something like the following | ||
<pre><nowiki> | <pre><nowiki> | ||
第27行: | 第34行: | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
Be sure to restart your dhcp server so that the changes take effect | Be sure to restart your dhcp server so that the changes take effect | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo /etc/init.d/dhcp3-server restart | sudo /etc/init.d/dhcp3-server restart | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Configure tftpd-hpa === | === Configure tftpd-hpa === | ||
tftpd-hpa is called from inetd. The options passed to tftpd-hpa when it starts are thus found in /etc/inetd.conf | tftpd-hpa is called from inetd. The options passed to tftpd-hpa when it starts are thus found in /etc/inetd.conf | ||
The defaults are fine for us, your /etc/inetd.conf should have an entry like this | The defaults are fine for us, your /etc/inetd.conf should have an entry like this | ||
<pre><nowiki> | <pre><nowiki> | ||
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot | tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot | ||
</nowiki></pre> | </nowiki></pre> | ||
(although you may need to edit this file and replace udp with 'udp4', as tftpd-hpa seems to expect an IPv6 address now) | |||
Now we'll copy the needed files from the Ubuntu CD | Now we'll copy the needed files from the Ubuntu CD | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo cp -r /media/cdrom/install/netboot/* /var/lib/tftpboot/ | sudo cp -r /media/cdrom/install/netboot/* /var/lib/tftpboot/ | ||
</nowiki></pre> | </nowiki></pre> | ||
If your dhcp server issues correct network info and your pxe clients will have network access, then at this point you will be able to do an Ubuntu install using internet repositories. | If your dhcp server issues correct network info and your pxe clients will have network access, then at this point you will be able to do an Ubuntu install using internet repositories. | ||
I want to go a little further however and install everything from the install server as well as customise some of the packages to install. | I want to go a little further however and install everything from the install server as well as customise some of the packages to install. | ||
=== Install apache === | === Install apache === | ||
Currently nfs installs aren't well supported (Please correct me if I'm wrong) so we'll install over http. For that we need a webserver on our install server too: install the following package <code><nowiki>apache</nowiki></code> (see InstallingSoftware). | Currently nfs installs aren't well supported (Please correct me if I'm wrong) so we'll install over http. For that we need a webserver on our install server too: install the following package <code><nowiki>apache</nowiki></code> (see [[UbuntuHelp:InstallingSoftware|InstallingSoftware]]). | ||
=== Copying Ubuntu files === | === Copying Ubuntu files === | ||
Create an ubuntu directory under your freshly installed apache's document root and copy all of the contents of the Ubuntu CD to that directory | Create an ubuntu directory under your freshly installed apache's document root and copy all of the contents of the Ubuntu Alternate CD to that directory | ||
<pre><nowiki> | <pre><nowiki> | ||
mkdir /var/www/ubuntu | mkdir /var/www/ubuntu | ||
cp -r /media/cdrom/* /var/www/ubuntu/ | cp -r /media/cdrom/* /var/www/ubuntu/ | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Customising the install === | === Customising the install === | ||
There is a package called system-config-kickstart which is a GUI frontend to creating kickstart files. The kickstart file tells the installer where to get its packages from, what to install and a number of other useful settings. | There is a package called system-config-kickstart which is a GUI frontend to creating kickstart files. The kickstart file tells the installer where to get its packages from, what to install and a number of other useful settings. | ||
See KickstartCompatibility for more info. | See [[UbuntuHelp:KickstartCompatibility|KickstartCompatibility]] for more info. | ||
This package does not have to be installed on your install server, it can be on a convenient Ubuntu desktop somewhere. | This package does not have to be installed on your install server, it can be on a convenient Ubuntu desktop somewhere. | ||
Create a custom ks.cfg with system-config-kickstart, be sure to specify HTTP under "Installation Method". Provide the IP of you install server and make the HTTP Directory /ubuntu/ | Create a custom ks.cfg with system-config-kickstart, be sure to specify HTTP under "Installation Method". Provide the IP of you install server and make the HTTP Directory /ubuntu/ | ||
Save the file and copy it to your install server under /var/www/html/ | Save the file and copy it to your install server under /var/www/html/ | ||
A very minimalist ks.cfg file which only uses the installation files on the install server and asks for all other questions might look like this | |||
<pre><nowiki> | |||
install | |||
url --url http://192.168.0.1/ubuntu/ | |||
</nowiki></pre> | |||
=== Use your ks.cfg === | === Use your ks.cfg === | ||
In order for your network Ubuntu install to use your kickstart file, you have to tell it where to find it. Edit /var/lib/tftpboot/pxelinux.cfg/default and add <code><nowiki>ks=http://<installserver>/ks.cfg</nowiki></code> to the append line. | In order for your network Ubuntu install to use your kickstart file, you have to tell it where to find it. Edit /var/lib/tftpboot/pxelinux.cfg/default and add <code><nowiki>ks=http://<installserver>/ks.cfg</nowiki></code> to the append line. | ||
It should then look something like this | It should then look something like this (note that the append line is one line) | ||
<pre><nowiki> | <pre><nowiki> | ||
label linux | label linux | ||
kernel ubuntu-installer/i386/linux | kernel ubuntu-installer/i386/linux | ||
append ks=http://192.168.0.1/ks.cfg vga=normal | append ks=http://192.168.0.1/ks.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16432 root=/dev/rd/0 rw -- | ||
</nowiki></pre> | |||
label | In Jaunty the default file has been broken up into includes. The append line can be found in /ubuntu-installer/i386/boot-screens/text.cfg | ||
<pre><nowiki> | |||
label install | |||
menu label ^Install (from my http server) | |||
menu default | |||
kernel ubuntu-installer/i386/linux | |||
append ks=http://192.168.0.1/ks.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz -- quiet | |||
</nowiki></pre> | </nowiki></pre> | ||
=== Boot and install === | === Boot and install === | ||
You should now be able to boot another pc on the lan over the network and have it install Ubuntu automagically :) | You should now be able to boot another pc on the lan over the network and have it install Ubuntu automagically :) You can vary the tftp and http install points to have multiple versions of Ubuntu available to install on your network. | ||
=== Using the CD (or .iso) directly === | |||
You can also achieve the above without actually copying any files anywhere. You can mount the CD (or the .iso) and then do additional mounts with the --bind option. The advantage is that you can upgrade the CD (or the .iso) without needing to update the install server files. | |||
For example, after mounting the CD (or the .iso) to /media/cdrom/, you can mount the ubuntu files to the web directory | |||
<pre><nowiki> | |||
mount --bind /media/cdrom/ /var/www/ubuntu/ | |||
</nowiki></pre> | |||
Similarly, you can do the same with the tftproot: | |||
<pre><nowiki> | |||
mount --bind /media/cdrom/install/netboot/ /var/lib/tftpboot/ | |||
</nowiki></pre> | |||
If you were to create a pxelinux.cfg directory with an appropriate default file, you can mount that over the top of the mounted CD, so that the tftp server gives out your pxelinux.cfg/default file. For example, a pxelinux.cfg directory in ~/pxelinux.cfg could be mounted like this | |||
<pre><nowiki> | |||
mount --bind ~/pxelinux.cfg /var/lib/tftpboot/pxelinux.cfg | |||
</nowiki></pre> | |||
(Note that in the above example, the actual mount point of the directory would end up as /var/lib/tftpboot/ubuntu-installer/i386/pxelinux.cfg because the pxelinux.cfg is a symlink on the CD (or .iso)) | |||
---- | ---- | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月19日 (三) 23:59的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/PXEInstallServer }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/af | • {{#if: UbuntuHelp:PXEInstallServer|Afrikaans| [[::PXEInstallServer/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ar | • {{#if: UbuntuHelp:PXEInstallServer|العربية| [[::PXEInstallServer/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/az | • {{#if: UbuntuHelp:PXEInstallServer|azərbaycanca| [[::PXEInstallServer/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/bcc | • {{#if: UbuntuHelp:PXEInstallServer|جهلسری بلوچی| [[::PXEInstallServer/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/bg | • {{#if: UbuntuHelp:PXEInstallServer|български| [[::PXEInstallServer/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/br | • {{#if: UbuntuHelp:PXEInstallServer|brezhoneg| [[::PXEInstallServer/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ca | • {{#if: UbuntuHelp:PXEInstallServer|català| [[::PXEInstallServer/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/cs | • {{#if: UbuntuHelp:PXEInstallServer|čeština| [[::PXEInstallServer/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/de | • {{#if: UbuntuHelp:PXEInstallServer|Deutsch| [[::PXEInstallServer/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/el | • {{#if: UbuntuHelp:PXEInstallServer|Ελληνικά| [[::PXEInstallServer/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/es | • {{#if: UbuntuHelp:PXEInstallServer|español| [[::PXEInstallServer/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/fa | • {{#if: UbuntuHelp:PXEInstallServer|فارسی| [[::PXEInstallServer/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/fi | • {{#if: UbuntuHelp:PXEInstallServer|suomi| [[::PXEInstallServer/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/fr | • {{#if: UbuntuHelp:PXEInstallServer|français| [[::PXEInstallServer/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/gu | • {{#if: UbuntuHelp:PXEInstallServer|ગુજરાતી| [[::PXEInstallServer/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/he | • {{#if: UbuntuHelp:PXEInstallServer|עברית| [[::PXEInstallServer/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/hu | • {{#if: UbuntuHelp:PXEInstallServer|magyar| [[::PXEInstallServer/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/id | • {{#if: UbuntuHelp:PXEInstallServer|Bahasa Indonesia| [[::PXEInstallServer/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/it | • {{#if: UbuntuHelp:PXEInstallServer|italiano| [[::PXEInstallServer/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ja | • {{#if: UbuntuHelp:PXEInstallServer|日本語| [[::PXEInstallServer/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ko | • {{#if: UbuntuHelp:PXEInstallServer|한국어| [[::PXEInstallServer/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ksh | • {{#if: UbuntuHelp:PXEInstallServer|Ripoarisch| [[::PXEInstallServer/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/mr | • {{#if: UbuntuHelp:PXEInstallServer|मराठी| [[::PXEInstallServer/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ms | • {{#if: UbuntuHelp:PXEInstallServer|Bahasa Melayu| [[::PXEInstallServer/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/nl | • {{#if: UbuntuHelp:PXEInstallServer|Nederlands| [[::PXEInstallServer/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/no | • {{#if: UbuntuHelp:PXEInstallServer|norsk| [[::PXEInstallServer/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/oc | • {{#if: UbuntuHelp:PXEInstallServer|occitan| [[::PXEInstallServer/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/pl | • {{#if: UbuntuHelp:PXEInstallServer|polski| [[::PXEInstallServer/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/pt | • {{#if: UbuntuHelp:PXEInstallServer|português| [[::PXEInstallServer/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ro | • {{#if: UbuntuHelp:PXEInstallServer|română| [[::PXEInstallServer/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/ru | • {{#if: UbuntuHelp:PXEInstallServer|русский| [[::PXEInstallServer/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/si | • {{#if: UbuntuHelp:PXEInstallServer|සිංහල| [[::PXEInstallServer/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/sq | • {{#if: UbuntuHelp:PXEInstallServer|shqip| [[::PXEInstallServer/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/sr | • {{#if: UbuntuHelp:PXEInstallServer|српски / srpski| [[::PXEInstallServer/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/sv | • {{#if: UbuntuHelp:PXEInstallServer|svenska| [[::PXEInstallServer/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/th | • {{#if: UbuntuHelp:PXEInstallServer|ไทย| [[::PXEInstallServer/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/tr | • {{#if: UbuntuHelp:PXEInstallServer|Türkçe| [[::PXEInstallServer/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/vi | • {{#if: UbuntuHelp:PXEInstallServer|Tiếng Việt| [[::PXEInstallServer/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/yue | • {{#if: UbuntuHelp:PXEInstallServer|粵語| [[::PXEInstallServer/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/zh | • {{#if: UbuntuHelp:PXEInstallServer|中文| [[::PXEInstallServer/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/zh-hans | • {{#if: UbuntuHelp:PXEInstallServer|中文(简体)| [[::PXEInstallServer/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:PXEInstallServer | UbuntuHelp:PXEInstallServer | {{#if: | :}}PXEInstallServer}}/zh-hant | • {{#if: UbuntuHelp:PXEInstallServer|中文(繁體)| [[::PXEInstallServer/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:PXEInstallServer|:PXEInstallServer|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :PXEInstallServer/zh | | {{#ifexist: PXEInstallServer/zh | | {{#ifeq: {{#titleparts:PXEInstallServer|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:PXEInstallServer|1|-1|}} | zh | | }}
Introduction
This will guide you through running an Ubuntu server as PXE install server. You'll need to run a DHCP server on your network, not necessarily this server but you do need one.
Installing needed packages
You'll need to install the following packages inetutils-inetd (previously netkit-inetd), tftpd-hpa
(see InstallingSoftware).
If this is also going to be your DHCP server, install dhcp server contained in the follwing package: dhcp3-server
(see InstallingSoftware)
Configure tftpd-hpa
You'll need to tell tftpd-hpa to start its daemon (which it doesn't by default). To do this, edit the /etc/default/tftpd-hpa file, and make sure that it looks something like this:
#Defaults for tftpd-hpa RUN_DAEMON="yes" OPTIONS="-l -s /var/lib/tftpboot"
Then, run the startup script to actually start the daemon
/etc/init.d/tftpd-hpa restart
Configure dhcpd
If your pxe server is also your dhcp server, you'll need something like this in /etc/dhcp3/dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.100 192.168.0.200; filename "pxelinux.0"; }
If you have an existing dhcp server, you should point it to your pxe server by doing something like the following
subnet 192.168.0.0 netmask 255.255.255.0 { <other config here> filename "pxelinux.0"; next-server <pxe host>; }
Be sure to restart your dhcp server so that the changes take effect
sudo /etc/init.d/dhcp3-server restart
Configure tftpd-hpa
tftpd-hpa is called from inetd. The options passed to tftpd-hpa when it starts are thus found in /etc/inetd.conf The defaults are fine for us, your /etc/inetd.conf should have an entry like this
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
(although you may need to edit this file and replace udp with 'udp4', as tftpd-hpa seems to expect an IPv6 address now) Now we'll copy the needed files from the Ubuntu CD
sudo cp -r /media/cdrom/install/netboot/* /var/lib/tftpboot/
If your dhcp server issues correct network info and your pxe clients will have network access, then at this point you will be able to do an Ubuntu install using internet repositories. I want to go a little further however and install everything from the install server as well as customise some of the packages to install.
Install apache
Currently nfs installs aren't well supported (Please correct me if I'm wrong) so we'll install over http. For that we need a webserver on our install server too: install the following package apache
(see InstallingSoftware).
Copying Ubuntu files
Create an ubuntu directory under your freshly installed apache's document root and copy all of the contents of the Ubuntu Alternate CD to that directory
mkdir /var/www/ubuntu cp -r /media/cdrom/* /var/www/ubuntu/
Customising the install
There is a package called system-config-kickstart which is a GUI frontend to creating kickstart files. The kickstart file tells the installer where to get its packages from, what to install and a number of other useful settings. See KickstartCompatibility for more info. This package does not have to be installed on your install server, it can be on a convenient Ubuntu desktop somewhere. Create a custom ks.cfg with system-config-kickstart, be sure to specify HTTP under "Installation Method". Provide the IP of you install server and make the HTTP Directory /ubuntu/ Save the file and copy it to your install server under /var/www/html/ A very minimalist ks.cfg file which only uses the installation files on the install server and asks for all other questions might look like this
install url --url http://192.168.0.1/ubuntu/
Use your ks.cfg
In order for your network Ubuntu install to use your kickstart file, you have to tell it where to find it. Edit /var/lib/tftpboot/pxelinux.cfg/default and add ks=http://<installserver>/ks.cfg
to the append line.
It should then look something like this (note that the append line is one line)
label linux kernel ubuntu-installer/i386/linux append ks=http://192.168.0.1/ks.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16432 root=/dev/rd/0 rw --
In Jaunty the default file has been broken up into includes. The append line can be found in /ubuntu-installer/i386/boot-screens/text.cfg
label install menu label ^Install (from my http server) menu default kernel ubuntu-installer/i386/linux append ks=http://192.168.0.1/ks.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz -- quiet
Boot and install
You should now be able to boot another pc on the lan over the network and have it install Ubuntu automagically :) You can vary the tftp and http install points to have multiple versions of Ubuntu available to install on your network.
Using the CD (or .iso) directly
You can also achieve the above without actually copying any files anywhere. You can mount the CD (or the .iso) and then do additional mounts with the --bind option. The advantage is that you can upgrade the CD (or the .iso) without needing to update the install server files. For example, after mounting the CD (or the .iso) to /media/cdrom/, you can mount the ubuntu files to the web directory
mount --bind /media/cdrom/ /var/www/ubuntu/
Similarly, you can do the same with the tftproot:
mount --bind /media/cdrom/install/netboot/ /var/lib/tftpboot/
If you were to create a pxelinux.cfg directory with an appropriate default file, you can mount that over the top of the mounted CD, so that the tftp server gives out your pxelinux.cfg/default file. For example, a pxelinux.cfg directory in ~/pxelinux.cfg could be mounted like this
mount --bind ~/pxelinux.cfg /var/lib/tftpboot/pxelinux.cfg
(Note that in the above example, the actual mount point of the directory would end up as /var/lib/tftpboot/ubuntu-installer/i386/pxelinux.cfg because the pxelinux.cfg is a symlink on the CD (or .iso))