Monday, October 31, 2011

Using Microsoft Virtual Server Images in Microsoft Hyper-V

these pains...

Hi everybody,

sorry for neglecting this site for so long. Just experienced some new Microsoft stuff I'd like to share. Maybe some of you can use it.

So what's this about? I have moved to a new server running Windows Server 2008 R2, replacing my old Windows Server 2003 installation. Need some virtual images running on the server all the time, e.g. one to build old legacy products, and a few more to test these products on different platforms. The development actually takes place on Windows 2000 Professional with Visual Basic 6.0. Gulp... yeah, like it or not but the product is still selling! And I need a platform as old as possible to ensure that the compiled stuff still works on client platforms that are not, like, recent. So there is no way around a machine of some sort running that decade-old development environment.

While I ran Microsoft Virtual Server 2005 R2 on the Windows Server 2003, I think it makes more sense nowadays to use Hyper-V whenever possible as it offers a much better performance and integration.
As the new server is based on an AMD Phenom X4 processor, virtualization is no problem.
But one problem was there, I tried to cheat for days now and finally found the solution.

If you install a virtual machine, it is basically running on built-in drivers that the operating system offers. Hardware such as video graphics adapters and network interfaces are emulated by the host environment and appropriate drivers must be installed if you want to use network resources or a resolution better than 640x480 at 16 colors.
The Virtual Machine Integrations package that installs the drivers in the guest system is usually a CD ISO image that is simply mounted during the guest OS runtime and runs a setup to install drivers and modify the hardware abstraction layer (HAL).
The problem is, if you forget to uninstall this integration setup before using the virtual hard disk image with a different virtualization environment, you'll probably face a lot of issues, just as I did.
Trying to run the Windows 2000 image on Hyper-V caused the virtual computer to crash with a BSOD (blue screen of death) because something goes wrong in ntoskrnl. Very probably due to the HAL no longer matching the system that is now emulated by Hyper-V and that is definitely different from the one that Microsoft Virtual Server 2005 created.

Hyper-V brings its own packace of integration services that need to be installed again to enable video beyond the VGAsave driver and network access at all.
No problem, I thought, launched the Win2000 installation in safe mode, and inserted the VM Guest Additions ISO for Hyper-V. No go:

Translated to English: prior to installing Hyper-V integration services, you need to remove all previous installations of Virtual Machine Additions for Virtual PC or Virtual Server. Uninstall Virtual Machine Additions in the "Programs" applet in the control panel and try again.

Oh yeah, the new integration services setup recognizes the one previously installed for Virtual Server 2005, and refuses to easily replace it.

Well, still appeared easy to me. I tried to follow the recommendation and launched the "Programs" applet, finding that uninstalling the package would not work because the Windows Installer Service is not active during safe mode. Oh my. That means I cannot start the system in normal mode because it would crash on bootup, and cannot use safe mode because it won't let me install or uninstall anything. If only there was a way to uninstall these darn old integration services!
At this point, there is a "clean" way out: install Virtual Server 2005 again to provide the same environment to the virtual machine as it had when it last ran on the old server. But I wanted to avoid this because the Hyper-V role was already active at that time, and I guessed that installing multiple virtualization systems on the same Windows instance could cause a whole lot of more trouble.

After some days of rest, I have come back to this mess today after one idea hit me. If the virtual computer fails during the bootup phase because some of the integration services components are not compatible with the new Hyper-V world, why not deactivate or remove them? That should be possible even in safe mode. The system could not become more broken than it already was, so I decided to give it a try.

Service references are stored in the registry beneath this key:


I found some keys here looking like they belonged to the Virtual Machine Additions package (added the descriptive text found beneath each key for a better explanation):

  • 1-driver-vmsrvc: Virtual Machine Additions Services Driver
  • 1-vmsrvc: Virtual Machine Additions Service Application
  • msvmmouf: Virtual Machine Additions Mouse Integration Filter Driver
  • VPCMap: Virtual Machine Additions Shared Folder Service
  • vpc-s3: Video, probably the emulated S3 video driver

My plan was this:

  • boot the Windows 2000 image in safe mode (plus networking because domain validation was required in my case)
  • remove the registry keys related to integration services
  • restart the Windows 2000 in normal mode to uninstall the old integration services
  • restart again and install the new integration services
  • restart eventually to see if the new integration services are working properly

I went through this list of actions and, bingo!, it worked as planned! :o)
...worked for me at least - let me give you some advice:

  • the best thing to do is create at least one backup of the virtual image (VHD file) before you start any of this. Making backups of VHD files is really easy so one should take that time.
  • this registry hack is not really safe. Making any mistake could screw up the system badly and leave it dead forever. Use extreme caution.
  • let the system reboot every time it wants to. If integration services were uninstalled, the HAL was probably modified, too, plus there may be delayed delete operations that are executed only when the system is restarted. To make sure that the system works in the state it is in, reboot. Do not run the next setup right away
  • in the guest OS, Windows will announce new hardware found from time to time. Do not follow the installation process here but cancel it once it appears. The Virtual Machine Additions package for Hyper-V will install everything so there is no need to install anything manually
  • my virtual image is a domain member so it requires a proper logon and a network connection to verify the credentials against the domain controller. I neded to use "safe mode plus networking" to achieve that. Otherwise, you won't have a way to pick the domain against which to verify the password, leaving you with a system that you cannot log on to (unless you know an alternative,e.g. the Administrator account).

Please do not hold me responsible if your attempts fail. You are doing this on your own risk!
I'll be happy to help if I can, and even more happy to know if this helped any of you.

By the way, the same procedure may apply to VirtualBox images, but I have not tried so far. Integration Services mechanisms are pretty much the same there but I cannot give you the names of the services that Oracle installs in virtual guests.
If anybody is interested, I can investigate more deeply.

1 comment:

  1. Worked a treat. Thanks very much for the help!


Wenn du auf meinem Blog kommentierst, werden die von dir eingegebenen Formulardaten (und unter Umständen auch weitere personenbezogene Daten, wie z. B. deine IP-Adresse) an Google-Server übermittelt. Mehr Infos dazu findest du in meiner Datenschutzerklärung (Link einfügen) und in der Datenschutzerklärung von Google.