[Tech] example PXE boot setup on Debian (Ubuntu/Lubuntu should be relatively similar)

Michael Paoli Michael.Paoli at cal.berkeley.edu
Thu Apr 2 03:58:33 PDT 2015


> From: "Tai Kedzierski" <dch.tai at gmail.com>
> Subject: Re: [Tech] Partimus (PXE?) (nearly?) unattended install solution(s?)
> Date: Thu, 2 Apr 2015 11:26:53 +0100
>
> * Yeah I'm still stuck on PXE - I've had some pointers from Rab in EdLUG
> (basically, first, don't test using VirtualBox!) and Charlie's notes still
> to review. And Michael's notes when he has a moment :-)

Shouldn't be too hard with virtual (e.g. qemu-kvm, virtualbox, etc.),
but key bits to be aware of there: They typically give a NATed network
by default and including a built-in provided DHCP server on that network.
Such generally conflicts with doing PXE boot - so one typically wants
to place the virtual host on a different network/subnet/VLAN, where
there isn't some conflicting DHCP/bootp server/service.  The only other
slightly tricky bit with virtual and PXE - at least that I'm aware of
so far, is that non-intuitive bit on VirtualBox - where some interface
types don't support PXE boot (or need additional software or packages
for such interfaces - that seemed to be implied from some of what I
read about folks installing direct from Oracle rather than a linux
distribution's packaging thereof ... probably proprietary and/or non-
distribution restrictions on some extra bits for certain interface types
to be able to PXE boot under VirtualBox - found no such issue with
qemu-kvm).

This is example I have on my
Debian GNU/Linux 7.8 (wheezy) x86_64
"server" <cough, cough> (laptop) at home.
Looks like I mostly/initially based it upon:
https://wiki.debian.org/PXEBootInstall
(and probably from around 2012-03-11, as I made a few corrective edits
to that wiki page around then).

I was also interested in, as feasible, being
able to PXE boot and then be able to select and install various
distributions - so as I'd left it off, it could be used to PXE boot
and install any of:
Debian GNU/Linux 7.8 (wheezy) x86_64
Debian GNU/Linux 7.8 (wheezy) i386
Ubuntu-Server 14.04.1 LTS amd64

 From the wee bit of notes I made of it regarding my
installation/configuration:
$ cat /srv/tftp/NOTES
http://http.debian.net/debian/dists/wheezy/main/installer-i386/current/images/netboot/netboot.tar.gz
and:
http://http.debian.net/debian/dists/wheezy/main/installer-amd64/current/images/netboot/netboot.tar.gz
mostly extracted to:
/srv/tftp
except for the differing:
lrwxrwxrwx 1 root root 35 2014-04-24 07:45:30.000000000 +0000  
pxelinux.cfg -> debian-installer/amd64/pxelinux.cfg
lrwxrwxrwx 1 root root 34 2014-04-24 07:46:21.000000000 +0000  
pxelinux.cfg -> debian-installer/i386/pxelinux.cfg
and also:
lrwxrwxrwx 1 root root 33 2014-04-24 07:45:30.000000000 +0000  
pxelinux.0 -> debian-installer/amd64/pxelinux.0
lrwxrwxrwx 1 root root 32 2014-04-24 07:46:21.000000000 +0000  
pxelinux.0 -> debian-installer/i386/pxelinux.0
but in the case of pxelinux.0, the ordinary files are identical, so  
replaced the symbolic link with a hard link

also from:
Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
contents under:
install/netboot
mostly also placed here, except:
renamed version.info to version.info.ubuntu
renamed pxelinux.cfg to pxelinux.cfg:ubuntu-server:amd64
and left out symbolic links: pxelinux.0

And further examining what I'd left in place in terms of mounts and
configuration files and such (other than or in addition to that noted
above, and mostly covered on:
https://wiki.debian.org/PXEBootInstall
)

The relevant bits of data I have in /etc/fstab:
/dev/tigger/tftp /srv/tftp ext3 ro,nosuid,nodev,noatime 0 2
/var/tmp/ISOs/ubuntu-14.04.1-server-amd64.iso  
/var/tmp/ISOs/ubuntu-14.04.1-server-amd64 iso9660 loop,ro,nosuid,nodev  
0 0
/var/tmp/ISOs/ubuntu-14.04.1-server-amd64/install/netboot/ubuntu-installer  
/srv/tftp/ubuntu-installer none bind,ro,nosuid,nodev 0 0
/var/tmp/ISOs/ubuntu-14.04.1-server-amd64/install/netboot/version.info  
/srv/tftp/version.info.ubuntu none bind,ro,nosuid,nodev 0 0
Probably better to use location other than /var/tmp for things intended
to be there "permanently" or more longer term, but in any case ...
Also, those last two bind mounts shown above, next to last is directory
bind mounted atop directory, and the last one file mounted atop (empty)
file.
My "NOTES" from above covers much of it, but in addition (not covered by
that, and installed/configured under /srv/tftp/) we have:
$ < /srv/tftp/pxelinux.cfg/default expand
serial 0 9600
default debian-installer/i386/boot-screens/vesamenu.c32
timeout 0
label debian-i386
         menu label debian-i386
         config  pxelinux.cfg:i386/default
label debian-amd64
         menu label debian-amd64
         config  pxelinux.cfg:amd64/default
label ubuntu-server-amd64
         menu label ubuntu-server-amd64
         config pxelinux.cfg:ubuntu-server:amd64/default
That works as my default PXE boot menu that comes up, allowing
selections of:
debian-i386
debian-amd64
ubuntu-server-amd64
Each of which, when selected, then just chain loads the corresponding
stock menu from that flavor's PXE boot menu.
The
serial 0 9600
Allows that menu choice to also be made via the first (legacy) serial
port (if present), so serial console may be used to launch/control the
PXE boot and installation (can be quite handy for serial console
install, virtual machines, IPMI, etc., and doesn't particularly hurt to
include that, even if it's not being used).

That's mostly it ... except the IP addresses and network configuration I
have is different than the example given on the referenced wiki page.

And, comparing what I earlier noted to actual files under /srv/tftp ...
What doesn't seem to be quite covered in those earlier NOTES:
$ ls -ld /srv/tftp/pxelinux.cfg /srv/tftp/pxelinux.cfg:[ai]*
drwxr-xr-x 2 root root 1024 Apr 28  2014 /srv/tftp/pxelinux.cfg
lrwxrwxrwx 1 root root   35 Apr 27  2014 /srv/tftp/pxelinux.cfg:amd64  
-> debian-installer/amd64/pxelinux.cfg
lrwxrwxrwx 1 root root   34 Apr 27  2014 /srv/tftp/pxelinux.cfg:i386  
-> debian-installer/i386/pxelinux.cfg
$




More information about the Tech mailing list