Home and Links
 Your PC and Security
 Server NAS
 DVD making
 Raspberry Pi
 PIC projects
 Other projects
 Next >>

Going virtual

Virtual XP

XP is dead, but it's ghost can live on !

The most modern motherboard comes equipped with 'UEFI Class 3' BIOS that will only support GPD disk partitions (which are unusable by XP) and only 64bit Operating Systems (they have chip sets for which only 64bit drivers exists = USB-3 being the most common device for there are no XP drivers)

As of 2016 it was still possible to find motherboards with a BIOS with a SATA option that could be set to 'legacy' mode (aka 'ATA' or 'IDE' mode). However most new machines made by Dell etc. no longer offer such options.
This means it's no longer possible to install (or run) Windows XP on new hardware. Fortunately, it is still possible to pack-up your system into a .vhd (virtual drive) file and run it on a 64bit Windows 7 Pro (or later) 'Virtual Machine'  ...  so it's ghost lives on :-)

Whilst multiple virtualisation software choices exists, the main (free) ones are: Microsoft (Virtual PC(win7) and Hyper-V(win8+)), VMware (VMware Player) and Oracle (VirtualBox)

So 'all' you need to do is 'pack up' your XP styetem into the appropriate 'virtual disk' format file and load it into you chosen virtualisation software choice.
For Microsoft Virtual PC or Hyper-V you need VHD or VHDX, for VMWare it's VMDK (Virtual Machine Disk) and for Oracle VirtualBox it's VDI (Virtual Disk Image), although VirtualBox will also accept VDI, VHD and VMDK (which is good when the 'virtual disk' generators run at no more than 50Gb/hr)
NOTE. The Windows 7 'XP-Mode' from MS is not recommended. Whilst it might look like you are getting 'XP for free', it defaults to 512Mb RAM and the Virtual machine file CAN'T BE MIGRATED to Win10 Hyper-V. On Windwos 7, stick to using Virtual-PC to run your own XP image.
NOTE. Microsoft pricing to OEM's for Win 7 Home was virtually idebntical to Win 7 Pro, so almost all OEM's standardised on Pro. As a result, almost every OEM Win 7 system you will find shipped with Pro. Hhowever Win 10 Home is SIGNIFICANTLY cheaper for the OEM's than Win 10 Pro, so most 'retail' Win 10 systems are shipping with Home.
Unfortunatly, Microsoft will not permit Hyper-V on Windows 10 Home = you need at least Pro and the 'upgrade cost' is prohibative. On the other hand, all the other vitalisation software systems (such as Oracle VirtualBox) run just fine on Win 10 Home.
NOTE also that if you have enabled Microsoft Hyper-V on your PC, it will take over the CPU virtulisation support (VT-x) circuits at boot time. This means you can't run any other virtuilisation system on that PC without first un-installing Hyper-V.
Non-mircosoft virtuilisation systems all appear to co-exist without problems (they don't take over the CPU at power-on).

Be aware that the vhd file will be the virtual machines 'hard disk'. So, amongst other things, be sure to 'excelude' it from your host anti-virus :-)

To speed up your system, place the vhd file on an SSD.
For ultimate speed, place the vhd on a RAM drive (or, to be more exact, copy the vhd to RAM, before launching launching the VM, then, after 'shutting down' the guest, copy the vhd back to the physical drive)

Off-line access to the 'virtual disk' VHD file

If your 'virtual disk' VHD fails to 'boot', you will need to access it 'off-line' (if all you need to do is extract some files, just use 7-Zip, which allows 'read-only' access to VHD, VDI and VMDK files, as does Passmark OSFMount)

Windows 7/8 and 10 are all able to 'mount' .vhd files as a drive letter = you have to go into Computer Management, expand 'Storeage', click on Disk Management and let it 'enumerate the disks on the system'. You can then right click on Disk Management for the context menu and select Attach VHD.

After making any changes, you need to Detach VHD before booting it in Virtual PC / Hyper-V. Do this by selecting Detach VHD from the context menu that comes up when right clicking the mounted VHD drive letter in Disk Management.

Read/Write access to VHD, VDI and VMDK 'virtual disk' files is possible on XP by using the ImDisk Toolkit (although one ImDisk user reported issues) or Daemon Tools Lite 10.3 (the free edition)

Virtual PC and Windows XP Mode in Windows 7 Pro (and above)

Microsoft 'Virtual PC' is virtualisation software that runs 'on top of' Windows 7 (32 or 64 bit). It is most typically used to run 'Windows XP Mode' = a pre-activated Windows XPsp3 .vhd. Note that the 'Windows XP Mode' VHD might not have been included by your OEM vendor - however it's available as a download from Microsoft free of charge, and comes in both 'media player' and 'non-media player' versions. See Microsoft's guide to How to use XP-mode. The current Virtual PC harness even allows XP access to the hosts USB devices :-)

This means that, if you create your own .vhd from an existring XP system, using Microsoft's 'Disk2vhd' tool (a SysInternals utility), it 'should' run OK ... however (as is usual with MS) there are a few drawbacks :-
First, .VHD's created from hard drives exceeding 127Gb won't boot in Virtual PC !
Disk2vhd generates .VHD's from drive letters (C: etc), BUT it "preserves" the partitioning information of the actual physical disk drive. This means your XP system MUST be running on a hard drive of 127Gb (or less) before using Disk2vhd, and only SSD's come in such small sizes these days :-)
Worse, Virtual PC doesn't support the 'Multiprocessor Specification'. This means you won't be able to boot .VHD's created from a multiprocessor Windows XP system.
The default RAM for XP WM's is 512Mb. The RAM limit is 3,712Mb i.e. the same 4Gb Licence limit (minus 'driver space') Microsoft allows all 32bit non-Server XP users. On real hardware any 'un-Licenced' RAM could be accessed by 3rd party RAM Disk drivers = this is not supported on a Virtual PC.
Finally, if your XP comes with an OEM Licence, Microsoft says you are 'not allowed' to run this 'virtually' (unless you pay for 'Software Assurance') - although there appears to be no actual enforcement of this limitation.
But not all is lost ... the trick is to generate a 'full backup' from your existing XP machine and then perform a 'full restore' onto the Windows XP Mode virtual PC !

Note that Windows XP Mode actually uses two virtual hard disks. The 'parent' vhd (which is on the host c: system drive) contains the Windows XP Mode 'master' (the pre-activated Windows XPsp3) whilst the 'differencing' vhd contains all changes you make (programs you install, data you create) and may be on some other physical disk. The 'differencing' vhd is 'dynamic', with a physical size limit == the parent virtual disk size.

This approach makes it very much easier to 'try out' multiple interacting software packages and 'revert' back to the vanilla Windows XPsp3 after each one.
NB. You can work out for yourself what this means for 'time limited free trials' :-)

Virtual PC presents XP with an 'emulation' of the host hardware. This includes the Graphics chip - which means attempting to runs games is rather pointless :-)

Note that 3rd party Virtuilisation software that can run XP-mode images will typically limit the image to Microsoft licenced host systems (i.e. VirtualBox won't run XP-Mode on Windows 10 Home, but will run your own vhd image)

Microsoft Hyper-V

Microsoft Hyper-V is an update of Microsoft Virtual PC that was available in Windows 7 Pro and 8/8.1 Pro (and above). Unlike Virtual PC, Hyper-V acts as an operating system in it's own right (i.e. the VHD is run directly on the underlaying hardware). You can also install Hyper-V on Windows 7

The good news is that VHD files generated by Microsoft 'Disk2vhd' tool also work in Microsoft’s Hyper-V virtual machine harness.

Those lucky enough to have access to a Windows Server 2008 R2 SP1, Windows Server 2012 or Windows Server 2012 R2 machine can use Microsoft Virtual Machine Converter 3.0 instead (which allows you to 'convert' a pyhsical hard drive that's been removed from it's physical PC).

Using Disk2vhd for Hyper-V

Disk2vhd allows you to process a system on a hard drive into a 'virtual' (vhd) file for either Virtual-PC or Hyper-V. Virtual-PC is 'obsolete' - so I recommend sticking to Hyper-V (which can also be run on Win 7).

Note that Most 3rd party virtulisation software will run MS vhd images.

Start by unpacking Disk2vhd.zip and run the disk2vhd.exe tool within the Windows system you want to convert.

The tool uses the XP 'Volume Snapshot' backup utility (Volume Shadow Copy service) to grab an image of the running system.
You can add additional partitions from the System diak to the system VHD file.
You can also select partitions from other disks - the tool will create an extra VHD file for each disk on which one of the selected volume resides.
A VHD file preserves the partitioning information of the disk (although it only copies the data contents for volumes on the disk that you have selected). The maximium size of the 'virtual disk' in the VHD file is 127Gb (so in most cases you will have to migrate your system to a smaller hard drive - eg an SSD -  before generating the VHD file).
Leave 'Use Vhdx' checked (it ensures compatibility with current versions of Hyper-V)
DO NOT check the 'Virtual PC' option (you want a Hyper-V compatible VHD, not a Virtual PC one)
Only the actual data is copied, however typical "C:(source) to D:(vhd file)" speed is 20 Gb/hr (so generating a max. supported VHD of 127GB will take over 6 hrs). If C: is a SSD, a copy to D: is about 3x faster (50-60Gb/Hr).
The tool is clever enough to allow you to generate the .vhd file on the same hard drive as the 'source', however that's going to double the conversion time.
Disk2vhd has an 'activity' bar and shows the 'expected completion' date and time (just above the bar, on the far right) = yes, it includes the date, and no, it's not kidding.

Booting the VHD in Hyper-V

Once you have the VHD file you need to 'create' a 'virtual machine' to run it in. To do this, use the Hyper-V Manager.

Launch Hyper-V Manager and click 'settings' to discover the default location for Virtual Hard Disk (.vhd) files.
Then open the Actions pane at the right. Click New, then Virtual Machine to start the wizard.
Decide what to call your VM 'Name:' (eg Legacy-XP-system)
In 'Specify generation', leave it set to 'Generation 1'
In 'Assign Memory', give your 32bit Windows XP 4Gb (if your XP system uses a RAM disk driver that can use RAM mapped over the 4Gb Microsoft XP Licence limit, by all means try 8Gb)
In 'Configure Networking', set 'vSwitch' (which lets the XP system access the host's LAN adaptor)
In 'Connect virtual hard disk', set 'Use an existing virtual hard disk' and select the .VHD file you generated using Disk2vhd above
Click 'Finish'. The wizard sets up the 'virtual machine' but does not actually 'boot' it (so you can still change the vCPU count or memory allocation etc).

To boot your VM, use the Hyper-V Manager. On first boot, the operating system (on the VHD) will go through a 'hardware detection' phase, so if you failed to enable Networking, you will have to locate and make available any required windows XP 32bit drivers by other means.

Some modern motherboards have chipsets for which no XP drivers exist, although XP can often 'get by' with it's built-in default drivers, or (in the case of USB 3) sometimes not. How problematic this is will depend on the hardware involved.
Hyper-V (like Virtual PC before it) has probelms with RAID, although you might expect Microsoft's own software RAID to work OK.

NB. Be aware that, unless you have paid for 'Software Assurance', Microsoft says: Windows XP, Windows Vista and Windows 7 installed by Original Equipment Manufacturers (OEM) using OEM versions of these products may not be transferred to a virtual hard drive in accordance with Microsoft licensing terms. This means that you should have no problems getting an OEM system to work.

Microsoft's Virtuilisation software is aimed at the corporations - who will, of course, be using OWM versions of XP
Indeed, it's the Retail version of XP that's most likley to fail when run 'virtually'

Various utilities exist that allow you to directly edit the contents of the .vhd file.

VMware Player (VM-Player)

Free for non-commercial usage, VMware Player is a 'Type 1 hypervisor' that runs directly on the host hardware itself. All the services have to be provided by the VMware Player software package. Unlike Microsoft virtulisation (whihc needs at least Pro), VMplayer runs on any version of Win 7 and above (even Win7 'Starter' !)

VMware says "Type 1 hypervisors are generally believed to be more efficient in terms of performance, security, and availability".
Yes and no = whilst VMware can use different drivers to the host Operating System (so provide better 'compatibility' to 32bit XP), there is likely a lot more 'setting up' before it will run all the same hardware as the host.

VMware offers a free tool known as vCenter Converter (VMware vCentre Converter Standalone:). There are, however, a couple of drawbacks.

The first is an annoyance = they insist you 'create an account' before allowing you to download the package. As part of the Registration, you agree that it's your responsibility to ensure you meet Microsoft's' Licence restrictions (fair enough - this means they won't be imposing any Microsoft Licence limitations on you)
The second is that VMware (the company) makes it's money out of it's 'network management' offerings - so vCenter Converter is designed to operate in the most complex way possible i.e. it expects to run on a 'Server' and be used to copy or migrate a 'source' system to a virtual machine 'destination' machine across your LAN.
Fortunately, it is still possible to run the standard downloaded vCenter Converter on the computer you want to turn into a virtual machine, although you can only 'save' the 'virtual machine' to an 'external hard drive' (and boot it up on a different computer). Fortunately, USB sticks are accepted as 'external drives' (although chances are you will need a 64Gb or 128Gb to support most existing XP based Laptop PC's).
For detailed instructions, see here, however essentially all you need to do is click the “Convert machine” button on the tool-bar and select the 'current powered-on computer' as the 'source' (further details can be found here)
Choose the free VMware Workstation (or paid for VMware Player / VMware Fusion) virtual machine as the 'destination' and configure the options. The utility will then create a 'virtual machine' from the current Windows system, modifying it so it will boot properly on the VMware destination computer.

Speeding up VMware guest

Give the gurst more RAM. Current versions of VMware support VM's with up to 4Gb RAM (the limit is the total (sum) for all VM's currently running). Older versions were limited to 3Gb.

Make sure to add the drivers "VMware Tools for VMware" to your guest VHD (in the virtual machine’s menu, select the Install VMware Tools option).

Make sure your AntiVirus is set to 'exclude' the VHD file/folder

As the VM is run, the VM image (vhd) file is used as a hard disk .. there will be millions of read/wrire operations that your AV will 'intercept' and try to scan

Allow the guest more cores (by default, the VM may be running on a single core)

Disable VMware use of a file to 'mirror' the RAM

By default, vmware will allocate a file on the host disk to hold the entire contents of the guest RAM. Sometimes it tries to update the file 'in real time' (in theory the file is only used to support 'suspend')
Open the .vmx file for the virtual machine while it is powered off.
Add the following lines to the file using a text editor. For more information, see Editing the .vmx file of a VMware Workstation and VMware Player virtual machine :-
MemTrimRate = "0"
mainMem.useNamedFile = "FALSE"
sched.mem.pshare.enable = "FALSE"
prefvmx.useRecommendedLockedMemSize = "TRUE"
Note1: The mainMem.useNamedFile entry only applies to Windows Hosts. If your Host is Linux, use:-
mainmem.backing = "swap"
Note2: If you are using VMware Server, you may need to restart the VMware Authorization Service (vmware-authd) for changes to take effect.

Set the VMWare Server VM variables (SMBIOS.reflectHost = TRUE in the VM’s VMX file) to expose the host’s hardware’s OEM ID to the VM.

This will allow an OEM XP to 'see' the host BIOS.
OEM XP on the same manufactirers hardware will then 'just work' OK - so ,long as the host hardware is not too 'modern' comnpared to the XP original
Typically Win7 host woil nbe finme, Win 10 will not
See at end re: Activation problems

Oracle VirtualBox (VB)

A free open-source (General Public License (GPL) v2 license, that allows it to be 'freely distributed and modified at the source code level to accommodate individual needs in functionality'.

VirtualBox is a 'Type 2 hypervisor' that runs over the host operating system which delivers the essential services. This means it's more likely your VHD will run without you needing to find additional drivers etc.

Since it uses the host system, unlike Windows Virtual PC, VirtualBox supports virtualised access to your graphics card 3D hardware (i.e it can run games). This has made it very popular :-)

VirtualBox supports VDI, VHD, VMDK. If you don't have a VM file, there’s no preconfigured "XP Mode". However you can 'install' Windows XP to a VM using the normal Windows XP CD or even from an .ISO file.

You can set VirtualBox to boot direct from a physical optical drive (with XP System CD) or from an ISO file.
When VB 'boots' into the XP installer, you then just go through the normal 'install' process (including partition 'formatting').

VirtualBox supports a feature called "seamless mode". Somewhat similar to Microsoft "XP Mode", you can flip between the running VM 'guest' and the host OS - with coexisting taskbars sharing the same desktop (the XP taskbar is positioned above the hosts, clicking on the approprate taskbar switches 'focus')

Sometimes focus switching is 'incomplete' in that parts of the other system's desktop remain after the switch Using the same 'screen resolution' on both systems should minimise the chances of this happening

NOTE. After adding your vhd to VirtualBox, don't forget to add custom drivers from "Guest Additions" CD image

In VirtualBox, boot your guest operating system and click Devices > Insert Guest Additions CD Image.
Then launch the installer from the virtual disc drive in your virtual machine

NB. You also need to 'exclude' the VM folder from your Anti-virus package :-)

As the VM is run, the VM image (vhd) file is used as a hard disk .. there will be millions of read/wrire operations that your AV will 'intercept' and try to scan

By default, the VM may be running on a single core

Activation issues

When the XP VM boots up it will 'detect' that it's not on the same, original. hardware. If you have a Retail Licence, no problem,just 'reactivate'

The problem is the OEM case - MS says you are not allowed to run your OEM XP 'virtually' without paying them. In Europe this was challenged in ncourt and mS lost. But the software knows nothing about court cases, so you will still have to ring up MS. The 'key' they proviode will typically only work on same OEM Mfg's hardware.

The reason why it fails is that the OEM XP is looking for the Dell SLIC table that is in the bios. There are a number of 'easy 'solutions to this :-

One solution that is reported to work (IF you are running your XP on anotehr Dell) is to enter a DIFFERENT Dell OEM "Windows Licence key" as found on the back of another old Dell PC.
If yu are running on the same manufacturers hardware, and the 'host' is not too new and the Virtulisation software allows it, you can try 'exposing' the host BIOS to the gusest VM. Since Win7 is an 'upgarde' over XP, ethere's a god chnace XP will run on the Win7 host. However Win10 does not come with an XP (or Win7) BIOS.
Another solution is to change your XP OEM to a Retail or Volumn Licencing Key (VLK). To do this requires you perform a Repair/Reinstall on the VM 'image' and enter the Retail / VLK when asked. In theory the 'repair' will remove all the OEM 'BIOS checking code', however you wil still have to ring MS to activate the Retail (only VLK is automatically activated) == see below.

Finally, not quite so easy, is to 'patch' your VM bios to emulate a OEM's SLIC (so patch for Dell SLIC means the VN will think it's still on a Dell and will stay activated).

Changing from OEM to VLK

A Volumn Licencing Key was sold to major corporations to allow them to install their own 'pre confirgured' XP onto employess PC's. To reduce the load on Miscrosoft Licence Servers, the VLK was 'pre-activated'. Since some corporations issued their employees with laptops which they were allowed to use at hoem, inevitably these keys 'leaked'. Piracy became so rife that MS intriduced the 'Genuine check' and blacklisted leaked keys. So, if you use a VLK you found 'on-line', chances are it's been blacklisted and your XP won't pass Microsofts 'Genuine check' - however that might not matter now that support for XP has ended.

To stay legal, you must only use your employers VLK on a company computer. So, if your employer is willing to allow you to run a VM of your home PC or work issued OEM Laptop on their servers, you can sawp the OEM key for their VLK key as follows :-

The following chnages the VM image and NOT the 'original' computer (MS does not Licence VLK's for home PC's) :-
1) Use VMWare Converter to create the VM image from your WinXP OEM physical PC.
Set “this running machine”  and the VMWare Server or Workstation version you intend to use on the host.
2) Copy the VM files (VMDK and VMX), to the host at their final destination (i.e. where VMs are located on the host.)
3) DO NOT "create a VMWare Server VM" on the host. Instead, use the “Add VM to Inventory” Option and choose the VMX you just copied.
4) Launch the VM and go through the motions to make sure that it launches OK. It will shut down as soon as it fails 'activation' (unless it can see an OEM BIOS SLIC on a server from the same manufacturer that is running Win7 or earlier).
5) Go to the VM properties on VMWare Server and select the option to start the VM in BIOS.
You will need to boot from a CD in the next step, so change the boot sequence accordingly.
6) Insert a non-OEM (VLA/retail) Windows XP CD in the host’s drive and start the VM. When prompted, boot the VM from the CD.
7) Perform an in-place “upgrade”, from OEM to VLA/retail.
The installation will prompt you to select the existing installation’s location.
Stay on the existing default, usually C:\Windows, so that you can over-write the necessary OEM files (if you install in a different location, you’ll end up with two WinXP instances on the VM)
When asked, enter the VLK (eg for XP Pro sp3, TQMCY-42MBK-3R4YG-478KD-7FY3M, or (blacklisted) D36RK-QDFFD-BTWWY-BT7KK-43MGM )
8) Finish the “upgrade” and reboot the VM - no more 'activation' issue

Next page :- Diagnosing Internet speed problems