Monday, October 18, 2010

Windows 7 and Virtual Server

With Windows 7 now at RTM and in my hands, the time has come to start to migrate over. I got the ISO images I needed last week, and immediately started to get things running. One specific thing I needed is to get Virtual Server running on Win 7. I am teaching a class on Aug 13/14 and need to prepare – the class is a Windows 7 upgrade class for Microsoft Partners.
I thought, given we’d achieved RTM, that it would be cool to have the Labs running under Windows 7 RTM. To do that, I just needed to get Virtual Server running and install the course files on my laptop. Now I know it’s not officially supported, but I wanted to see if I could make it work. If so, I can then run and demo the labs with Win7 as the host.
There were only two problems with that. The first is that the labs that come from Microsoft Learning require Virtual Server. But Virtual Server is not supported under Win 7, and is actively blocked. And even if I did get VS running, MSL assume that you will be using earlier OSs to run the labs – and installing these on Windows 7 is specifically blocked by the MSI installer.


After a bit of Googling using my favourite search engine and perusing the MCT private newsgroups, it appears that there are two solutions. However, both involve some hacking (and are probably NOT supported).  The solutions were either to get the labs working under Virtual PC 7, or install VS into Win7 and get it running. While both are possible, I chose to do the latter since this seemed to provide an easier to use solution (if it worked of course!!!).
Naturally, a third (and preferable!) option would be to wait for Microsoft Learning to come up with a supported solution. But that is not likely to happen any time soon and I have a course to teach now. So down the road I went with two main tasks: first, installing Virtual Server on Windows 7 and then installing the Microsoft Learning labs on Windows 7.
Installing Virtual Server under Windows 7
To install Virtual Server under Windows 7 is straightforward, although it involved registry editing (and is NOT supported). The steps are as follows:
  1. Disable the application compatibility fixes. You first need to disable all the application compatibility fixes that would stop you from installing Virtual Server. In Windows 7, bring up the local Group Policy editor and Computer Configuration\Administrative Templates\Windows Components\Application Compatibility\ and enable all of the “Turn off” entries. As here;image
  2. Then go to the Computer Configuration\Administrative Templates\System\Troubleshooting and Diagnostics\Application Compatibility Diagnostics\ folder and disable all of the entries there. Like here:
    image
  3. Reboot to ensure the settings take effect. You could, I suppose, just do a gpupdate /force, but I prefer to reboot.
  4. Install Virtual Server. Download the binaries from Microsoft .com and install it.
  5. Install VS SP1 – depending on what download you get, you may may need to install SP1. NB: Installing SP1 is more difficult once you have completed this process, so why not do it now?
  6. Change Application File Name. To enable the next step to work properly, you need to rename the Virtual Server application file name, by going to the Virtual Server directory (typically C:\Program Files\Microsoft Virtual Server\ ) and rename Vssrvc.Exe – I used Vssrvc_Win7.exe.
  7. Change the registry settings for this new file name.  Run regedit, then find and replace all occurrences of "vssrvc.exe" to vssrvc_Win7.exe. There are around 5 or 6 entries to fix.
  8. Undo the group policy changes you made at step 1 above. This turns all those application compatibility fixes back on (which is probably what you want!).
  9. Reboot.
Once the reboot is completed, you should have (the renamed) Virtual Server running on your Windows 7 box. If you want to just run VMs, off you go. you can create and use VS just as you did on XP or Server 2003. Hoevere, if you want to install a MSL Lab onto the system, you have just a bit more work (hacking) to do.
Install course files for Lab Launcher into Win7
Once you have Virtual Server running, you need to fix the installation file for the lab you want to install, e.g. 6291.MSI. Normally, you just run this MSI file on your master system (and use Ghost et al to then blast it to the rest of the systems in the classroom). The only problem with this approach is that Microsoft Learning have put in an installation block on Win7. That means when you try to run the installation MSI, it fails with an error message (”the operating system version does not meet the minimum version required”). Turns out this is really easy to fix – but you do need an MSI editor.
There are two MSI editors you can use (and both are free):
  • ORCA – this is a free MSI editor from Microsoft and comes as part of the Windows Installer SDK. It’s a bit of a pain to get as you first have to download and install the SDK, and then install Orca.Msi. You can find copies of orca.msi out on the internet, but downloading it from Microsoft is probably safest even if it is a bit tedious.
  • InstEd - you can also use InstEd, a free tool you can get at http://www.instedit.com/. I like Instead and blogged about it a while ago. It’s still cool!
Once you your MSI editor loaded, you need to remove one line from the Launch Condition table. If you are using Orca, you’ll see something like this:
image
Just delete the first line of this table, then save the MSI (File/Save As) to a separate MSI (just in case). Then exit out of Orca and you can run your newly saved MSI. You should be good to go.
Minor issues
I found that, after playing around a bit, Virtual Server was complaining about access permissions of VHDs on the host. I just gave all users full access to the C: on the host and the problem went away.
An important issue to consider is that this is not supported. Yes, it works and works reasonably well. It also involved editing registry entries, and using a MSI editor. From personal esperience, both can be dangerous. So use this information at your own risk.