Converting Physical SBS to Hyper-v with Disk2vhd Utility

Posted: December 12, 2011 in Exchange 2010, Hyper-v, iSCSI, Migration, SBS 2008, SBS 2011, SharePoint Foundation 2010, Virtual Machine, Virtual Machines, vm
Tags:

yes, Virginia, there is a Santa Claus who can help you convert your physical SBS server to a virtual machine to run under Hyper-v.  But dear, they don’t tell you nearly enough, so pay careful attention to this.  Especially if you want to user the same server box to be your new Hyper-v host machine.

Preliminary Work

The assumption is that you have SBS installed on a physical machine.  You would like to use that physical machine as a Hyper-v host.  How can you convert SBS to a virtual machine?  And what does it take to host Hyper-v on that box?

If your SBS is 2008 or 2011, you needn’t worry about whether the server can support 64-bit because both of those are 65-bit operating systems.  If, however, your starting point is SBS 2003, you need to verify that it can run a 64-bit OS.  If your server is from around the time when SBS 2003 was first released, I suggest you look at a new server to save yourself a lot of frustration, time and eventually money.  You can purchase a lovely box from Dell, HP and others for about $1500.  Then  you can do a migration to SBS 2011 between two physical boxes.  See my post about setting up SBS 2011 as a virtual machine and do the migration to it.

Once you are convinced your current server box will support the Hyper-v host os, check on how much memory you you have.  I would recommend16GM as the minimum necessary for a successful system and as much more as you can add past that to accommodate the number of virtual machines you plan on hosting.

I have a few virtual machines for SBS running between 8GB and 16GB and all give more than satisfactory performance.  They run along with 4-8 other virtual machines (other 2008 R2 servers, Windows 7, and XP operating systems). More memory is better of course  but you may find the marginnal benefit of 1GB more memory to not show up in the other vm performance .

Now you have determined a proper machine to host Hyper-v with sufficient memory.  It is my very strong suggestion that you now purchase new disks for the OS hosting environment. Why? Because if something goes wrong in the conversion, you don’t want to have clobbered your original system disks to be able to go back to a physical machine.  I know the cost and complexity of new system disks will vary from installation to installation, but disk prices have dropped so much that the cost of even a pair of 500GB (RAID 1 scenario) is under $100.  What is your time for recovery worth:?

The last thing you will need is a disk that can house the .vhd created on the physical installation to be copied to the new os environment for the virtual machine.  An external USB drive is perfect for this, but an internal hard disk that can remain mounted when you create the new hosting environment works well, too.

Cleaning Up the System

Before you convert to a .vhd, do as much cleanup on your SBS system as possible.  Not only will this make the conversion faster, it will make it easier.  And in some cases, it can mean the difference between success and failure.  The conversion utility will convert up to 127GB, so if you have too much data on your system disk, it may not convert at all.

Here are some suggestions:

  1. Move your Exchange data files to another hard disk.  As a rule. I never leave them on the system volume.
  2. Do the same with your SharePoint data files.  Same rule for moving it to another disk.
  3. Move any user profiles to another disk.
  4. If you have any data files that are shared, move them as well and update the share.
  5. Empty the recycle bin.
  6. Delete any temporary files.

In short, anything that is on your system disk that is not essential to the system either delete or move.  Note: if files are small, weigh the inconvenience of moving them against the conversion impact.  A few kilobytes won’t make a difference but a few gigabytes might.

Disk2vhd Utility

You will need this free and downloadable utility to convert your system disk to a .vhd file (click to download it).  It is straightforward to use and can work with a system that is online.  I will share with you some of the tricks I have picked up to make it easier for you.

Disk2vhd works by taking a snapshot of the files to be converted.  What you don’t want to happen is have those files updated while the conversion is running, possibly causing data consistency issues.  Exchange is a case in point, so before you start the conversion, stop Exchange services.  Do the same for SharePoint and any other applications that might be updating files as they run,

If you have been following closely about the preparations, you will have detected my overall approach:  isolate the system to the c: drive, convert it to a .vhd, bring up the new os and create a virtual machine from it, and have all of the data files remain on media that are mounted onto the host operating system.

With that in mind, when you run the conversion utility, you will be just converting the system disk.

disk2vhd

In the above example, I have isolated Exchange, SharePoint and user data and even have a separate drive to store the .vhd file.  (Remember, I am a big iSCSI fan and this is a piece of cake to do).

Much  more important, however, is to note that I have selected not only drive C: but the System Reserved area as well.  If you don’t select the System Reserved area, the resulting .vhd will not be recognized as bootable.  When you try to attach it as a virtual drive and start the machine, you will get the following messages:

disk error has occurred
Ctrl+alt+del to continue

But of course there is nothing to continue to.

Choose your destination for the .vhd, then click Create.  It can take thirty minutes to over an hour, so entertain yourself while it runs.

The Hyper-v Host

Now shut down the SBS system, remove the system disk(s), insert the new disk(s) for the host os, and install the os.  If you have a license for Windows 2008 R2, use it by all means.  If you don’t own or want to pay for a license, you can download Windows 2008 Hyper-v for free.  Be aware that it has only a limited interface and that you will need to do enable remote execution of Hyper-v manager on it to be effective.  Still, it is free.

Install the os and launch Hp yer-v manager.  Create a new virtual machine following the wizard.  But instead of creating a new .vhd, instead point to the .vhd you created with the disk2vhd utility.

Before you start the virtual machine, adjust the settings as follows by highlighting that vm and clicking on settings.

  1. Memory – use dynamic setting.
  2. Processor – use the number of virtual processors that match the host cpu.
  3. Network adapter – you can use the same adapter as the host machine or an additional one.
  4. iSCSI Controller – Use this to add disk drives attached to the host system.  For example, if you have USB drives (for backup, e.g.) connect them to the virtual machine.  Same for data drives.  Note – if you are using iSCSI targets, the virtual machine can connect directly to them without adding them as hardware.

Now start the virtual machine.  What you will discover is that it doesn’t start right up like you would think.  Instead, it appears to be “hung” without the desktop appearing.  This could take from five to thirty minutes.  What is happening is that SBS is adding new devices to the system as they have been attached through the virtual interface.  When that is complete, you will get a message that new hardware has been added and you should reboot.

After the reboot, check the network settings to make sure they are correct.  You may have to run fix my network or connect to the internet wizard from the SBS console.  Check to make sure all services are properly started and that Exchange connected to the databases.

Your virtual SBS is now complete and you can add other virtual machines as necessary.

Advertisements
Comments
  1. jose says:

    I fallowed all the steps but when start the server i get an error of access the vhd file. The sbs is an intel machine with raid and the host is an amd without raid. Both servers are on thre same domain and i am doing the all operation as the admin. The sbs does not show the small system partition.

    Thanks for your help
    Jose.bello@myappsonline.com

  2. Mike Beutler says:

    This is a great guide, but you skipped one key detail during vhd creation of the system drive. If your server has the 100mb system partition you will have to change the snapshot storage location or snapshots will fail.

  3. Do you mean backup location for server backup on the resulting SBS VM or the server backup on the Hyper-v host OS? I have not observed the need to do this. Could you share with us the exact details?

  4. Am I correct that you can create the VM instance but when you try and start the VM it gives you an access denied sort of error? I have seen this happen when I tried to load an OS for a new machine where the .iso for the install DVD was on a remote volume and the Hyper-v host was not a domain member. Solution was to just copy the .iso locally and it was fine, although I believe if I had done a more vigorous search I would have discovered a missing system or machine permission. You might follow that logic and change the location for the .vhd to be local to the host. Let us know.

  5. Our site says:

    This is very interesting, You are a very skilled blogger.
    I have joined your feed and look forward to seeking more of your wonderful post.
    Also, I’ve shared your site in my social networks!

  6. Thanks indeed. In the upcoming months, I am focusing on Office 365 and Azure topics.

  7. Richard says:

    I’ve followed your description and I receive the following error: ‘SBS2011’ was faulted because the guest executed an intercepting instruction not supported by Hyper-V instruction emulation. If the problem persists, contact Product Support. (Virtual machine ID EC4BC34B-470E-4284-89D7-05B3C6238DF4). Any ideas what i am doing wrong?

    Thanks for your help.

  8. That error message was so clear! Grrr.

    I have not encountered it before, but what comes to mind is how your BIOS settings might not be right for Hyper-v. The exact BIOS settings are determined by your flavor of BIOS, but you want to enable Intel Hyper-Threading, Virtualization Technology, and VT-d (extracting from Lenovo settings e.g.) but may be more general. Also make sure you have updated to the most recent BIOS version.

    At what point do you get this error? If it happens when you try to create a new virtual machine and point to the disk image you created from the physical drive, I am less likely to suspect the BIOS. Still check the version and the settings.

    I wanted to remind you to have included the system partition along with the data partition in the conversion.

    LMK what you uncover.

  9. Ken Stranger says:

    Reading this with interest and attempting a similar conversion myself for a customer site.
    Couple of queries
    1. My use of D2V returns multiple VHD’s for the disks I convert and not just a single VHD and I am not sure this is the needed result.
    2. I am not sure this works if the original physical disk you are converting is dynamic – as in a software mirrored drive ??

  10. Your physical disk may have several partitions and that might be what is confusing to you. Having said that the reminder is to convert BOTH the data partition and the reserved or boot partition on your system drive otherwise the resulting VHD will not boot. If you had other partitions, you can separately convert those to VHD files as well and mount them to your virtual machine. That would mimic the physical environment. Yes, I have converted dynamic disks and RAID 1 disks with no issues.

  11. Ken Stranger says:

    Just to update on this – it was important to break the mirrors on software RAID before doing the conversion – after that I got the results I needed. If you don’t break the mirrors you get a second VHD (point 1. of my query) which I assume becomes a dynamic VHD for the drives to mirror up again – I did not follow that through to find out as it was not the result I wanted.
    What now remains is to finally convert them back to fixed sizes and get everything back to the way I want it now in a virtual environment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s