How to setup a PXE server with Ubuntu without affecting your router

NOT COMPlETE YET! But it works 🙂

Since most home networks uses a router with a builtin dhcp server, I wanted a PXE server which doesnt affect the router. So, this guide shows how to setup a PXE service on an Ubuntu server machine. PXE is used to install linux diskless by using your home network.
To make this happen we are going to use DNSmasq and a nfs-server.

Things you need to setup a working PXE service:
1. Ubuntu server
2. DNSmasq
2.1 syslinux
3. nfs-server
4. Operating Systems


1. Ubuntu server

Download the server from ubuntu website and install it.


2. DNSMasq

DNSmasq is used for the pxe service and tftp-server.

Be sudo

sudo -s

Install Dnsmasq

apt-get install dnsmasq

Now you need to change the configuration.
But make a backup of the config file first.

mv /etc/dnsmasq/dnsmasq.conf /etc/dnsmasq/dnsmasq.conf.old

Then create a config file with this:

vi /etc/dnsmasq.conf

And paste the following in it, but change the following:

dhcp-range= to your ip

pxe-prompt="Press F8 for boot menu", 1
pxe-service=X86PC, "Boot from network", pxelinux
pxe-service=X86PC, "Boot from network iPXE", undionly
pxe-service=X86PC, "Boot from local hard disk", 0

Alright, restart dnsmasq

/etc/init.d/dnsmasq restart


2.1 Syslinux

To make dnsmasq work with PXE we need some pxe files from syslinux.

In progres….

Create a directory for the operatings system later on

mkdir /var/lib/tftpboot/dist/code>


3. NFS Server

Be sudo

sudo -s

Install the nfs-kernel-server

apt-get install nfs-kernel-server

Edit the configuration file to make the files available

vi /etc/exports

And create a line at the bottom that says:

/var/lib/tftpboot/dist *(ro,async,no_root_squash,no_subtree_check,insecure)

Dont forget the insecure at the end!! I couldnt get any access to the nfs otherwise…This actually took me a while…


4. Operating Systems


4.1 Extract the iso’s


4.2 Configuration Files

I got the configuration files from Yumi, a multiboot usb creator and changed it a bit so the files will boot over pxe and nfs. This was actually the hardest part since most guides on the internet use different configurations.

For Ubuntu

label test
menu label test
kernel dist/ubuntu13/casper/vmlinuz.efi
append boot=casper netboot=nfs nfsroot= initrd=dist/ubuntu13/casper/initrd.lz

For fedora

label live
menu label Run Fedora 19 KDE 64
kernel dist/fedora19/pxeboot/vmlinuz
APPEND netboot=nfs nfsroot= initrd=dist/fedora19/pxeboot/initrd.img rw rhgb rd.luks=0