Introduction

Most of our linux installation are over the network using pxeboot, while the FreeBSD installations are using a usb stick. The reason for this that our servers do not have a DVD/CD-ROM drive. Recently we had to install Window Server 2012 on one of these servers and had to face many issues. Firstly lets highlight the issues we have

  • We have a Windows Server 2012 DVD iso but the server machine does not have a DVD drive
  • There are many references on the web which describe the process of making a bootable usb, but no of them worked. Possibly they work with Windows 7
  • Similarly there are references on the web which describe installing using a tftp server and pxe boot. This is something similar to how we do the linux installations, but again didn't work with Windows Server 2012

Finally we came across iPXE (http://ipxe.org/howto/winpe) which the solution we describe here. Most of the documentation can be got from http://ipxe.org/howto/winpe . However things wouldn't work straight out of the box

Installation media

On linux you could mount the installation media using the loopback device as described below

mount -o loop wserver12.iso /mnt/

We will access the installation media at a later point of time ovef CIFS. For that we need to install and configure samba

# yum install samba

Add the following entries /etc/samba/smb.conf

[mnt]
        comment = mnt
        path = /mnt
        browseable = yes
        guest ok = yes
        writable = no
        printable = no

Now we create a user which can access the share

# smbpasswd -a quadstor
New SMB password:
Retype new SMB password:

WinPE configuration

Download and install the Windows Assessment and Deployment Kit
Click on Start -> Deployment and Imaging Tools Environment
On the command prompt do the following

mkdir c:\winpe
copype x86 c:\winpe\x86
copype amd64 c:\winpe\amd64

Now zip c:\winpe to winpe.zip and copy it the zip file to the linux machine.

cd /var/www/html
unzip <path to winpe.zip>
So now we have
# ls  /var/www/html/winpe/
amd64 x86

Get the latest wimboot file

wget http://git.ipxe.org/releases/wimboot/wimboot-latest.zip
unzip wimboot-latest.zip
cp <unzipped wimboot folder>/wimboot /var/www/html/winpe

While original documentation describes using bootmgr from the winpe environment, this did not work with the following error when we tried to boot using iPXE

no embedded bootmgr.exe found

So we use the bootmgr which comes along with the installation media

cp /mnt/bootmgr /var/www/html/winpe/

Create the iPXE boot script

In /var/www/html/winpe create a file called boot.ipxe and add the following to boot.ipxe

#!ipxe

cpuid --ext 29 && set arch amd64 || set arch x86
kernel wimboot
initrd bootmgr						bootmgr
initrd ${arch}/media/Boot/BCD				BCD
initrd ${arch}/media/Boot/Fonts/segmono_boot.ttf	segmono_boot.ttf
initrd ${arch}/media/Boot/Fonts/segoe_slboot.ttf	segoe_slboot.ttf
initrd ${arch}/media/Boot/Fonts/segoen_slboot.ttf	segoen_slboot.ttf
initrd ${arch}/media/Boot/Fonts/wgl4_boot.ttf		wgl4_boot.ttf
initrd ${arch}/media/Boot/boot.sdi			boot.sdi
initrd ${arch}/media/sources/boot.wim			boot.wim
boot

Now we have the following files/directories under /var/www/html/winpe/

# ls /var/www/html/winpe/
amd64  boot.ipxe  bootmgr  wimboot  x86

Remember use tabs between the filepaths and the filenames above, else we get the following error during boot

CPIO bad magic. Could not extract initrd...

Using iPXE to boot

iPXE documentation covers most of the options, so we list the steps we did which are self explanatory

In the iPXE welcome screen
Press Ctrl + B
iPXE>dhcp
iPXE>chain http://10.0.13.6/winpe/boot.ipxe
Our installation media and boot.ipxe were on 10.0.13.6

Installing Windows Server 2012

Assuming that your configuration is correct and iPXE was able to chain load correctly, the winpe environment would have initialized and you will be left with a command prompt. Now we access the installation media and install windows

net use d: \\10.0.13.6\mnt
cd d:\
setup.exe

Once you run setup, you would now be presented with the usual installation steps