12 Mar

A Saga of Virtuality

Day One:

I’ve got two laptops, a 5 year old Dell with Windows 7 (a solid work machine) and a much older Dell that’s still running Windows XP. I’d get rid of the XP machine except it has a test server on it that only runs on XP.

The server itself as a standalone installation has long been discontinued by the developers and they’ve moved their later versions to SaaS. These later versions are prohibitively expensive, especially for what is only a non-production test server where the only functionality I am interested in is storing test data and testing the occasional piece of coding. In other words, the XP installation suits my needs at a cost I can accept and I’d like to keep it. It’s no longer supported by the developers, but I can live with that.

What I might be interested in, though, is in porting it to some sort of virtual machine so that it runs on the Windows 7 machine and I don’t need the second laptop. An added benefit might be that it runs faster if it’s hosted on the slightly newer laptop…

After a bit of investigation on the web it looks like there are two main options – a P2V (Physical to Virtual) copy of the existing XP setup (essentially copying the entire system into a virtual platform that can be run on the guest machine), or using Windows XP Mode as a virtual operating system. The second option seems to be the trickier option at the moment, having to install XP Mode, the OS, reinstall the server, and migrate all the data. It might be a cleaner option in the end and maybe I’ll try it after a proof-of-concept of the P2V option, but for now I’ll look at copying the entire existing setup and seeing if that runs.

There appear to be various options in the market for doing P2V conversions. I settle on the Microsoft utility Disk2VHD because a) it’s free, and b) there appear to be numerous tutorials  explaining how it all works.

 

Day Two:

In preparation for the conversion, I do some housekeeping on the XP machine. Run Disk Cleanup, empty the recycle bin, run defrag a few times to optimise the disks. Haven’t cleaned it up in a while, so this takes most of the day.

 

Day Three:

Let’s make a virtual machine!  Downloaded Disk2VHD from sysinternals. Followed the tutorials to install it and run it and then select the system disk (C:) that I want to make into a virtual platform. It’s a 195GB disk split into two partitions, of which the C: drive is only 109GB in total size with 20 or so GB of data on it so should be reasonably quick, and the VHD is built in only an hour or so. The VHD file is being written to an external hard drive.

I’ve already got Windows Virtual PC installed on the Win7 machine, so just unplug the external hard drive from one machine and reattach it to the other, and select the VHD when Virtual PC is creating a virtual machine. Unfortunately, it returns an error:

VHD error

A quick Google suggests that this error is because the disk size may be more than the 127GB limit.

To double-check, I use diskpart. Yep, it’s showing as the full 195 GB, and as RAW, not formatted. When it’s recognised by Win7 there’s also a popup asking if I want to format the new disk. Something’s gone wrong.

diskpart

I start again back in the XP machine, just in case it was something in my settings. Two hours later, same result. I wasn’t sure if the limit was on disk or partition, I guess I have the answer.

 

Day Four:

Back to Google for alternative options. VMWare consistently stands out, and a bit more investigation leads me to the VMware vCenter Converter. Created a VMware account, validated email address, downloaded and installed the converter.

Started the converter and moved through the conversion wizard. The converter’s options for a hosted destination – Workstation, Fusion, or Player – need a bit more investigation. VMWare’s site has Workstation Player which confuses the options a bit, but I go for the Workstation as a hosted destination. Under 2 hours later, and the converter has finished; I have a nice new shiny .vmdk file.

I go to download VMWare’s Workstation Player v12, but notice that it’s for 64-bit only. My Win7 machine is 32-bit. Back to the drawing board. Is there a VMWare player that supports 32-bit? A bit more investigation turns up that the Player versions from 6 and below (and 7 with certain hardware) are supported on 32-bit systems, and a bit more searching results in a link to the older versions on the VMWare site. I opt for VMWare Player v6 and download and install.

As a bit of a test I try to open the Workstation virtual machine on the Player, well, player. No dice – fair enough, I didn’t expect it to work anyway.

Back to the XP machine and the Converter, to create a new virtual machine with Player v6 as the hosted destination. A bit under 2 hours later and a fresh new .vmdk file has been created.

Time to boot it up and see if it works!

Opened up VMWare Player, selected Open a Virtual Machine, selected the new .vmdk and crossed my fingers. Two minutes later:

XPScreen

Success!

I give it a few more minutes to boot up, look for new hardware and install drivers, and generally wait until it finishes any additional processes. That’ll do for today.

 

Day Five:

Today is  making sure all drivers are installed and all connections are running properly. I boot up the virtual machine and check for any missing hardware. There are a few bits and pieces missing so it’s a slow morning downloading drivers, copying them to a USB stick, then swapping back to the virtual machine to install them. This might have gone faster if I’d remembered that I still had the original XP installation disk…

Two things are still bothering me about the virtual machine:

  1. The machine is not recognising the wireless card, so it looks like I’ll have to dig into the Player manual to set up network connections
  2. The machine takes the host RAM usage up to 95% and the machine itself is very slow.

The host machine only has 4GB RAM in a single slot. Crucial does a matching pair to bring the RAM up to 8GB at a reasonable price so the order goes in.

 

Day Seven:

The RAM’s arrived. It’s a fairly trivial matter to swap out the single stick of 4GB and install the two sticks of Crucial Ballistix.

Turn the laptop over and boot it up. It doesn’t seem to be that much faster, and the performance monitor shows that nearly 50% of the RAM is being used. Once Windows loads fully, I go into the system properties and check – nope, still says 3.16 GB usable. I reboot and go into the BIOS, where it shows DIMM A as 4096 MB and DIMM B as empty. Might be a seating issue, so I shut it all down, open the back up again and remove both memory modules. Just in case it’s a dodgy stick I swap the two sticks over and reinstall them, making sure they’re seated properly and clicked in.

Reboot again and check the BIOS first – both DIMM slots are recognised as 4096 MB, so it must have been a seating issue. Windows starts up. Again, though, initial indications are that 50% of the memory is being used, so once it’s fully booted I check the properties again. “Installed memory:  8.00 GB (3.16 GB usable)”. Windows isn’t recognising the additional memory.

Wait a minute, how much memory can Windows recognise? Turns out that for the 32-bit version, only 4 GB. I have the 32-bit version installed. So that was a waste of time then, and a waste of a few pounds on the memory upgrade.

The next couple of hours are spent investigating whether or not the rest of the hardware (particularly the CPU) can handle 64-bit, making an OS upgrade/reinstall possible. Turns out that CPU-Z thinks that it’s possible, so now that’s an option – with a decision to be made on whether to only go to Win7 64-bit, or go the whole way to Win10.

I’m happy with Windows 7, so we’ll stay with that and if I need to upgrade to Windows 10 later then at least the upgrade path will be on 64-bit.

An added bonus will be that I will then be able to upgrade to VMWare Workstation Player.

 

Day Eight:

After the fiasco with the RAM, and sleeping on it, it makes sense to move up to the 64-bit version of Windows 7 to take advantage of the extra 4GB. And if I’m going to reinstall Windows, then why not upgrade the hardware to SSD at the same time? This will also speed up the host system, and might have some added benefits for the virtual machine.

Cue more investigation. Which brand? What size? After looking at a number of benchmarking sites I’ve narrowed it down to SanDisk vs Samsung (with Kingston a close third), and after comparing the various products (Ultra vs Extreme vs Evo vs Pro) and the relative disk sizes and prices, I settle on the Samsung 850 EVO 500 GB. Not too shabby at just over £110.

SSD ordered and Win7 64-bit download started.

 

Day Nine:

Win7 download completed, and ran an MD5 hash check against the published MD5 sums to check that the download is correct and valid.

Created a bootable USB stick using the Windows USB tool. Had to run it twice due to an error in creating a 64-bit bootable device from a 32-bit system, but downloading bootsect fixed that.

Ran Belarc Advisor to generate a system report on installed software and keys so I know what to reinstall.

 

Day Eleven:

Hoorah, the SSD’s arrived. The laptop HDD is the same dimesions as the SSD so no need for a spacer – simply unplug and replace. Booted up and checked the BIOS to ensure the settings were correct and the new drive was recognised, then booted from the USB drive to install a fresh copy of Win 7 64-bit. The installation completes in less than half an hour – wow!

It then took vast multiples of that time to find any missing hardware drivers – install, reboot, install, reboot, rinse and repeat until all drivers are found and installed – and to download and install all Windows updates. Reboot time is less than 20 seconds now though from Post to operational which is fantastic.

At the same time I’m also creating a new VM from the XP machine, this time using Workstation 12 as the destination, and downloading and installing Workstation 12 on the host.

Two hours later and we’re ready to go, loading Workstation 12 on the host and starting the new virtual machine. Once it loads and the XP OS starts inside the VM there are a few driver issues and installs to complete. Connecting the DVD drive and loading VMWare Tools inside the virtual machine clears any remaining driver issues and the VM is ready to use.

The new virtual machine works like a charm. Running on the SSD and with the extra RAM it’s so much faster than the original laptop, and the server is now usable again. I still have a few issues with networks and ports but I’ll work these out over time.

 

Conclusion:

As this was my first foray into virtual machines I wasn’t sure what to expect, but if I’m to take away anything from the past couple of weeks it would be to make sure your hardware on the host system is up to the task. The difference between the old laptop (4GB RAM, 320GB HDD, Win 7 32-bit) and the new laptop (8GB RAM, 500GB SSD, Win 7 64-bit) is simply phenomenal.  For under £150 in total the hardware has been transformed from a plodding host into a speed machine and is now able to deal with the extra demands of hosting a VM.