English / Deutsch | Print version

Prev
Backup / restore with fsarchiver
Go to the
  Table of Contents  
Next
PXE Boot from network (DHCP, TFTP, Network share, FTP, HTTP) - Windows server

Plop Linux - PXE Boot from network (DHCP, TFTP, NFS, Samba, FTP, HTTP) - Linux server


The network boot will be explained with working example setups. When you understood the concept, then you can use your own server setups and directory structures. Everything is flexible and can be configured to be anywhere on your server.



The minimum requirements to boot from a network are a DHCP server and a TFTP server.

The access to the Plop Linux files can be via NFS share, Samba share, TFTP, FTP or HTTP.


Basic conditions for this example setup:

  • Network type: 10.0.0.x Netmask 255.255.255.0
  • Server IP: 10.0.0.1
  • Client IP: will be 10.0.0.250 from DHCP with MAC address
  • TFTP root directory: /tftpboot

It works with other IP addresses too!

Here are config files for a Linux test system in an archive: pxeconfs.tgz


1. Setup
1.1. Extract the Plop Linux files
1.2. Setup the DHCP server
1.3. Setup the TFTP server
 
2. NFS
2.1. Boot with NFS
2.2. Boot ISO over NFS
 
3. Samba network share
3.1. Boot with Samba network share
3.2. Boot ISO over Samba network share
 
4. TFTP
4.1. Boot only with TFTP
4.2. Boot ISO over TFTP
 
5. FTP
5.1. Boot with FTP
5.2. Boot ISO over FTP
 
6. HTTP
6.1. Boot with HTTP
6.2. Boot ISO over HTTP
 
7. Boot problems

1. Setup


1.1. Extract the Plop Linux files


Extract the file ploplinux-pxeboot.tgz to your root directory

tar xfz ploplinux-pxeboot.tgz -C /

Now you have the basic directory structure and files in /tftpboot

Extract the file ploplinux-4.2.2.tgz to /tmp

tar xfz ploplinux-4.2.2.tgz -C /tmp

Move the files to /tftpboot/ploplinux-netboot/

mv /tmp/ploplinux-4.2.2/* /tftpboot/ploplinux-netboot/

Now you should have the following directories and files

/tftpboot/
         /ploplinux-netboot/
                	   /boot.msg
                	   /memtest
                	   /menu.c32
                	   /spash.png
                	   /vesamenu.c32
                	   /pxelinux.0
                	   /ploplinux/
                        	     /bin/
                    		     /bin.sqfs
                        	     /etc.tgz
                        	     /lib.sqfs
				     /opt/
                        	     /ploplinux
                	    /pxelinux.cfg/
                            		 /default
			    /syslinux/
		        	     /kernel/
		                	    /bzImage
			        	    /initramfs.gz
		        	     /plop/
		                	  /plpbt.bin
			        	  /plpinstc.com

When you copy the opt.sqfs to the ploplinux/opt/ directory, then you are able to run Gnome over the network and use Firefox and other tools.


1.2. Setup the DHCP server


You need the DHCP server software. If your distribution has none then you can use dhcp-3.1.3 (or search for the latest on the net) and compile it.

This is the example DHCP server configuration.
The very important line is filename "/ploplinux/pxelinux.0";

File name: /etc/dhcpd.conf
ddns-update-style ad-hoc;

subnet 10.0.0.0 netmask 255.255.255.0 {

        option routers 10.0.0.1;

}

allow booting;
allow bootp;

# Standard configuration directives...

option domain-name "plop";
option subnet-mask 255.255.255.0;
option broadcast-address 10.0.0.255;
option domain-name-servers 10.0.0.1;
option routers 10.0.0.1;

# Group the PXE bootable hosts together
group {
	# PXE-specific configuration directives...
	next-server 10.0.0.1;
	filename "/ploplinux-netboot/pxelinux.0";

	# You need an entry like this for every host
	# unless you're using dynamic addresses
        host testpc {
	        hardware ethernet 00:0C:6E:A6:1A:E6;
		fixed-address 10.0.0.250;
	}
}

To start the DHCP server simply run dhcpd


1.3. Setup the TFTP server


Download the latest TFTP server from ftp://www.kernel.org/pub/software/network/tftp/ and install it with ./configure --prefix=/usr && make && make install

To start the TFTP server we use xinetd

Here is the base xinetd config file

File name: /etc/xinetd.conf
#
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{
	log_type	= SYSLOG daemon info
	log_on_success	= PID HOST DURATION
	log_on_failure	= HOST
	instances	= 100
	per_source	= 20
}

includedir /etc/xinetd.d

And the configuration for the tftp server.
The important line is server_args = -s /tftpboot for the tftp root directory.

File name: /etc/xinetd.d/tftp

# default: off
# description: The tftp server serves files using the trivial 

# file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to 

# network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{

socket_type = dgram
protocol = udp
wait = yes
user = root
#only_from = 10.0.0.1
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no 
per_source = 11
cps = 100 2

}

To start xinetd simply run xinetd


2. NFS


2.1. Boot with NFS


Requirements are the DHCP and TFTP Server (Setup).

Basic configs for your NFS server, without security aspects:

File name: /etc/exports

/tftpboot/ploplinux-netboot 10.0.0.250(ro)

File name: /etc/hosts.allow

portmap: 10.0.0.0/255.255.255.0
lockd: 10.0.0.0/255.255.255.0
rquotad: 10.0.0.0/255.255.255.0
mountd: 10.0.0.0/255.255.255.0
statd: 10.0.0.0/255.255.255.0

File name: /etc/hosts.deny

portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL


Parameter: nfsmount=NFSSHARE|ADDITIONALPARAMS

Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot
Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot|rsize=2048,wsize=2048,nolock,vers=2,hard,intr

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/nfs.conf

# Boot from NFS 

label linux-nfs
    menu label Plop Linux - NFS
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 nfsmount=10.0.0.1:/tftpboot/ploplinux


label linuxfb-nfs
    menu label Plop Linux framebuffer mode - NFS
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 nfsmount=10.0.0.1:/tftpboot/ploplinux

nfs.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default

If the DHCP, Xinetd and NFS server are running correct you should be able to boot Plop Linux via network. When you copy the opt.sqfs to the ploplinux/opt/ directory, then you are able to run Gnome over the network and use Firefox and other tools.


2.2. Boot ISO over NFS


You need the ISO ploplinux-4.2.2.iso, the directory structure and files of ploplinux-pxeboot.tgz and the syslinux directory of ploplinux-4.2.2.tgz. The DHCP and TFTP Server must work.

Basic configs for your NFS server, without security aspects:

File name: /etc/exports

/tftpboot/ploplinux-netboot 10.0.0.250(ro)

File name: /etc/hosts.allow

portmap: 10.0.0.0/255.255.255.0
lockd: 10.0.0.0/255.255.255.0
rquotad: 10.0.0.0/255.255.255.0
mountd: 10.0.0.0/255.255.255.0
statd: 10.0.0.0/255.255.255.0

File name: /etc/hosts.deny

portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL


Copy ploplinux-4.2.2.iso to /tftpboot/ploplinux-netboot/

Create a symlink ln -s ploplinux-4.2.2.iso ploplinux.iso


Parameter: nfsmount=NFSSHARE|ADDITIONALPARAMS iso_filename=ISOFILE

On the server: /nfsboot/ploplinux-netboot/ploplinux.iso
Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot iso_filename=ploplinux.iso
Example: nfsmount=10.0.0.1:/tftpboot/ploplinux-netboot|rsize=2048,wsize=2048,nolock,vers=2,hard,intr iso_filename=ploplinux.iso

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/nfs-iso.conf

# Boot from NFS - ISO

label linux-nfs-iso
    menu label Plop Linux - NFS ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 nfsmount=10.0.0.1:/tftpboot/ploplinux iso_filename=ploplinux.iso


label linuxfb-nfs-iso
    menu label Plop Linux framebuffer mode - NFS ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 nfsmount=10.0.0.1:/tftpboot/ploplinux iso_filename=ploplinux.iso

nfs-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/nfs-iso.conf to enable the loading of nfs-iso.conf.


3. Samba network share


3.1. Boot with Samba network share


Requirements are the DHCP and TFTP Server (Setup).

Basic configs for your Samba server, without security aspects:

Create the share ploplinux-netboot
File name: /etc/samba/smb.conf

;=== CUT =====

[ploplinux-netboot]
  path = /tftpboot/ploplinux-netboot
  writable = no
  read only = no


;=== CUT =====


Parameter: smbmount=//SERVER/SHARE:SMBUSER:SMBPASSWORD

SMBUSER: user to access the share. If the share permits access to all users then use "" for SMBUSER
SMBPASSWORD: password of the user to access the share. For an empty password use ""

Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser:mypass
Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser2:""

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/smb.conf
# Boot from Samba/Windows share

label linux-smb
menu label Plop Linux - Samba
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 smbmount=//10.0.0.1/ploplinux-netboot:SMBUSER:SMBPASSWORD


label linuxfb-smb
menu label Plop Linux framebuffer mode - Samba
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 smbmount=//10.0.0.1/ploplinux-netboot:SMBUSER:SMBPASSWORD

smb.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/smb.conf to enable the loading of smb.conf.

When the DHCP, Xinetd and Samba server are running correct you should be able to boot Plop Linux via network. When you copy the opt.sqfs to the ploplinux/opt/ directory, then you are able to run Gnome over the network and use Firefox and other tools.


3.2. Boot ISO over Samba


You need the ISO ploplinux-4.2.2.iso, the directory structure and files of ploplinux-pxeboot.tgz and the syslinux directory of ploplinux-4.2.2.tgz. The DHCP and TFTP Server must work.

Basic configs for your Samba server, without security aspects:

Create the share ploplinux-netboot
File name: /etc/samba/smb.conf

;=== CUT =====

[ploplinux-netboot]
  path = /tftpboot/ploplinux-netboot
  writable = no
  read only = no


;=== CUT =====


Copy ploplinux-4.2.2.iso to /tftpboot/ploplinux-netboot/

Create there a symlink ln -s ploplinux-4.2.2.iso ploplinux.iso


Parameter: smbmount=//SERVER/SHARE:SMBUSER:SMBPASSWORD iso_filename=ISOFILE

SMBUSER: user to access the share. If the share permits access to all users then use "" for SMBUSER
SMBPASSWORD: password of the user to access the share. For an empty password use ""
ISOFILE: ploplinux.iso (relative to the share)
On the server: /nfsboot/ploplinux-netboot/ploplinux.iso

Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser:mypass iso_filename=ploplinux.iso
Example: smbmount=//10.0.0.1/ploplinux-netboot:myuser2:"" iso_filename=ploplinux.iso

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/smb-iso.conf

# Boot from Samba/Windows share - ISO

label linux-smb-iso
menu label Plop Linux - Samba ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 smbmount=//10.0.0.1/ploplinux-netboot:SMBUSER:SMBPASSWORD iso_filename=ploplinux.iso


label linuxfb-smb-iso
menu label Plop Linux framebuffer mode - Samba ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 smbmount=//10.0.0.1/ploplinux-netboot:SMBUSER:SMBPASSWORD iso_filename=ploplinux.iso

smb-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/smb-iso.conf to enable the loading of smb-iso.conf.


4. TFTP


4.1. Boot only with TFTP


Requirements are the DHCP and TFTP Server (Setup).

Create the file /tftpboot/ploplinux-netboot/tftpfilelist for TFTP boot that lists all Plop Linux files.

cd /tftpboot
find ploplinux-netboot > ploplinux-netboot/tftpfilelist

Example file: /tftpboot/ploplinux-netboot/tftpfilelist


Parameter: tftpboot=SERVER|FILELIST dir=PLOPLINUXDIRECTORY

Example: tftpboot=10.0.0.1|ploplinux-netboot/tftpfilelist dir=/ploplinux-netboot/ploplinux

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/tftp.conf

# boot from TFTP

label linux-tftp
menu label Plop Linux - TFTP
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 tftpboot=10.0.0.1|ploplinux-netboot/tftpfilelist dir=/ploplinux-netboot/ploplinux


label linuxfb-tftp
menu label Plop Linux framebuffer mode - TFTP
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 tftpboot=10.0.0.1|ploplinux-netboot/tftpfilelist dir=/ploplinux-netboot/ploplinux

tftp.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/tftp.conf to enable the loading of tftp.conf.


4.2. Boot ISO over TFTP


You need the ISO ploplinux-4.2.2.iso, the directory structure and files of ploplinux-pxeboot.tgz and the syslinux directory of ploplinux-4.2.2.tgz. The DHCP and TFTP Server must work.

Create the file /tftpboot/ploplinux-netboot/filelist-iso for TFTP boot with the Plop Linux ISO file name.

cd /tftpboot/ploplinux-netboot
echo ploplinux-netboot/ploplinux.iso > filelist-iso

Copy ploplinux-4.2.2.iso to /tftpboot/ploplinux-netboot/

Create a symlink ln -s ploplinux-4.2.2.iso ploplinux.iso


Parameter: tftpboot=SERVER|FILELIST iso_filename=ISOFILE

Example: tftpboot=10.0.0.1|ploplinux-netboot/filelist-iso iso_filename=ploplinux.iso

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/tftp-iso.conf

# boot from TFTP - ISO

label linux-tftp-iso
menu label Plop Linux - TFTP ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 tftpboot=10.0.0.1|ploplinux-netboot/filelist-iso iso_filename=ploplinux-netboot/ploplinux.iso


label linuxfb-tftp-iso
menu label Plop Linux framebuffer mode - TFTP ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 tftpboot=10.0.0.1|ploplinux-netboot/filelist-iso iso_filename=ploplinux-netboot/ploplinux.iso

tftp-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/tftp-iso.conf to enable the loading of tftp-iso.conf.


5. FTP


5.1. Boot with FTP


Requirements are the DHCP and TFTP Server (Setup) and a FTP Server.

The FTP root directory is in this example /tftpboot/

Create the file /tftpboot/ploplinux-netboot/filelist for FTP boot that lists all Plop Linux files.

cd /tftpboot/ploplinux-netboot
find > ftpfilelist

Example file: /tftpboot/ploplinux-netboot/ftpfilelist


Parameter: url=ftp://FTPUSER:FTPPASSWORD@FTPSERVER/FTPDIRECTORY|FILELIST

Example: url=ftp://myuser:mypass@10.0.0.1/ploplinux-netboot|/ftpfilelist

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/ftp.conf

# boot from FTP

label linux-ftp
menu label Plop Linux - FTP
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 url=ftp://myuser:mypass@10.0.0.1/ploplinux-netboot|/ftpfilelist


label linuxfb-ftp
menu label Plop Linux framebuffer mode - FTP
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 url=ftp://myuser:mypass@10.0.0.1/ploplinux-netboot|/ftpfilelist

ftp.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/ftp.conf to enable the loading of ftp.conf.


5.2. Boot ISO over FTP


You need the ISO ploplinux-4.2.2.iso, the directory structure and files of ploplinux-pxeboot.tgz and the syslinux directory of ploplinux-4.2.2.tgz. The DHCP and TFTP Server must work. A FTP Server must be available.

The FTP root directory is in this example /tftpboot/

Create the file /tftpboot/ploplinux-netboot/filelist-iso for FTP boot with the Plop Linux ISO file name.

cd /tftpboot/ploplinux-netboot
echo ploplinux.iso > filelist-iso

Copy ploplinux-4.2.2.iso to /tftpboot/ploplinux-netboot/

Create a symlink ln -s ploplinux-4.2.2.iso ploplinux.iso


Parameter: url=ftp://FTPUSER:FTPPASSWORD@FTPSERVER/FTPDIRECTORY|FILELIST iso_filename=ISOFILE

Example: url=ftp://myuser:mypass@10.0.0.1/ploplinux-netboot|/filelist-iso iso_filename=ploplinux.iso

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/ftp-iso.conf

# boot from FTP - ISO

label linux-ftp-iso
menu label Plop Linux - FTP ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 url=ftp://myuser:mypass@10.0.0.1/ploplinux-netboot|/filelist-iso iso_filename=ploplinux.iso


label linuxfb-ftp-iso
menu label Plop Linux framebuffer mode - FTP ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 url=ftp://myuser:mypass@10.0.0.1/ploplinux-netboot|/filelist-iso iso_filename=ploplinux.iso

ftp-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/ftp-iso.conf to enable the loading of ftp-iso.conf.


6. HTTP


6.1. Boot with HTTP


Requirements are the DHCP and TFTP Server (Setup) and a WEB Server.

The Virtual Host root directory is in this example /tftpboot/

Create the file /tftpboot/ploplinux-netboot/filelist for HTTP boot that lists all Plop Linux files.

cd /tftpboot/ploplinux-netboot
find > webfilelist

Example file: /tftpboot/ploplinux-netboot/webfilelist


Parameter: url=http://USER:PASS@WEBSERVER/WEBDIRECTORY|FILELIST

Example: url=http://www.ploplinux.com/ploplinux-netboot|/webfilelist
Example: url=http://myuser:mypass@www.ploplinux.com/ploplinux-netboot|/webfilelist

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/http.conf

# boot from HTTP

label linux-http
menu label Plop Linux - HTTP
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 url=http://www.ploplinux.com/ploplinux-netboot|/webfilelist


label linuxfb-http
menu label Plop Linux framebuffer mode - HTTP
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 url=http://www.ploplinux.com/ploplinux-netboot|/webfilelist

http.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/http.conf to enable the loading of http.conf.


6.2. Boot ISO over HTTP


You need the ISO ploplinux-4.2.2.iso, the directory structure and files of ploplinux-pxeboot.tgz and the syslinux directory of ploplinux-4.2.2.tgz. The DHCP and TFTP Server must work. A WEB Server must be available.

The Virtual Host root directory is in this example /tftpboot/

Create the file /tftpboot/ploplinux-netboot/filelist-iso for HTTP boot with the Plop Linux ISO file name.

cd /tftpboot/ploplinux-netboot
echo ploplinux.iso > filelist-iso

Copy ploplinux-4.2.2.iso to /tftpboot/ploplinux-netboot/

Create a symlink ln -s ploplinux-4.2.2.iso ploplinux.iso


Parameter: url=http://USER:PASS@WEBSERVER/WEBDIRECTORY|FILELIST iso_filename=ISOFILE

Example: url=http://www.ploplinux.com/ploplinux-netboot|/filelist-iso iso_filename=ploplinux.iso
Example: url=http://myuser:mypass@www.ploplinux.com/ploplinux-netboot|/filelist-iso iso_filename=ploplinux.iso

File name: /tftpboot/ploplinux-netboot/pxelinux.cfg/http-iso.conf

# boot from HTTP - ISO

label linux-http-iso
menu label Plop Linux - HTTP ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=1 url=http://www.ploplinux.com/ploplinux-netboot|/filelist-iso iso_filename=ploplinux.iso


label linuxfb-http-iso
menu label Plop Linux framebuffer mode - HTTP ISO
    kernel syslinux/kernel/bzImage
    append initrd=syslinux/kernel/initramfs.gz vga=0x317 url=http://www.ploplinux.com/ploplinux-netboot|/filelist-iso iso_filename=ploplinux.iso

http-iso.conf is loaded by /tftpboot/ploplinux-netboot/pxelinux.cfg/default
Remove the # in the line with #include pxelinux.cfg/http-iso.conf to enable the loading of http-iso.conf.


7. Boot problems


Maybe there is somewhere a wrong path. When you are in the boot menu, then press at the entry that you want to boot the tabulator key. Then add at the end of the line "debug". You will see more info's during booting.



Prev
Backup / restore with fsarchiver
Go to the
  Table of Contents  
Next
PXE Boot from network (DHCP, TFTP, Network share, FTP, HTTP) - Windows server

© 2014 by Elmar Hanlhofer