WDS for Windows and Linux

Where I work is very much a Windows shop. Well, there’s also almost 2000 OS X laptops to worry about. However, most of the infrastructure we operate is built around Windows.

Active Directory provides centralised authentication (even for Linux and OS X), Group Policy configures the systems and WDS with MDT is used to handle imaging.

With my push to get Linux systems managed to the same extent, we’ve been keen not to duplicate infrastructure where possible. Turns out we can configure WDS to support both Windows and Linux, meeting that goal.

The process for getting this going is actually fairly simple. You’ll need to start by grabbing a reasonably recent copy of syslinux. That’s what we’ll be using to replace the initial WDS boot menu.

I should probably point out here that we’ll only be configuring this for 64 bit systems. You can make the same changes to the 32 bit elements in WDS. However, the lack of 32 bit systems in existence nowadays tends to make the work of limited benefit.

Anyway, from the archive you downloaded, you’ll want to find the following files and put them in your RemoteInstall\Boot\x64\ folder on the Windows server:

chain.c32

ldlinux.c32

libcom32.c32

libutil.c32

pxelinux.com

vesamenu.c32

It’s also suggested that you make a copy of abortpxe.com and pxeboot.com called abortpxe.0 and pxeboot.0.

You’ll also want to create two new folders in your RemoteInstall\Boot\x64 folder. One of them should be called Linux and the other pxelinux.cfg. The former will be used to store the actual boot images for your Linux system. The latter, for configuring the boot menu.

Within the pxelinux.cfg folder, you’ll need to create three files. The first of these is called default and holds the configuration for the first menu we’ll display after F12 is pressed.

As you can see, we configure the menu to display two options – Install Windows and Install Linux. The Install Windows option simply calls the pxeboot.com (now called pxeboot.0) that is called by default.

The Install Linux option is a little more complicated and loads a second menu.

To test what we’ve done so far, you’ll need to reconfigure WDS. Run the following commands (as administrator) to set our menu as the default PXE boot option:

This should create you a menu with a white background and grey text. It’ll also display a 640×480 image file called background.png behind the menu.

It’s likely you’ll want to change this colour scheme to match your corporate standard or artistic choices. The best place to help you with this is the MENU COLOR section of this page.

Bear in mind that any colours you select are listed #foreground #background in AARRGGBB format. That means you can get quite creative with your selections and transparencies.

While our menu might be looking the part, it’s only operational for Windows so far. We still need to configure the sub-menu for Linux. To do this, create a file called linux.menu in the pxelinux.cfg folder with the following contents:

While the Kickstart and Preseed parts are optional, this will setup a menu allowing you to install both Ubuntu 14.04 and CentOS 7.

If you were to PXE boot now, you’ll be presented with the first menu we got working earlier. Selecting Install Linux will now display a menu with two items in it.

However, selecting any of them will throw an error. The reason is that we haven’t actually got any of the OS files in place yet.

We’ll start with getting the Ubuntu netinstall option working. First step is to create a folder inside you Linux folder called ubuntu-14.04-amd64.

You’ll also need to grab a couple of files to go into this folder. Start by downloading this archive and extracting it on your local machine. Find both the initrd.gz and linux files and copy them to the newly created ubuntu-14.04-amd64 folder.

Assuming we’ve done this correctly, you should now be able to install Ubuntu from your new PXE boot menus. While that’s pretty impressive, we’ve still got more to come.

Inside the Linux folder, create a folder called centos-7-amd64. Download a copy of the netinstall CD from here. Copy the vmlinuz and initrd.img files from the CD image to the centos-7-amd64 folder.

You should now be able to install both Ubuntu and CentOS from your swanky new WDS boot menu. Even better, if you’ve got the contents of Boot folder replicated across your servers, making this live on multiple sites should be as simple as running a couple of wdsutil commands.