PXE boot windows PE from Linux

8,746

Solution 1

The issue I experienced was a result of a bad FTP-get, which caused the WinPE ISO I had to truly be unbootable like the error said (tested trying to boot the CD in a VM). Leaving the question in case someone finds it useful.

Solution 2

When you "mount" winpe_amd64.iso on a VM and boot from it the ISO sees itself booting from a CD/DVD drive (either real or virtual). When you boot winpe_amd64.iso from memdisk the ISO sees an "emulated" (created by memdisk) disk environment.

APPEND iso raw

Some Windows ISO's need the 'raw' option on some PCs.

It is possible to map and boot from some CD/DVD images using MEMDISK. No-emulation, floppy emulation and hard disk emulation ISO's are supported.

The "map" process is implemented using INT 13h - any disk emulation will remain accessible from an OS that uses compatible mode disk access, e.g. DOS and Windows 9x. The emulation via INT 13h can't however, be accessed from an OS which uses protected mode drivers (Windows NT/2000/XP/2003/Vista/2008/7, Linux, FreeBSD) once the protected mode kernel drivers take control. If the OS contains drivers for accessing this mapped ISO, or knows how to find the ISO on the disk, there is no booting problem of course.

INT 13h access: Not all images will complete the boot process!

Windows NT/2000/XP/2003/Vista/2008/7 (NT based)

These Windows versions use INT 13h access only in the start of the booting process (loading only the necessary drivers). Once the protected mode drivers are functional to access the disks, Windows can't see the memory mapped drives created by MEMDISK (CD/DVD, hard disk and floppy disk images) and it will fail to complete the boot process.

Source: http://www.syslinux.org/wiki/index.php/MEMDISK

Bottom line: memdisk is a last resource alternative. pretty unreliable. avoid it.

In your case I'd try PXE booting into pxeboot.n12 (NBP) wich later calls bootmgr.exe, bcd, boot.sdi, and finally your Boot.wim file. This is pretty much the WDS way to PXE a Windows PE envirnment.

Edit:

pxeboot.n12 can be found within Boot.wim on any Windows DVD/ISO.

Specifically from the error you get you can also be facing this kind problem. https://superuser.com/questions/28123/when-installing-windows-7-cdboot-error-5-appears-cannot-boot-from-cd-why

Share:
8,746

Related videos on Youtube

Centimane
Author by

Centimane

Updated on September 18, 2022

Comments

  • Centimane
    Centimane almost 2 years

    I'm attempting to get a Windows Preinstallation Environment to boot over PXE from a Linux server. The end goal will be to install Windows but that's pretty easy once I can get WinPE to start up (I've got the samba share with the windows OS disk etc.). I'm using ESXi and attempting to get a VM to PXE boot the winPE but also have access to a physical machine for testing. I followed the steps on a few tutorials (http://www.tecmint.com/configure-pxe-server-to-install-windows-on-centos/ mainly) and I've reached an interesting place:

    If I attempt to PXE boot the winPE on either the VM or a physical machine I get the error:

    CDBOOT: Cannot boot from CD - Code 5
    

    However, if I mount the winpe iso on the VM's disk drive it works fine (I reach the winpe and can install windows). From what I've read of the "Cannot boot from CD - Code 5" error it is most commonly associated with BIOS firmware/hardware incompatibilities, but were that true the iso shouldn't work when mounted either.

    In my ./pxelinux.cfg/default I have:

    MENU LABEL Windows 7
     LINUX memdisk
     INITRD windows/winpe_amd64.iso
     APPEND iso raw
    

    I've tried both with and without appending raw with the same result. I have already copied the memdisk binary to the tftproot. The iso seems to be found when PXE booting because the iso is being read in some capacity, the ISO is placed inside the tftproot at windows/winpe_amd64.iso.

    Anyone have any insight on why the PXE boot would behave differently from mounting the ISO on the drive, and any ideas on how to resolve the problem with booting the iso?

  • Pat
    Pat almost 9 years
    Windoes PE is "itself" a small "Windows", it loads like Windows, it uses Windows protected mode drivers, etc. what the memdisk guys say about Windows is also valid for PE. Memedisk approach as I've said before is not reliable; as they say, some PCs need the parameter "raw", while others don't, while others miserable fail. That's it. pxeboot.n12 is an "NBP" that is requested and run by the booting PXE client, it doesn't matter if the PXE server is Linux or Windows. pxeboot.n12 can be found on any Windows DVD/ISO.
  • Centimane
    Centimane almost 9 years
    Strange, I have an official windows install disk but it does not have pxeboot.n12 on it: find ./ | grep pxe returns nothing
  • Pat
    Pat almost 9 years
    it is within Boot.wim
  • Centimane
    Centimane almost 9 years
    ah, I'll mount that and take a look for it
  • Pat
    Pat almost 9 years
    Save time just extracting it with 7z...
  • Centimane
    Centimane almost 9 years
    The problem actually seemed to be with how I copied the winPE.iso from my windows workstation to the PXE server. I was using windows built in FTP server and the linux ftp client, and I noticed the ftp get reported the file may not have transferred fully. Tried ftp through mozilla and it PXE booted successfully