PXE boot in Virtual Server 2005 R2 after an OS is installed in a VM

I had an email from Kari this afternoon asking what key should be used to trigger PXE-booting of a VM under Virtual Server 2005 R2 after an OS is already present on the hard disk. Kari pointed out it worked if there was no OS previously installed (as there's no boot device on a floppy, CD/DVD or hard disk, so it tries the network).

The answer to the question is to have nimble fingers. You need to change the BIOS boot order in the VM to ensure that the network device is higher in precedence that the boot hard disk with the operating system installed. Why be quick - depending on how fast your host machine is, you need to press DEL during the boot. Simply update the boot order to look something like below.

To be quick enough, on the host I was testing this on, it meant needing to have the VMRC window pointed at the VM and hit reset in the Virtual Server admin interface to start the machine (re-) booting. That gives you enough time to see the BIOS and hit DEL.

There's no scriptable way I know of to do this (ie through the Virtual Server COM API), however you can, and I stress is absolutely and totally unsupported, script a change to the VMC file to update the BIOS string under Preferences/hardware/bios/cmos. A windiff of a before and after will tell you what bytes to changes, but don't rely on this working in the future.

Cheers
John.