Getting Windows 7 to boot from Debian Linux PXE boot, round 439...

The guide that I found, Ultimate Deployment didn’t work straight away. I ran into a bug generating the BCD file, probably because the winpe.wim that I generated is corrupt. So maybe it is difficult to get this working after all. But I’m not ready to give up yet; wimlib contains an implementation of the Windows IMage manipulation tool, imagex.

The first step in the Ultimate Deployment guide is to set up the DHCP server and TFTP server. I already did that for Debian and Fedora (see my previous posts here, and here. Rather than scrap what I had before, I will remove everything which I know doesn’t work. Here’s my current, broken Windows PE setup:

├── boot
│   ├── bcd
│   └── fonts
│       ├── chs_boot.ttf
│       ├── cht_boot.ttf
│       ├── jpn_boot.ttf
│       ├── kor_boot.ttf
│       └── wgl4_boot.ttf
├── bootmgr.exe
├── debian
│   ├──
│   ├── menu.cfg
│   ├── sid
│   │   ├── amd64
│   │   └── i386
│   ├── splash.png
│   └── wheezy
│       └── amd64
├── fedora
│   ├── 18
│   │   ├── initrd.img
│   │   └── vmlinuz
│   ├── menu.cfg
│   └── splash.png
├── hiberfil.sys
├── pxelinux.0
├── pxelinux.cfg
│   ├── default
│   ├── logo.png
│   ├── main.png
│   ├── pxe.conf
│   └── vesamenu.c32
└── windows
    ├── 7.x64
    │   ├── __boot_metadata__
    │   ├── bootmgr.exe
    │   ├── boot.sdi
    │   ├── install.cmd
    │   ├──
    │   ├── wdsnbp.0
    │   ├── winpeshl.ini
    │   └── winpe.wim
    ├── __boot_metadata__
    ├── menu.cfg
    ├── remap
    ├── splash.png
    └── XP

I will remove everything from the windows/7.x64 directory, as well as all the /boot and windws related files in the TFTP root (/srv/tftp). One thing I want to make sure, is that WIM and BCD files (and any related helpers), are regenerated. Now just the windows/menu.cfg and splash image exist.

Next step is to set up the Samba share (which I’ve already done, but will go over again). The deployment guide suggests /work/sambashare as the path; I chose /var/spool/mirror/windows. The Windows 7 ISO I have is mounted oun /var/spool/mirror/windows/win7.x64.sp1/. The “smbclient –no-pass –list localhost” command confirms that REMINST is a known share. After some tribulation with midnight-commander (Debian does not compile SMB VFS support into mc by default), I was able to connect and browse the shares on my home workstation. I even created a symlink from “win7” to “win7.x64.sp1”, the former of which is the directory the deployment guide suggests to put in the Samba share root.

The guide has the administrator enable a log monitoring tool called “binl”. This will be mostly useless unless we set it to the tftp log (which on Debian is /var/log/daemon.log). I also had to ensure that a very verbose option was set in /etc/default/tftpd-hpa, adding “-vvv” to the TFTP_OPTIONS variable.

Part 3 of the deployment guide is where I decided to diverge. Rather than use the decidedly-closed source, yet still buggy tools they provided, I will use wimlibs’ imagex. The first step is to mount the image(s) in the Windows ISO root:/sources/boot.wim. Since there are two images within the boot.wim (Windows PE, and Windows Setup), I mounted both (at /mnt/win and /mnt/win.2, respectively. The first task is to find and extract the following files:


The Windows PE installation process expects these files to be in the TFTP root (/srv/tftp). So I placed them there. It looks like much of the deployment guide sets up is an unattended installation procedure. That’s not my goal right now; I’m just trying to launch a typical, attended Windows 7 Professional install, all from PXE. I’ll go with the stock boot.wim and see what happens… Looks like it’s a success! At least, I’ve gotten farther than I have ever with this Win7 attempt. I’m now at the Windows 7 “Setup is starting…” screen, I have a rotating blue “wait” ring… positive signs! Hrmm, it doesn’t work, the WDS client can’t connect to my TFTP server.

First thing I’m going to do is remap everything so the Windows files aren’t littering my TFTP root. Simple enough. I won’t worry about the files conflicting with any other Windows installs I want to put on here (since that list is probably effectively nil). Now it boots, but the installer can’t find the Windows Deployment Service (WDS), because I don’t have one. I will continue with the instructions from Ultimate Deployment, starting with section 3…

And I got lost. I stopped making notes. I ended up using the install.cmd. Rather than post the contents here (since it’s rather large), I’ve linked to it here: install.cmd. Since I was using the stock bcd file, it didn’t have the hive keys in it that the original install.cmd references. I hard coded my internal IP address, and had it call setup.exe on the mounted ISO.

Now, all I need to do is find a valid Windows 7 x64 Professional registration key, and I’ll be able to test the entire setup!