Home » Blog
date 22.May.2016

■ Migrate virtualPC 2007 machines to VirtualBox (and keep the old VHDs)

Every 5 years or thereabouts I switch laptops. The old trusty HP probook hasn't kicked the bucket yet, but it was profusely sweating (cooling fan went crazy) especially running windows 10 in virtual machines, so I thought I'd best retire it before it retired itself in a catastrophic meltdown. The replacement is a Toshiba satellite with SSD. Migrating the development environment to the new laptop is a big job; part of it was the virtual machines I use for testing xplorer² et al in older windows versions.

The first realization was that virtual PC 2007 won't work on windows 10 x64. I got several warnings from the OS that this would't work; ignoring them proved futile. The installer could not add the Virtual Machine Network Services and trying to start a VM would lead to a BSOD (!). Apparently people have managed to use it but only on 32 bit versions of windows 10. I had to bid farewell to the lightweight and long serving virtual PC 2007. What are the alternatives?

I had 5 virtual machines in vpc2007: windows 98, 2000, (2x) XP and vista. The all important "hard disks" were in the handy VHD format. Obviously I wanted to reuse these VHDs, since they included windows updates and lots of installed software. When you create a new VM you can instruct Virtualbox to use an existing virtual hard drive file rather than creating a new empty one. The best news is that you can import in VHD format instead of the default VDI type. Almost sorted, except for a couple of snags:

VirtualBox immutable virtual machines

Virtualbox doesn't have a simple way to terminate a VM deleting any changes in the VHD. You can set a disk image to immutable, but how is that done? This is open source after all, so don't expect any GUI conveniences, and even RTFM won't tell you much. Here's the drill:
  1. Delete the VM you want to modify (keeping the files)
  2. Browse the virtualbox installation folder and open a DOS console in it
  3. In the command prompt type:
    VBoxManage modifyhd "c:\path\to\disk.vhd" --type immutable
  4. Redefine the VM importing the now immutable VHD

If you try to do this with a VHD that is attached to a VM — even if not running — you will find it fails (I lost a couple of hours trying). That's why step 1 is very important. Anyway, open source we said, cheap and cheerful :)

If you don't want to go into this trouble, there is an easier way using snapshots. A snapshot is similar to a restore point; create one, then you can go back discarding any changes, installed programs, viruses and so on. Here are the steps:
  1. Select the VM and create a snapshot (see the pic)
  2. Start the VM, do any changes you like, then stop it (shutdown not required)
  3. Right click on the snapshot and choose Restore. Untick box that offers to save current state.
  4. Before restarting the VM, delete the snapshot. Don't let snapshots accumulate, because merging 2 or more snapshots takes a long time. That's why step 4 is important.
using virtualbox snapshots

Snapshots have a little overhead compared to VPC2007, but will give you throwaway VMs for testing.

ps. This is the last blog created on the old HP laptop, retired with honors. No more windows 2000-like window snapshots <g>

Post a comment on this topic »

Share |

©2002-2016 ZABKAT LTD, all rights reserved | Privacy policy | Sitemap