HOWTO: Convert Windows Server 2008 from bare metal/GPT to VMware/MBR

I’ve been working on a server consolidation project over the past few months in preparation for moving a small corporate server room into a hosted data centre.  I spent much of last night and this morning working on one of the final milestones, P2V (physical-to-virtual conversion) of a bare metal Windows 2008 system running SQL Server 2008.

All of our previous bare metal Windows systems have been virtualised with the VMware converter, but is was a newer server than most (an IBM x3650 M2), and it has EFI firmware rather than a traditional BIOS.  VMware does not support P2V of GPT systems, so we were stuck with finding another method.  There have been reports that people have done it successfully however (with appropriate repairs of the MBR and the boot sector), so we had good reason to believe it was possible.

Our bare-metal Linux servers had been virtualised with a basic disk copy technique:

  • boot Ubuntu live CD on source and destination
  • install ssh server on destination
  • Run on source: dd if=/dev/sda bs=1024k | ssh destination ‘dd of=/dev/sda bs=1024k’

This was quite effective for our Linux servers, since Linux distributions tend to include drivers in their initial RAM disks for the SCSI controllers that VMware emulates.  I decided to try the same thing at the partition level to get the Windows system copied: create the new partitions on the destination, copy the individual partitions, and then repair the Windows boot process.

I’ll claim bad memory about what happened around this point (it was late, and i was tired), but it was not successful.  After a little searching, i came up against a parted alternative called GPT fdisk (known as gdisk in Ubuntu), which claimed to be able to convert from GPT to MBR partition types, as long as the drive was a supported size (which this one was).  So i started a copy of the entire drive using the dd process described above, and went to bed, leaving the 500 GB server to copy overnight.

This morning, after a little messing around with different versions of the Ubuntu live CD to find a more recent version of gdisk, i was able to convert my partition table using a hybrid partition table (which the author takes pains to point out: don’t try this at home, kids).  GPT fdisk allows selecting which GPT partitions to represent in the MBR, so i simply selected all of the Windows drives, without the reserved partitions at the beginning.  (This wastes whatever space was taken by those partitions, but 400 MB out of 500 GB was not too high a price to pay for avoiding backing out this change and waiting for the next maintenance window to have another crack at converting this system.)

As expected, the Windows VM would not boot.  I booted from the Server 2008 DVD and performed a repair of the MBR and boot sector using bootrec.exe.  This got little further along in the boot process, resulting in the error message that “BOOTMGR is missing”.  Fortunately, this is a known problem with a straightforward fix: startrep.exe.

This got the system booting, but after loading several device drivers it produced a blue screen STOP 0x0000007B.  Searches on VMware suggested this was a disk driver issue, and a common problem after P2V conversions.  Unfortunately, VMware’s advice about it was to inject the drivers on the source server, and re-run the P2V conversion, which i wasn’t prepared to do due to the multi-hour copy process involved.

Enter the offline registry editor.  This 4 MB boot CD allows Windows password resets and general registry edits without needing Windows to be running.  Armed with the knowledge that the LSI SAS driver was likely already installed, i found that simply enabling the driver (by setting HKLMSYSTEMCurrentControlSetservicesLSI_SASStart to 0!) was all that was needed.  This is a little confusing in the offline registry editor because SYSTEM is not the default registry hive (you have to select it manually), and there is no “CurrentControlSet”, only “ControlSet001” and “ControlSet003” on the system i was converting.  (I enabled the LSI SAS driver in both ControlSets.)  After this, Windows 2008 was able to boot successfully in our ESXi 5 system.

After installing VMware tools, we tried the paravirtual SCSI driver, but that caused a blue screen again, so we reverted to the LSI SAS driver, which on this system has offered pretty good performance anyway.  The paravirtual NIC driver (vmxnet3) seems to work fine.

Looking back, i can’t help but think that i probably could have done this better, by creating the MBR partitions manually and persevering longer with getting it booted that way, or by investigating VMware’s support for UEFI/GPT within VMs, or maybe there are even pre-built tools out there to manage this.  But this experience served to reinforce to me that despite several seemingly large obstacles, lots of problems are soluble with persistence and logic.  And Microsoft and VMware’s knowledge bases.  And people documenting their experiences on forums.  And great Free Software tools that solve specific problems.  And Linux live CDs.  And Google.  🙂


When (Windows) software updates go awry

One of my clients had some very interesting Internet traffic statistics last week.  We came in Thursday morning and found that overnight we had downloaded over 700 GB of data from our ISP (UQ SchoolsNet).

Traffic graph from last week

When we looked through our proxy server logs we found that 538 GB of the total came from a single PC attempting to download a single URL for Adobe Acrobat Reader 9.2 updates.  Fortunately, we’re on an Internet plan which is capped rather than charged for excess traffic, and more fortunately still, our ISP hosts an Akamai mirror, which is where the URL for the updates resolved to.  So, no harm done.

What this reinforced to me was that allowing direct access to the Internet by PCs is rather irresponsible, both from a bandwidth utilization perspective and a cost perspective.  (And that doesn’t even take into account what legal ramifications there might have been if it had been a BitTorrent client rather than a misconfigured/buggy software update client.)

Attachment Size
internet-traffic.png 20.37 KB
internet-traffic-2.png 60.4 KB


Getting Adobe Digital Editions to work in Ubuntu

Today we have a guest blog post from my wife Angela.  She is an avid Ubuntu user (in fact, so are our kids) and a great web researcher in general.  She wanted to borrow digital editions of books from our local library; however, the books are only available in the form of digital handcuffs.  So she set herself the task of getting Adobe Digital Editions (DE) working on Ubuntu lucid.  Without further ado, here’s her story:

  1. You need to install Wine (available in the package manager).
  2. On the Adobe Digital Editions page is a link to an installation TechNote (not far below the message that your system doesn’t meet the minimum requirements).
  3. Under the heading “Windows Solutions”, subheading “Manually install Adobe Digital Editions” is a link to download the latest installer for Windows. Click this and choose to SAVE it to your computer (not the RUN option).
  4. On my computer it appeared as “Adobe Digital Editions.desktop” which is an unknown file when you click on it. Right click on this icon and in the drop down box go to Properties -> Permissions and make sure the box “Allow Executing File as a Program” is ticked.
  5. Downloading an ePub book that runs in DE gives you an .acsm file. This is just a digital key or certificate. I found the first time I used it, I needed to drag and drop the .acsm file onto it for it to load into the library. After that I only had to click on the .acsm file, and it worked as it apparently does in Windows.

I have now installed this on three separate computers, and have noticed inconsistencies, probably related to the version of Ubuntu and/or Wine installed.  These are some possible bugs I have noticed – sadly I didn’t pay attention to which versions they correspond to:

  • For some reason DE did not always appear in the list of applications available in Wine (under the Applications drop down menu). Not sure why.
  • I noticed that although everything else seems to work okay (bookmarking the pages in the book I am reading, etc.) books “borrowed” from the library that have expired say on the bookshelf marked “expired” instead of disappearing. However this might be normal for Adobe DE even in Windows. 
  • On one install, the next time I restarted my computer after shutdown, the digital editions application icon on my desktop had lost the permission to allow it as an executable program (see above) and I had to re-enable this.
  • On one install it won’t close from the [x] in the window; I have to click on the little book icon on the upper left hand side and choose “close” from the drop down menu.
  • Occasionally I get an .acsm file that doesn’t work and find I need to go into Properties -> Permissions and tick the “Allow Executing File as a Program” option (this appears to be random and may be related to the certificate, not the DE install.)
  • An I/O error has almost always been a problem at my end, and I have needed to check the settings in the Wine registry.