Error loading my BCD when trying to PXE boot to Windows PE

5,564

It turned out to be a rather embarrasing mistake.

Inside /etc/default/tftp.conf, I used the wrong syntax to point to the /etc/tft_remap.conf file. The correct file contents are these:

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"

TFTP_OPTIONS="--secure -l -v -m /etc/tftp-remap.conf"

Share:
5,564

Related videos on Youtube

dialer
Author by

dialer

Updated on September 18, 2022

Comments

  • dialer
    dialer almost 2 years

    I'm trying to set up an ubuntu server with pxelinux, so I can boot Windows PE using PXE. On the client machine, I can see that pxelinux itself works, but the next screen is this:

    error


    Here is what I did:

    Step 1: Installed tftpd-hpa and dhcp3 on the server. The server is a fresh ubuntu server x86 virtual machine. Static IP is 192.168.26.0. Samba server is installed.

    dhcpd.conf contains

    subnet 192.168.26.0 netmask 255.255.255.0 {
      range 192.168.26.10 192.168.26.40;
      filename "pxelinux.0";
      next-server 192.168.26.0;
    }
    

    I have verified that TFTP and DHCP work.

    Step 2: Downloaded pxelinux.0 from the ubuntu repository. Put it in the tftpboot directory and created pxelinux.cfg/default with these contents:

    DEFAULT winpe
    
    PROMPT 0
    TIMEOUT 300
    
    MENU TITLE PXE
    
    LABEL winpe
    MENU LABEL Windows PE
        KERNEL Boot/pxeboot.0
    

    I've tried using Wdsnbp.0 (-> Wdsnbp.com), instead of pxeboot.0 (-> pxeboot.com) made no difference.

    I want to make a real menu with ubuntu options later.

    Step 3: Downloaded and installed the Windows Automated Installation Kit for Windows 7 and installed it on a fresh Windows 7 x64 vm.

    I followed these instructions in the WAIK.chm file that comes with the download. Short version:

    Copying Files and stuff:

    copype.cmd x86 c:\winpe_x86
    

    I want to provide an x86 winpe image.

    imagex /mountrw C:\winre_x86\winpe.wim 1 C:\winpe_x86\mount
    
    net use y: \\192.168.26.0\TFTPRoot
    y:
    md Boot
    
    cd \temp\Windows\Boot\PXE
    copy c:\winpe_x86\mount\Windows\Boot\PXE\*.* y:\Boot
    copy c:\Program Files\WAIK\Tools\PETools\x86\boot\boot.sdi y:\Boot
    
    Imagex /unmount C:\winpe_x86\mount
    copy c:\winpe_x86\winpe.wim y:\Boot\boot.wim
    

    BCDEdit usage:

    Bcdedit -createstore c:\BCD
    
    Bcdedit -store c:\BCD -create {ramdiskoptions} /d “Ramdisk options” 
    Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdidevice  boot
    Bcdedit -store c:\BCD -set {ramdiskoptions} ramdisksdipath  \boot\boot.sdi
    
    Bcdedit -store c:\BCD -create /d “MyWinPE Boot Image” /application osloader
    

    guid1 is the guid returned from the previous command.

    Bcdedit -store c:\BCD -set {guid1} systemroot \Windows
    Bcdedit -store c:\BCD -set {guid1} detecthal Yes
    Bcdedit -store c:\BCD -set {guid1} winpe Yes
    Bcdedit -store c:\BCD -set {guid1} osdevice ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
    Bcdedit -store c:\BCD -set {guid1} device ramdisk=[boot]\Boot\boot.wim,{ramdiskoptions}
    
    Bcdedit -store c:\BCD -create {bootmgr} /d “Windows BootManager”  /inherit {dbgsettings} 
    Bcdedit -store c:\BCD -set {bootmgr} timeout 30 
    Bcdedit -store c:\BCD -displayorder {guid1}
    
    copy c:\BCD \\server\TFTPRoot\Boot
    

    BCDEdit reported each operation as successful. The BCD file is capitalized.

    Step 4: I created some symbolic links (advice from this German source):

    ln -s Boot boot
    ln -s Boot/bootmgr.exe bootmgr.exe
    ln -s Boot/pxeboot.n12 Boot/pxeboot.0
    

    Unfortunately that source deals with Windows Vista and Windows PE 2.0, whereas I'm using Windows 7 and Windows PE 3.0, but those links can't harm I guess. Using pxeboot.com instead of pxeboot.n12 does not fix the problem. The only difference is that you have to press F12 to boot. A sign that the system works at least on a basic level (i.e. it can at least load pxeboot.n12 and bootmgr.exe).

    I also added this remap-rule to /etc/tftp_remap.conf to avoid problems with path separators:

    rg \\ /
    

    I'm out of ideas. I recreated the BCD several times. I also tried using the BCD that you can find in the WAIK folders, no success. Googling this error unfortunately only yielded irrelevant information to me (i.e. how to repair this problem with existing Windows installations).