Adding PXELINUX to WDS (Mixed-mode Windows/Linux Deployment)

I’ve been using WDS + MDT for a long time and I’ve been happy. This didn’t stop me from thinking about adding more PXE alternatives than the standard (Windows) WDS PXE environment though. I like to experiment, and this time I experimented with a mixed-mode of Windows and Linux PXE. What you’ll need in short is PXELINUX to replace your out-of-the box WDS pxe-boot environment. Your old familiar Windows Deployment Services will still be left intact, it will just be added as a separate PXE boot option in the boot menu. I found some pretty good instructions, but as usual I like to write my own. I won’t write about the whole experiment though, as the main guide is available from:

http://thommck.wordpress.com/2011/09/09/deep-dive-combining-windows-deployment-services-pxelinux-for-the-ultimate-network-boot/

I followed the guide, with the following changes:

  • Could not find all (three) files in any of the syslinux-packages I tried downloading from kernel.org. My solution was to (yum) install this package on one of my test-workstations and just copy the files from there. It happened to be a Fedora Core 19 if someone is interested.
  • Copied the files to \\RemoteInstall instead of \\Reminst (I’m using Windows Server 2008 R2, to be upgraded to 2012 R2 soon).
  • Copied the files to BOTH x64 and x86 directories on the WDS server. My virtual machine didn’t like booting from x86 even though my newly created virtual test machine was supposed to be 32 bit. Oh well, with the files copied for both architectures it did work. I did my changes in the x64 directory however.
  • Because of this, I also had to change the flag in the wdsutil command:
    • wdsutil /set-server /bootprogram:boot\x64\pxelinux.com /architecture:x64
    • wdsutil /set-server /N12bootprogram:boot\x64\pxelinux.com /architecture:x64
  • Added Gparted Live, Memtest86+ and (later) Ubuntu to the menu
  • Did a test-run and it booted 🙂 (Fig 1)

pxe_boot_menu

Fig 1. PXE Boot Menu (Pxelinux/Syslinux). Better screenshot later in the document (Fig 10).

memtest

Fig 2. Memtest86+

  • Configured GParted Live a bit different than in the guide. I had to scratch my head a bit for the fetch=http part but got it working (UPDATE: now using NFS instead, see note).
    • Didn’t quite understand the webserver part (and I’m not an expert on IIS). Had a look at http://www.syslinux.org/wiki/index.php/WDSLINUX which gave me some small hints… “If on IIS create a new virtual directory and set the mime type for .* extension to text/plain)”. Still very cryptic to me though 🙂
    • Well, doesn’t hurt to try. I installed the IIS Server Role on the WDS Server.
    • Went to properties and created a new virtual directory (Fig 3). The alias was set to “gparted” and the physical path to D:\RemoteInstall\Boot\x64\Linux\gparted (where all the files for gparted are stored).

iis

Fig 3. IIS Manager

  • Created the mime type for .* (Fig 4).

iis2

Fig 4. Setting mime type for .*

  • Also changed the configuration file in syslinux/pxelinux to point to this virtual directory:
    • append initrd=\Linux\gparted\initrd.img boot=live config  noswap noprompt  nosplash  fetch=http://x.x.x.x/gparted/filesystem.squashfs
    • Actually worked 🙂 (Fig 5)

gparted

Fig 5. GParted booted in an “empty” 5GB virtual machine with no partitions.

 

NOTE: Not using http/IIS for GParted anymore. Also got this working with NFS. Read the next chapter about Ubuntu and you’ll understand. I just copy/paste the working configuration here:

LABEL gparted
    MENU LABEL GParted Live
    kernel \Linux\gparted\vmlinuz
    append initrd=\Linux\gparted\initrd.img boot=live config noswap noprompt nosplash netboot=nfs nfsroot=x.x.x.x:/Linux/GParted
    # append initrd=\Linux\gparted\initrd.img boot=live config  noswap noprompt  nosplash  fetch=http://x.x.x.x/gparted/filesystem.squashfs (not in use now)

Other changes from http to NFS: I had to make a directory called “live” and copy/move the filesystem.squashfs into that dir. Source: http://gparted-forum.surf4.info/viewtopic.php?id=14165

 

Moving along to Ubuntu…

I found many guides, but they were all about the same. None with working configurations for me 😦 I had to try almost everything with trial and error. I’m still not even sure if the problem was a bad parameter or a wrongly configured NFS Server. Oh well, to help anyone else out there, here are my steps (in no particular order):

  • Got a headache from all the testing 🙂
  • Downloaded Ubuntu Netboot Image from http://cdimage.ubuntu.com/netboot/
  • Downloaded an Ubuntu ISO, 13.10 (64-bit) in my case
  • Extracted both the Netboot Image and the Ubuntu ISO and copied them to the WDS Server:
    • D:\RemoteInstall\Boot\x64\Linux\Ubuntu\ubuntu-installer (Netboot version)
    • D:\RemoteInstall\Boot\x64\Linux\Ubuntu\ubuntu-full (Extracted Full version ISO)
  • Add the Role Services: Services for Network File System to your WDS Server (Fig 6).

nfs_server2008r2

Fig 6. Services for Network File System (NFS)

  • Configured NFS. My steps in the screenshot (Fig 7):

nfs_sharing_steps

Fig 7. NFS-Sharing

  1. Manage NFS Sharing… (Choose Properties/NFS Sharing on the dir. I shared D:\RemoteInstall\Boot\x64\Linux)
  2. NFS Advanced Sharing (changed settings according to picture)
  3. Permissions (put a mark in Allow root access)

 

I got very confused with all the parameters from all the instructions found. I seems that the vmlinuz-file isn’t the same in Ubuntu 13.10 as in older distros. Correct me if I’m wrong. It took me a long time to figure out the correct settings for the configuration file “default” (\Boot\x64\pxelinux.cfg\default).

After some serious testing, it turned out that I had to use a combination of both the Netboot version and the full version of Ubuntu to get my Live-CD to PXE boot.

Here’s a sample from http://www.howtogeek.com/61263/how-to-network-boot-pxe-the-ubuntu-livecd/ which didn’t work out of the box for me:

LABEL Ubuntu Livecd 11.04
MENU DEFAULT
KERNEL howtogeek/linux/ubuntu/11.04/casper/vmlinuz
APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=<YOUR-SERVER-IP>:/tftpboot/howtogeek/linux/ubuntu/11.04 initrd=howtogeek/linux/ubuntu/11.04/casper/initrd.lz quiet splash --

In this example, the Ubuntu files are extracted to \Linux\Ubuntu\11.04. On my server that would correspond to the exact path of D:\RemoteInstall\Boot\x64\Linux\Ubuntu\11.04. Then there are a bunch of sub-directories, one of which is namned “casper”. Casper holds the kernel so Ubuntu can start/boot over network/pxe. HOWEVER, on Ubuntu 13.10, there’s NO file called vmlinuz, it’s called vmlinuz.efi. Afaik, pxelinux can’t boot this file (at least not on my test setup. Don’t know about the EFI-support on pxelinux either…). Well, the solution was to use the netboot version for the kernel and the full distro (extracted) for the actual installation. It’s probably easiest to just post my current working configuration:

LABEL Ubuntu
    menu label Ubuntu 13.10, 64bit
    kernel \linux\ubuntu\ubuntu-installer\amd64\linux
    append root=/dev/nfs boot=casper netboot=nfs nfsroot=x.x.x.x:/Linux/Ubuntu/ubuntu-full initrd=/Linux/Ubuntu/ubuntu-full/casper/initrd.lz quiet splash

I have extracted the Ubuntu netboot version to D:\RemoteInstall\Boot\x64\Linux\Ubuntu\ubuntu-installer and the full version Ubuntu to D:\RemoteInstall\Boot\x64\Linux\Ubuntu\ubuntu-full. I’m sharing the “Linux” dir over NFS as described earlier.

All of this configuration was just for a plain installation of Ubuntu 13.10. There’s much that can/should be automated with kickstart or similar. There are some packages that should be installed in the post-phase of the installation and also some configuration files that should be copied (from the nfs share). I’ll leave this for another post.

 Ubuntu_install1

Fig 8. Ubuntu pxe-booted “live”.

Ubuntu_install2

Fig 9. Installing Ubuntu from the live session

 

My configuration file if someone is interested:

DEFAULT      vesamenu.c32
PROMPT       0

MENU TITLE Abo Akademi, Dept. of IT PXE Boot Menu
MENU INCLUDE pxelinux.cfg/graphics.conf
MENU AUTOBOOT Starting Windows Deployment Services in 8 seconds…
         
# Option 1 – Run WDS
LABEL wds
          MENU LABEL Windows Deployment Services
         menu default
         timeout 80
         TOTALTIMEOUT 9000
          KERNEL pxeboot.0

        
# Option 2 – Run gparted
LABEL gparted
    MENU LABEL GParted Live
    kernel \Linux\gparted\vmlinuz
    append initrd=\Linux\gparted\initrd.img boot=live config noswap noprompt nosplash netboot=nfs nfsroot=x.x.x.x:/Linux/GParted
    # append initrd=\Linux\gparted\initrd.img boot=live config  noswap noprompt  nosplash  fetch=http://x.x.x.x/gparted/filesystem.squashfs (not in use anymore)
   

# Option 3 – Run memtest86+
LABEL memtest86+
    menu label Memtest86+
    kernel \Linux\memtest\memtest

   
# Option 4 – Ubuntu
LABEL Ubuntu
    menu label Ubuntu 13.10, 64bit
    kernel \linux\ubuntu\ubuntu-installer\amd64\linux
    append root=/dev/nfs boot=casper netboot=nfs nfsroot=x.x.x.x:/Linux/Ubuntu/ubuntu-full initrd=/Linux/Ubuntu/ubuntu-full/casper/initrd.lz quiet splash

   
# Option 5 – Exit PXE Linux
LABEL Abort
         MENU LABEL Exit
         KERNEL abortpxe.0

 

I left graphics.conf with its default settings (Fig 10, modified in Fig 1). Here is a screenshot of the whole thing in action:

pxe_boot_menu_final

Fig 10. PXELinux PXE Boot Menu

I already have screenshots from the other alternatives on the boot menu, so just for fun I added some screenshots when I’ve pressed the default option to boot Windows Deployment Services:

wds_loading_files_pxelinux1

Fig 11. Loading boot file from WDS.

pxelinux_wds_mdt_task_sequences

Fig 12. After the boot file has loaded from WDS, it’s time for MDT’s Task Sequences. Everything about this procedure is already covered in my previous post Deploying Windows 7/8 with Microsoft Deployment Toolkit (MDT) 2012 Update 1 and Windows Deployment Services (WDS)

 

Are you still reading? Instead go ahead and try PXE booting every OS out there 😉

 

Sources (those that I can remember):

http://www.syslinux.org/wiki/index.php/WDSLINUX
http://www.howtogeek.com/61263/how-to-network-boot-pxe-the-ubuntu-livecd/
http://s205blog.wordpress.com/2012/10/02/ubuntu-12-04-lte-pxe-network-installation-tutorial/
http://rebholz.wordpress.com/2012/05/17/technical-how-to-installing-linux-edubuntu-using-pxe-boot-and-windows-7-as-a-server/
http://www.howtogeek.com/162809/how-to-pxe-boot-an-ubuntu-image-from-windows-server-2008/

Advertisements

11 thoughts on “Adding PXELINUX to WDS (Mixed-mode Windows/Linux Deployment)

  1. Hi to you. I’m making a linux boot via pxe, but when i use kernel \linux\ubuntu\ubuntu-installer\amd64\linux this kernel – while instalation it sais “Wrong or corrupted boot kernel”
    Can you help me plz?

  2. Thank you so much for your Guide it was great for me to explore and try new things.
    i had some difficulties but i got them done
    My configuration line for Ubuntu 14.10 was:

    label ubuntu-expert
    menu label Ubuntu 14.10 Installer
    kernel Linux\Ubuntu\ubuntu-full\casper/vmlinuz.efi
    append root=/dev/nfs boot=casper netboot=nfs nfsroot=[MyServerIP]:/Linux/Ubuntu/ubuntu-full initrd=/Linux/Ubuntu/ubuntu-full/casper/initrd.lz quiet splash

    • I’ve download Ubuntu 14.10 and try to do as you did.
      Here is my code:
      LABEL Ubuntu
      MENU LABEL Install Ubuntu 14.10
      KERNEL Images\Ubuntu\ubuntu-full\casper\vmlinuz.efi
      append root=/dev/nfs boot=casper netboot=nfs nfsroot=[ServerIP]:\remoteinstall\Boot\x64\Images\Ubuntu\ubuntu-full initrd=\Images\Ubuntu\Ubuntu-full\casper\initrd.lz quiet splash
      But while loading, i have an error “unable to find a live file system on the network”
      Maybe you got some ideas what to do with it?
      Tree from the folder is here: https://mega.co.nz/#!E4F2BJrD!LAoFJ5BrDv-QbuHuVmYbwfGofVQFAKrSqapGUjN7U6k
      Please, help!

      • I have to say I’m a bit rusty with this nowadays (not doing that much deployments anymore). Hopefully Bilal from the above comment can help you out.

  3. I came across the same issue with finding the files as you did, with later versions. This is because they added EFI support, and they put the legacy files in BIOS and the new .c32’s in EFI32 and EFI64. Those can be used for EFI booting instead of BIOS booting. (No idea how to make that work, as I didn’t see a pxelinux.0 file anywhere)

    The files in the latest versions (6.00 and above) are within the aforementioned “bios” folder. bios\core\pxelinux.0
    bios\com32\menu\vesamenu.c32
    bios\com32\chain\chain.c32

  4. hey,

    the reason you couldn’t find any of the files thom talked about, is because in 2014 syslinux 6. was released. With this release they moved most of these files the appropriate folder. You can find all the files under the bios folder. 😉

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