Tweaking the BIOS boot order under Virtual PC / Virtual Server

Virtual PC and Virtual Server do not provide a direct user interface to allow people to change settings in the virtual machines.  The way that you change settings in the BIOS under a virtual machine is by hitting the ‘DEL’ key to enter the BIOS during virtual machine boot just like you would on a physical computer.

The BIOS setting information is then actually stored in the virtual machine configuration file (.VMC) under the <cmos> key.  If you are interested in changing the BIOS settings for a virtual machine in a programmatic fashion the easiest way to do this it to edit the .VMC file and replace the <cmos> key.

For an example – here is the CMOS string for a Virtual PC virtual machine with a boot order of hard disk, CD-ROM and then floppy:

<cmos type=”bytes”>00004050F025378002007C2F003E101000003F00000000000031004C0707070704
3F007C2085801F00000000700801800E7500000000000000000000000000901A32E24A580050E999E6240
1002784004A20802440000000000A58ACFE1032547698BAE4008372000000030000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000</cmos>

While this is the CMOS string for a Virtual PC virtual machine with a boot order of floppy, CD-ROM and then hard disk:

<cmos type=”bytes”>00004000F0203F8002001C2F00EB030600001100000000000031004C0707070703
FA001C2085800700000000200C01800CFC00000000000000000000000000901A32E252580050E999E6240
1002784004A2080240000000000085AACFE1032547698BAE4000000000000030000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000</cmos>

Two things to be aware of with doing this is that the CMOS string values are only guaranteed to match when using the same revision of the same product – so you should not do this across product lines (VPC and VS) or across service pack levels (RTM and SP1) – and if you mess this information up your virtual machine may not boot :-)

Cheers,
Ben