daknetworks.com

You are here: Blog PXE Boot ISOs

PXE Boot ISOs

/WORK IN PROGRESS - DO NOT ATTEMPT/

My work with PXE boot was back in 2007 with BARTPE. A new project has come up and I need it again.

{{Languages}}

==PXE booting to ISO==

===Goal===
We want to boot ISO images via PXE (rather than through CD). This means that, as long as we have enough RAM in the local pc's, we can boot WINPE or any LIVE CD (such as KNOPPIX, PCLINUXOS, UBCD, etc).


===Assumptions===
You are a network/server administrator and know what TFTP, LIVEISO, PE and PXE -a network boot- means. You have a running SME SERVER and your SME SERVER is your DHCP server.


===Install TFTP package on your SME SERVER===
-install SMESERVER-TFTP-SERVER on your SME SERVER: http://wiki.contribs.org/Tftp_server
yum --enablerepo=smecontribs install smeserver-tftp-server

-install SMESERVER-THINCLIENT on your SME SERVER: https://wiki.contribs.org/Thinclient
yum --enablerepo=smecontribs install smeserver-thinclient

-install SMESERVER-THINCLIENT-TS on your SME SERVER: https://wiki.contribs.org/Thinclient_usage
wget http://distro.ibiblio.org/smeserver/contribs/trevorb/7.x/Thinclient/smeserver-thinclient-ts-2.2-1.noarch.rpm
Access SERVER-MANAGER > Thin-Client panel.
Click to add another Thin Client Distribution
Upload smeserver-thinclient-ts-2.2-1.noarch.rpm

You now have a /tftpboot directory on the SME-SERVER.
Inside the /tftpboot directory is another directory /tftpboot/thinclient directory. 
Inside the /tftpboot/thinclient directory are the files necessary to make the PXE happen.

===Create TFTPBOOT structure on your SME SERVER===
-we need to move the files into the proper locations.

-change to the directory
cd /tftpboot

-create a GRAPHICS, ISO, COM32 directories
mkdir graphics iso com32

-move the pxelinux.0 file and the pxelinux.cfg directory to the /tftpboot
mv ./thinstation/pxelinux.0 ./
mv ./thinstation/pxelinux.cfg ./

-finally, move the thinstation directory to the iso directory and create any other directories in iso that you want for iso distributions. For example, BARTPE and MEMDISK
mv ./thinstation ./iso
mkdir ./iso/bartpe ./iso/memdisk

You now have the following structure in the /tftpboot directory:
graphics (The graphics directory is for graphics, naturally.)
iso (The iso directory is for the iso files.)
pxelinux.cfg (The pxelinux.cfg directory is the boot menu.)
pxelinux.0 (This file is what boots the remote system.)
com32 (The com32 directory is for the menu). 

 

===Download Syslinux Executable===
To boot ISO images we need an executable that can handle ISO's. Lucky for us, a bunch of executables for each distribution is already available in a project called SYSLINUX. SYSLINUX actually encompasses PXELINUX, ISOLINUX and EXTLINUX.

wget: https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/6.xx/syslinux-6.03.zip
unzip syslinux-6.03.zip

Inside the "bios" directory you will find different executables for different distributions. For example, MEMDISK is a special executable (legacy) that can boot floppy images, hard disk images and some ISO.

Let's copy the file bios\memdisk\memdisk to /tftpboot/iso/memdisk anyway that you can, such as through SCP.

In addition, let's copy the following files to the root of /tftpboot:
syslinux-6.03\bios\com32\elflink\ldlinux\ldlinux.c32
syslinux-6.03\bios\com32\menu\vesamenu.c32
syslinux-6.03\bios\gpxe\gpxelinux.0 (You already have the pxelinux.0 but pgxelinux.0 provides an additional way to boot which adds a few options such as booting over ftp, http, etc)

 

===Create an Windows-based ISO on your local pc===

Copy or download the ISO files to the iso directory.

 

++++++++++++++++++++++++++++++++++++++++++++++++++
++(no longer supported, here for archival purposes only)
++++++++++++++++++++++++++++++++++++++++++++++++++
===Create an Windows-based ISO on your local pc===

====BARTPE====
-download BARTPE on your local pc: http://www.nu2.nu/pebuilder/

-create a BARTPE disk using WINDOWS SERVER 2003 source (i386 directory)

-or if you don't have a WINDOWS SERVER 2003 source, you can use a WINDOWS XP SP2 source (i386 dir) but you'll have to replace the following file with a newer version from the WINDOWS SERVER 2003 SP1 download (see next section):
C:\pebuilder3110a\BartPE\I386\SYSTEM32\DRIVERS\ramdisk.sys

-you now have a BARTPE.ISO (on your local pc)


====Obtain WINDOWS SERVER 2003 SP1 files needed====
-download the WINDOW 2003 SERVER SP1:
https://www.google.com/search?q=WindowsServer2003-KB889101-SP1-x86-ENU.exe

(You now have a file called: WindowsServer2003-KB889101-SP1-x86-ENU.exe)

-open WINRAR to open the WindowsServer2003-KB889101-SP1-x86-ENU.exe file (the W2K3 file is just a self-extracting ZIP/CAB/TAR file)

-extract only the following files from the W2K3SP1:
ntdetect.com
ramdisk.sy_
setupldr.ex_
startrom.n1_

-The underscore files are compressed. We need to decompress/expand them:
expand ramdisk.sy_
expand setupldr.ex_
expand startrom.n1_

(You only need the ramdisk.sys file if you don't have a WINDOWS 2003 SERVER source to build your BARTPE from. See above section.)


===Transfer files to SME SERVER===
-copy the following files to the SME SERVER in the "/tftpdboot/iso/bartpe" directory:
ntdetect.com
setupldr.exe
startrom.n12
bartpe.iso


===Work with files in the TFTPDBOOT dir===
-the files are case-sensitive and need to be named exactly as follows:
ntdetect.com (lower-case)
NTLDR (rename the setupldr.exe to NTLDR, all caps)
startrom.0 (rename the startrom.n12 to startrom.0) (This is a ZERO)
BARTPE.ISO (all caps)

-create a winnt.sif:
vi winnt.sif

-the contents of the winnt.sif file:
[SetupData]
BootDevice = "ramdisk(0)"
BootPath = "\i386\System32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdexportascd /rdpath=iso/bartpe/bartpe.iso"
++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++

 

 ====Create DEFAULT file====
-change to pxelinux.cfg directory and create the contents of the default file:
cd pxelinux.cfg
vi default

Each distribution iso will have a LABEL and a full-path-to-the-kernel. Currently, we have only 3; BARTPE, THINSTATION and KNOPPIX.

-the contents of the default file (note that this is case-sensitive reference the iso filename):
prompt 1
implicit 0
timeout 600
default foo

LABEL bartpe
kernel iso/bartpe/startrom.0

LABEL thinstation
kernel iso/thinstation/vmlinuz
append initrd=iso/thinstation/initrd ramdisk_blocksize=4096 root=/dev/ram0 ramdisk_size=524288 console=ttyS3 vga=791

LABEL knoppix
kernel iso/memdisk/memdisk
append initrd=iso/knoppix/knoppix.iso iso

===Summary of contents of TFTPBOOT dir===
-graphics
-iso
--iso/bartpe
---iso/bartpe/BARTPE.ISO
---iso/bartpe/ntdetect.com
---iso/bartpe/NTLDR
---iso/bartpe/startrom.0
---iso/bartpe/winnt.sif
--iso/thinstation
---iso/thinstation/vmlnuz
---iso/thinstation/initrd
---iso/thinstation/thinstation.conf.network
--iso/memdisk
---iso/memdisk/memdisk
--iso/knoppix
---iso/knoppix/knoppix.iso
-pxelinux.cfg
--pxelinux.cfg/default
-pxelinux.0
-gpxelinux.0
-ldlinux.c32
-vesamenu.c32


===Boot client PC===
-that should do it! Start your client PC and boot from the network.

-it will boot the pxelinux.0 and try to use any config files.

-at the prompt, when it asks for an image type: {bartpe | thinstation | knoppix}

-pretty cool, huh?

===Advanced Menu===
It is possible to create submenus. Just create a plain text file in tftpboot/pxelinux.cfg/ directory and use the same format as the default. The file can be named tools, memorytest, recovery, etc anything you want.

===Advanced Modern OS===
The problem becomes that modern OS's renders the memdisk approach useless because if you loaded the ISO with MEMDISK, once the kernel was read from the ISO and loaded into memory, the ISO data would be gone.

Contact Dak Networks

We are not taking on new clients at this time.