Using WinPE (Windows Deployment Service) to boot Linux via PXE

So, I wanted to do PXE for both Windows and Linux on the same network, but it’s not technically correct to have two PXE servers running on the same network.  Soooo… It was either figuring out how to get Windows onto a UNIX tftp server, or using WinPE (the windows deployment service).  I went with the later…

First I downloaded syslinux
(http://www.kernel.org/pub/linux/utils/boot/syslinux/) and stripped
out a couple of files I needed.  core\pxelinux.0
com32\menu\vesamenu.c32 and com32\modules\chain.c32 were taken and
placed into F:\RemoteInstall\Boot\x86 and F:\RemoteInst4all\Boot\x64
In both \Boot\x86 & \Boot\x64, rename pxelinux.0 to pxelinux.com.
This makes pxelinux.0 become the default remote binary when WinPE
sends files across.  Basically it ends up becoming a syslinux/pxelinux
setup.
Create a directory named “pxelinux.cfg” in the \boot\x86 & \boot\x64
directories.
Create a file named “default” in that directory… my default file was
setup to boot Windows 2008R2 & Linux of various configurations.  Under
this article is the default file contents.
In the \boot\x86 & \boot\x64 directories, make a copy of pxeboot.n12,
and abortpxe.com and name it pxeboot.0 and abortpxe.0, respectively.

Since I’m using Windows 2008R2 WDS & not RIS, I had to go through the
commandline to change the configurations:
wdsutil /set-server /bootprogram:boot\x86\pxelinux.com /architecture:x86
wdsutil /set-server /N12bootprogram:boot\x86\pxelinux.com /architecture:x86
wdsutil /set-server /bootprogram:boot\x64\pxelinux.com /architecture:x64
wdsutil /set-server /N12bootprogram:boot\x64\pxelinux.com /architecture:x64

After everything, I took the Red Hat installation CD and extracted the
pxeboot images necessary.  For Red Hat 5.5, it was on the CD in
images/pxeboot.  First, make a directory in WDS-ROOT\Boot\x86\Linux &
WDS-Root\Boot\x64\Linux.  In whatever method you desire, move the
files vmlinuz & initrd.gz to your WDS-ROOT\Boot\x86\Linux, or replace
x86 with x64 if your using a 64-bit version.  Of course, you’ll have a
kickstart file location on the net to place in the APPEND portions
below 😉  Or you could place them in IIS on the Windows machine and
pass the URL through the APPEND.  Note:  I have a repo that handles
Kickstarts and RPMs.

WDS-ROOT\Boot\x64\pxelinux.cfg\default:

DEFAULT vesamenu.c32
PROMPT 0
NOESCAPE 1
ALLOWOPTIONS 0

MENU TITLE Deployment Services

# Menus
# Windows Deployment Services
LABEL wds
MENU LABEL Windows Deployment Services
MENU DEFAULT
KERNEL pxeboot.0

MENU BEGIN
MENU LABEL Linux
MENU TITLE Linux
MENU BEGIN
MENU LABEL Linux 32bit
MENU TITLE Linux 32bit
LABEL RHEL55-32-Base
MENU LABEL RHEL 5.5 Base
KERNEL Linux/vmlinuz-rhel55-x86
APPEND initrd=Linux/initrd-rhel55-x86.img
ks=http://MYREPOIP/RHEL55/RHEL55_x86_WDS.ks

LABEL RHEL-55-x86-HP580G5
MENU LABEL RHEL 5.5 HP580G5
KERNEL Linux/vmlinuz-rhel55-x86
APPEND initrd=Linux/initrd-rhel55-x86.img
ks=http://MYREPOIP/WDS/RHEL55_x86_HP580G5_WDS.ks

MENU END

MENU BEGIN
MENU LABEL Linux 64bit Configuration
MENU TITLE Linux 64bit Configuration
label RHEL55-64-Base
menu label RHEL 5.5 Base
KERNEL Linux/vmlinuz-rhel55-x64
APPEND initrd=Linux/initrd-rhel55-x64.img
ks=http://MYIP/WDS/RHEL55_x64_BASE_WDS.ks

label RHEL-55-x64-HP580G5
MENU LABEL RHEL 5.5 HP580G5
KERNEL Linux/vmlinuz-rhel55-x64
APPEND initrd=Linux/initrd-rhel55-x64.img
ks=http://MYREPOIP/RHEL55_64/WDS/RHEL55_x64_HP580G5_WDS.ks
#—
label RHEL-55-x64-PHYS
MENU LABEL RHEL 5.5 Physical Configuration
KERNEL Linux/vmlinuz-rhel55-x64
APPEND initrd=Linux/initrd-rhel55-x64.img
ks=http://MYREPOSERVER/kickstart/RHEL55_64/ks-files/WDS/RHEL5x_x64_PHYS__WDS_ABB.ks

MENU END
MENU END

A wonderful example of the “default” file, made by someone else on the
net, and I used this as reference:
DEFAULT vesamenu.c32

#MENU BACKGROUND pxelinux.cfg/mtsplash.jpg

PROMPT 0

NOESCAPE 0

ALLOWOPTIONS 0

TIMEOUT 200

MENU TITLE Boot Menu

LABEL Ghost_Client_UNDI

MENU LABEL ^1. Ghost Client UNDI

MENU DEFAULT

kernel memdisk

append keeppxe initrd=imz/Client_undi.imz

LABEL Ghost_Client_NDIS

MENU LABEL ^2. Ghost Client NDIS

kernel memdisk

APPEND keeppxe initrd=imz/Client_ndis.IMZ

MENU BEGIN

MENU LABEL ^3. Ghost Menu

MENU TITLE Ghost Menu

LABEL Ghost_UNDI

MENU LABEL ^1. Ghost 11.5 UNDI

kernel memdisk

append keeppxe initrd=imz/ghost_undi.imz

LABEL Ghost_NDIS

MENU LABEL ^2. Ghost 11.5 NDIS

kernel memdisk

append keeppxe initrd=imz/ghost_ndis.imz

LABEL Ghost_Ses_1

MENU LABEL ^3. Ghost Session 1 + Rename

kernel memdisk

append keeppxe initrd=imz/ghost_ses1.imz

LABEL Ghost_no_Rename

MENU LABEL ^4. Ghost Session 1 w/o Rename

kernel memdisk

append keeppxe initrd=imz/ghost_ses1_!ren.imz

LABEL Ghost_Create

MENU LABEL ^5. Ghost Create 1

kernel memdisk

append keeppxe initrd=imz/ghost_ses1_cap.imz

LABEL Ghost_JA

MENU LABEL ^6. Ghost -ja=1

kernel memdisk

append keeppxe initrd=imz/ghost_undi_ja.imz

MENU SEPARATOR

LABEL return

MENU INDENT 5

MENU LABEL ^Esc – Return to Main Menu

MENU EXIT

MENU END

LABEL DiskWipe
#gdisk 1 /del /all /y
#gdisk 1 /mbr /wipe /y
#gdisk 1 /cre /pri /for /q /y /r
#a bit redundant but effective.

MENU LABEL ^4. DiskWipe

menu passwd fakepasswd

kernel memdisk

append keeppxe initrd=imz/diskwipe.imz

MENU BEGIN

MENU LABEL ^5. Utils

MENU TITLE Utility Menu

MENU PASSWD fakepasswd

LABEL memtest

MENU LABEL ^1. Memory Test 86+

linux utils/memtest86+

LABEL Memory_Test_MicroSoft

MENU LABEL ^2. MicroSoft Windows Memory Diagnostic

kernel memdisk

append initrd=imz/ramtest.imz

LABEL Parted_Magic

MENU LABEL ^3. Parted Magic

kernel utils/pmagic/bzImage

append initrd=/utils/pmagic/initramfs load_ramdisk=1
prompt_ramdisk=0 rw sleep=10

LABEL Gdisk

MENU LABEL ^4. Gdisk

kernel memdisk

append keeppxe initrd=imz/gdisk.imz

MENU BEGIN

MENU LABEL ^5. Dell Diagnostics

MENU TITLE Dell Diagnostics Utilties

LABEL Dell_diag

MENU LABEL ^1. Dell Diagnostics (740 – 755)

kernel memdisk raw

append initrd=imz/diags.img

LABEL Dell_diag2

MENU LABEL ^2. Dell Diagnostics (240 – 620)

kernel memdisk

append keeppxe initrd=imz/DD.imz

LABEL Dell_diag3

MENU LABEL ^3. Dell Diagnostics (150 – 260)

kernel memdisk

append keeppxe initrd=imz/DD_old.imz

MENU SEPARATOR

LABEL return

MENU INDENT 5

MENU LABEL ^Esc – Return to Main Menu

MENU EXIT

MENU END

LABEL HDT

MENU LABEL ^6. HDT (Hardware Detction Tool)

KERNEL utils/hdt.c32

APPEND modules=utils/modules.pcimap pciids=utils/pci.ids

LABEL offline

MENU LABEL ^7. Offline NT Password & Registry Editor

kernel utils/cd080802/vmlinuz

append rw vga=1 initrd=utils/cd080802/initrd.cgz,utils/cd080802/scsi.cgz

MENU BEGIN

MENU LABEL ^8. Hard Drive Tools

MENU TITLE Hard Drive Tools

LABEL HDAT2

MENU LABEL ^1. HDAT2 (Hard Drive Utility)

kernel memdisk

append keeppxe initrd=imz/HDAT2.imz

LABEL salvation_hdd_scan_repair

MENU LABEL ^2. Salvation Scan and Repair

kernel memdisk

append initrd=utils/salvation_hdd_scan_repair.igz

LABEL dft

MENU LABEL ^3. IBM/Hitachi Drive Fitness Test

kernel memdisk

append initrd=utils/hd/ibm_hitachi/dft.igz

LABEL maxblast

MENU LABEL ^4. Maxtor Maxblast

kernel memdisk

append initrd=utils/hd/maxtor_quantum/maxblast.igz

LABEL powermax

MENU LABEL ^5. Maxtor PowerMax

kernel memdisk

append initrd=utils/hd/maxtor_quantum/powermax.igz

label SeaTools

MENU LABEL ^6. Seagate SeaTools

kernel memdisk

append keeppxe initrd=imz/seatools.imz

LABEL datalife

MENU LABEL ^7. Western Digital – Data Lifeguard

kernel memdisk

append initrd=utils/hd/western_digital/datalife.igz

LABEL dlgudma

MENU LABEL ^8. Western Digital – Data Lifeguard UDMA

kernel memdisk

append initrd=utils/hd/western_digital/dlgudma.igz

LABEL return

MENU INDENT 5

MENU LABEL ^Esc – Return to Previous Menu

MENU EXIT

MENU END

LABEL 3Com_NIC_Util

MENU LABEL ^9. 3Com NIC Util

kernel memdisk

append keeppxe initrd=imz/3com.imz

MENU SEPARATOR

LABEL return

MENU INDENT 5

MENU LABEL ^Esc – Return to Main Menu

MENU EXIT

MENU END

MENU BEGIN

MENU LABEL ^6. Pre OSes

MENU TITLE Alternate Pre OSes

MENU PASSWD fakepasswd

LABEL WinPE

MENU LABEL ^1. WinPE 2.0

KERNEL boot/pxeboot.0

LABEL Parted Magic

MENU LABEL ^2. Parted Magic

kernel utils/pmagic/bzImage

append initrd=/utils/pmagic/initramfs load_ramdisk=1
prompt_ramdisk=0 rw sleep=10

LABEL TS_linux

MENU LABEL ^3. Thin Station Linux

kernel utils/vmlinuz

append ramdisk_blocksize=4096 initrd=utils/initrd root=/dev/ram0
ramdisk_size=524288 console=ttyS3 ipappend 1

MENU SEPARATOR

LABEL return

MENU INDENT 5

MENU LABEL ^Esc – Return to Main Menu

MENU EXIT

MENU END

LABEL centos
MENU LABEL ^7. Kickstart CentOS 5.3
KERNEL centos/vmlinuz
APPEND initrd=centos/initrd.img noipv6
ks=http://local-webserver-IP/ks.cfg ksdevice=bootif IPAPPEND 2

LABEL Local_Drive

MENU LABEL ^8. Boot Local Drive

#  localboot 0

KERNEL chain.c32

APPEND hd0 0

Advertisements

2 thoughts on “Using WinPE (Windows Deployment Service) to boot Linux via PXE

  1. We have configured kickstart in WDS. It boots properly in pxe but during installation of Linux, again it asks for ip configuration. Also not taking ks.cfg file.

  2. The kickstart is custom to your configuration, the one in the article is a generic one.
    You can create one by performing a configuration by disk and grabbing the ks.cfg from the /root, or using the kickstart configurator that is available on redhat or centos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s