Using Spaces to Work Around VMWare Fusion’s Limitations

It appears that when running Windows as a virtual machine in VMWare Fusion, (I’m using version 3.0.1), any windows programs that I am running with elevated permissions, (“run as administrator”), don’t appear in the OS X dock with Fusion in unity mode. What’s more, if I can see a portion of the window and I click it, it doesn’t come to the foreground.

My workaround for this, which worked very well, was to run Fusion in fullscreen mode in another Space. Then I was able to do my OS X testing in one space, flip to Windows to make changes very easily, (The default to move between spaces is ctrl + (arrow key), but I changed it to cmd + (arrow key) and it is much easier for me), and keep my E-mail & stuff open in a third space.

If you don’t have spaces active, in OS X 10.6 they’re in System Preferences > Exposé & Spaces > Spaces then just check the box that says “Enable Spaces” and adjust your shortcuts at the bottom of the window, if desired.

Test ASP.NET apps on your Mac with VMWare Fusion & DD-WRT

Today I needed to test and fix mac-specific bugs in a website that is written in ASP.NET, but I generally use a Mac. When I work on the ASP.NET site I boot into Vista using Boot Camp, and the rest of the time I spend happily in OS X. I needed a solution to run both at the same time, and on the same computer, (this is the only mac I have, but my development environment for the .NET site is on my Boot Camp partition). It was time to see if Virtualization has gotten any better. It has.

There are two reasons that virtualization is better: VMWare Fusion 3.0 was released, and I doubled up my RAM, (now at 4GB). With these two changes, and Aero turned off on the Windows side, Vista runs ok under VMWare Fusion on my ageing Macbook Pro. Now to see changes made in Vista from OS X.

The simplest way I found to make this happen was to use some of the DHCP features DD-WRT on my router to assign a static IP address to my virtual machine and to map a URL to that IP. I’ll do this in steps:

  1. Before starting your VM in VMWare, go to the settings for the VM > Network and choose “Bridged” then open the advanced section and click the button to generate a MAC address. Copy the generated MAC address.
  2. To to Services > Services in your DD-WRT web interface and in the DHCP Server box assign a static IP to the Mac address you just copied
  3. In the DNSMasq box enter the following:address=/the-url-you-want-to-map-to-the-vm/THE.IP.YOU.JUST.SET entering, of course, the real values.
  4. Hit Apply and Save at the bottom of the page
  5. Start up your VM
  6. Make sure that Windows Firewall is set up to let HTTP connections through
  7. Type the URL you created in your browser in OS X and you should get the web page served by Windows
  8. Now, there should be a way to make this work without the router, using NAT network mode for the VM and some hosts file edits in OS X. I’m going to try to figure out how, but for now I just need to get some bugs fixed in the .NET app. If anyone has any ideas how to make this happen without involving a router let me know, (or blog about it and leave a note in the comments).

Using Microsoft’s VPC Images with VMWare Fusion

We all know the sinking feeling when we have to test a website in Internet Explorer. You built the site, it looks beautiful in Firefox and maybe Safari too, but now you have to open up Internet Explorer 6, 7, and 8, and make sure it plays nice with all three of them. Even better, Microsoft has made it so that you can only have one version of IE installed on a computer at a time. True, you can use things like Multiple IEs or other similar products, but they never play quite right.

Fortunately, Microsoft has supplied us with Virtual PC images of Windows with Internet Explorer installed. Unfortunately, Virtual PC is a Windows-only program so you need a PC to run them on. Or do you?

You don’t! If you’re using OS X you can use VMWare Fusion to run those Microsoft VPC images, after a little tweaking. It is much easier if you have a copy of Windows available to you during the install process, (that’s how I did it), but I don’t believe this is an absolute necessity. Here’s how it works:

Basically, you need to download the VPC images, extract them, and convert them into VMWare Fusion virtual machines. It sounds trickier than it is.

First, download and extract the VPC images. If you can use Windows to do this it’s easy, (the images have self-extractors), if not try p7zip, (see instructions in this forum thread).

[edit: July 15, 2009]: Then, somehow, you have to convert your VHD files into VMC files. The easiest way to do this is to use Microsoft’s VPC to make a new virtual machine from the VHD files, but you do need windows to do that. You will be converting these .VMC files into VMWare native virtual machines.
[/edit]

To convert the VPC images to something else, use VMWare vCenter Converter. It’s a stand-alone program for Windows or Linux that easily converts VPC images to VMWare Fusion virtual machines, as well as several other formats. You can even choose between Fusion 1.x and Fusion 2.x. It will even install the VMWare tools pagkage for you. I did the conversion under Windows, but there’s probably a way to get the linux version to run under OS X, at least hopefully.

Once the conversion is complete, fire up OS X & VMWare Fusion and open your new Virtual PC image. There are some things that run on the first startup of each machine, give it a few minutes then hit cancel on all of the “Please insert the XP SP3 CD” messages that remain, it doesn’t seem to hurt Windows. I think it’s looking for a battery driver in my case, (maybe I should try to install the Bootcamp battery driver?).

That’s it, enjoy testing. I am able to run, slowly, all 3 IE versions with the Windows XP images, and my computer isn’t as slow as when I run only my Bootcamp Vista install under VMWare Fusion. I’m thrilled to have these 3 new debugging tools at my disposal.