środa, lutego 02, 2011

How to boot WindowsXP installation using PXE?

Yesterday i explained how one can boot normal OS using PXE. Today let's plunge into dark, evil world of windows machines and Microsoft quasi-standards.
First though I'll have some fixes to yesterdays conf files:
  • To get graphical UI i used vesamenu.c32 from SystemrescueCD and added line UI sysresccd/isolinux/vesamenu.c32 at the beginning of pxelinux.cfg/default
  • I removed PROMPT, TIMEOUT, ONTIMEOUT, and MENU DEFAULT directives, as i didn't need them - it's always better to wait for user input and boot right choice instead of booting twice, right?
  • I tried to use syslinux's pxelinux.0, but ended reverting to sysresccd's one (it told me that menu.c32 isn't correct chain file)
So, on to the show now, let's head into black magic of windows standards and not-quite-so-compatible software.
First thing to get was syslinux (hey, i had that one already!?) for memdisk loader. Memdisk loader is nice piece of software which enabled me to use ISO image as initrd to boot from. I copied it into $tftproot/images/memdisk.
Next thing is to get Windows XP (2003 should work too) installation disc. I modified it using nlite and some patches, so i won't have to download them after installation. Tweaked some settings to fit my needs too, but nothing serious, so i won't break things. I didn't end with finalising it into ISO image though - there's one more thing to do with it.
It looks like windows needs additional driver to make use of RAMdisk after the GUI part of installation boots up. I used WinVBlock - it's OpenSource and stuff. After unpacking it i cd'ed to it's directory and then make this into cab file using

makecab WVBlk32.sys WVBLK32.SY_

and copying WVBLK.SY_ into I386 dir in xp disc.
But that's not all - apparently windows doesn't load all drivers automagically - i ended up adding it into modules load list. How? By adding those lines to appropriate sections of i386/TXTSETUP.SIF:

[SourceDisksFiles]
wvblk32.sys = 1,,,,,,4_,4,1,,,1,4


[SCSI.Load]
wvblk32 = wvblk32.sys,4


[SCSI]
wvblk32 = "WinVBlock RAMdisk driver"


Now all that's left is to pack XP installation CD into ISO image and we're done. Despite having MagicIso i used CDImage_gui - there was easy howto for it, but for backup's sake I'll describe entire process:
  1. First thing Is to install (unpack) it.
  2. Fire it up and specify directory containing unpacked XP disc and file to pack it into (it can't be inside the source directory)
  3. Then, on Configuration->Boot specify boot.dat file (it's in CDImage dir)
  4. Click on Creation, then on Start Image Creation and voila!
Now everything that was left was copy brand new ISO file into $tftproot/windows_xp/ dir and add new entries to pxelinux.conf/default:

label WinXP
menu label Windows XP SP3
kernel images/memdisk
append raw iso
initrd windows_xp/XPDISC.iso

That should do the trick. I also made second image without "Press any key to boot installation disc". To do that, i removed i386/bootfix.bin file.
And remember, it takes looooong to download whole disc (for me ~570MB) to RAM. On my EEE PC 1000H and 100MBit connection it took like 3 minutes. But the initial driver loading took approx 0.3 sec, and i think it would take really short to copy files from ram to disc after partitioning, so it's fair trade for me. And no additional discs/USB drives either!

Links that i used during this experiment:
  • http://pxe.dev.aboveaverageurl.com/index.php/PXE_Booting/Windows_2003
  • http://unattended.msfn.org/unattended.xp/view/web/15/
  • http://www.windowsupdatesdownloader.com/Default.aspx

1 komentarz:

Anonimowy pisze...

EeePC have not real optical & floppy drives and this way for install OS working OK. Unfortunately on other machines with optical & floppy drives second phase of Windows Setup not end in the normal way. Please read this: Disappearing memory mapped ISO drive with winvblock - XP setup