Archive for the ‘VHD’ Category

Converting Hyper-V guest systems to VirtualBox

August 4, 2011 5 comments
  • System Notes: Oracle VirtualBox 4.0.12, Windows Server 2003 R2 X64, Windows Server 2008 R2

My main Hyper-V server host system runs four production and three development/testing guests, with the four production and one of the development/testing systems in use 24×7.  Memory was becoming extremely tight on the host system, especially when running either of the two remaining development/testing guests along with the regular 24.×7 guests.

Since the two development/testing guest systems were really just for security patch and software upgrade testing, I decided to try and move them over to Oracle VirtualBox on my main workstation.

If you are converting a guest Windows server that is running anything earlier than Windows Server 2008 R2, you should first remove the Hyper-V Integration Services from the guest, to prevent any BSOD startup problems after you move the guest over to VirtualBox.

When setting up a Windows Server 2008 R2 guest system using an existing VHD file for the primary hard disk, you must make a change in the VirtualBox Settings.  The VHD will be attached as a SATA drive by default, and you will get a BSOD if you try to boot it this way.  You need to remove the VHD file from the SATA controller and re-add it as an IDE hard drive.  See this link for a specific discussion of this problem.  See my previous blog entry Switching from IDE to SATA controller types for older Windows guests in VirtualBox for specific details on working with IDE and SATA virtual drive files.

Additional Notes:

Just a bonus quick reference note for VirtualBox:  you can use Ctrl-Arrow to move systems up and down the list on the main Oracle VM VirtualBox Manager window.  Just highlight the system you want to reorder and press Ctrl-Up or Ctrl-Down.


Virtual guests using VHD files for their hard drives do not start when moving from Virtual PC to VirtualBox

April 25, 2011 Leave a comment
  • System Notes: Microsoft Virtual PC 2007 SP1, Oracle VirtualBox 4.0.4

I recently upgraded one of my production workstations, and wanted to move from Microsoft Virtual PC to Oracle VirtualBox, due to the increased horsepower of the new workstation.  In doing this, I had read online about the fact that VirtualBox supported the VHD hard disk files native to Virtual PC guest systems, and that it was a mostly seamless process to move from virtual host to the other.

I had four virtual guest systems that I use for testing to be moved.  Three of them were servers, comprising Windows 2000 Server Standard, Windows Server 2003 Standard, and Windows Server 2003 R2 Standard, and one was a Windows XP SP3 system.

After adding the systems to the new Oracle VirtualBox installation, two of them started and ran normally, and two hung at startup with a blank, black screen, with no indication they were doing anything at all.

The solution to the problem of the two systems hanging at start ended up requiring a conversion of the guest hard drive files from VHD to VDI.  This process was simple to complete using the CloneVDI tool, which is available for download here.  There is a good discussion of this problem and the solution on the VirtualBox forums here.

Categories: VDI, VHD, Virtual PC, VirtualBox

Converting Hyper-V VHD hard disk files from dynamic to fixed, while at the same time shrinking the size of the VHD files

July 12, 2009 Leave a comment
  • System Notes: Dell PowerEdge 2950, Windows 2008 Server Standard x64

After attending a Hyper-V seminar recently, I learned that the recommended setup for any production server includes using a fixed size for any VHD file (as opposed to dynamic; see this link). I had originally set up all of my virtual servers with dynamic disks, in an effort to save space. I also specified much larger drive sizes than I would have otherwise needed. The VHD files in question needed to be converted to fixed format, and several of them needed to be cut in half in size.

I did several searches on this problem, and tested out a few tools that were supposed to allow conversion between dynamic and fixed VHD formats, as well as allowing size changes. Alas, they would only allow an increase in size, and not a decrease. So I ultimately came up with my own solution, using the partition management features of BootItNG and the DriveImage XML imaging program to accomplish what I needed. Here are the steps involved:

  1. Boot the virtual server to a BootItNG ISO.
  2. Use the BootItNG “Work with Partitions” option to do a non-destructive resize the partition to the desired size. When complete, shut down the virtual server.
  3. From the Hyper-V settings for the virtual server, create a new fixed-size VHD file and attach it as a secondary drive.
  4. Boot the virtual server, and chkdsk should run on your resized primary drive. Allow it to complete.
  5. Using the Windows disk management tools, partition and format the new fixed-size VHD secondary drive.
  6. Shut down the virtual server. Now you will be booting into whatever method you want for launching DriveImage XML. I use a BartPE boot disk, but there are several ways to accomplish this. Once you have DriveImage XML up and running, use the Drive To Drive option to duplicate the dynamic VHD onto the new fixed VHD.
  7. Shut down the virtual server and use the Hyper-V settings to remove the primary dynamic VHD drive and the secondary fixed VHD. Attach the new fixed VHD as the primary drive.
  8. Boot into the BootItNG ISO with the new primary fixed VHD attached.
  9. Use the BootItNG “Work with Partitions” option to set the partition in the new primary fixed VHD as active. If you don’t do this, when you attempt to boot the virtual server with the new fixed VHD, you will get the “Boot failure. Reboot and select proper boot device” error message and it will not boot.
  10. Shut down and then restart the virtual server. Assuming everything has worked correctly to this point, you should be prompted by your Windows installation to restart after you have logged in and it has added the details for the new primary fixed VHD.

Additional Notes:
One problem I ran into with DriveImage XML is that it cannot copy an old partition into a new partition that is smaller than the older one. Hence the need for using the partition management features of BootItNG to reduce the size of a dynamic VHD first, before imaging it. Make sure the new size is just slightly smaller than the size of your new fixed VHD, or you will run into this problem. DriveImage XML is smart enough to add any extra space in the partition when it writes the copy to the new fixed VHD. I had originally tried to use the Gparted partition management software (version 0.4.5-3; available here), but could not get it to see more than 127 GB of a disk under Hyper-V. I believe Symantec Ghost supports writing to smaller size partitions without needing to resize the partition first, but I do not have it available and cannot verify this.

Categories: Hyper-V, resize, VHD