So, as the first vmware document says, this is not necessarily a very easy thing to do, getting the same OS installation to boot on both the real physical machine and the virtual machine. Most issues relate to the different drivers and configurations required, or to the multitude of boot problems. However, the documents above, and the second one in particular, covered most of what I needed. So if you have a similar setup to me, you should be able to get this working OK by following that second article, with a few small changes suggested below.

So why did I bother to write this article? Well, not one of the above articles was enough to cover my setup, and I did not find any real help (hints, but not explicit help) for some of the problems I had:

My SATA drives are seen by Ubuntu as SCSI drives, but by Windows as IDE drives, preventing windows from even booting in VMWare without installing the vmscsi drivers *before* booting windows!

Any change I made to the Ubuntu network configuration after setting up vmware completely broke the vmware installation (and made gnome runs super-slow). This seems to be a edgy-feisty problem, and a google search found the solution (add the hostname to 127.0.0.1 in /etc/hosts - simple!)

So, let me outline the basic approach I took to get windows running inside ubuntu. The reverse is possible, and covered in the above articles, but I focused on this approach only.

Install the OS's (I think it is best to install windows first, making the C: partition 50% of the space and leaving the rest for Ubuntu, but other routes usually work too).

Make sure dual boot works, disable the timeout in grub so you are always forced to choose the OS (for now) - see article 2 above.

Under linux:

Prepare the disk as in article 2 (see article 1 for more info)

Install vmware-server from the canonical commercial - see article 4 above, or just use: deb http://archive.canonical.com/ubuntu feisty-commercial main

Make a floppy with the windows SCSI drivers from VMWare (either write a floppy with dd, or mount the image and copy the files to the windows partition)

Under windows

Prepare windows as in article 2 above (again article 1 has more info)

Make sure you make the two hardware profiles, and reboot to the new virtual profile for any driver changes.

Also install the vmscsi drivers by running the 'add hardware' wizard of the control panel, and clicking 'no I have not connected the hardware yet' to get windows to allow you to install the scsi drivers even through it cannot see any scsi hardware.

Consider changing the IDE drive as in article 4, although I'm not sure that was really required

Back in Ubuntu create the virtual machine according to article 2 (and reference article 3 for Ubuntu specifics if you need).

I recommend choosing the entire disk, not the partitions, as this seems to help a lot with windows/linux/vmware different views of the partition table.

Start the virtual machine as in article 2 and install VMWare tools (which will re-install the scsi drivers, but we needed to do that before this just to get it to boot in the first place).

Prepare the GRUB bootdisk for user-free reboots according to article 2. This is great because you can (mostly), not worry about rebooting to the wrong OS, or having the same OS running on both the hardware and the vmware at the same time (which would be disastrous). There are no solution to having to choose the windows hardware profile, but if you are like me and normally run windows inside linux, then having the virtual profile first, with a timeout, is great because even if you do boot the virtual profile on the real hardware by mistake and mess it up, it is much less serious than messing up the physical machine profile, and you can simply re-create the virtual profile by repeating some of the steps above.

Finally, more info on the two problems I had:

The need to install the vmscsi drivers in the windows virtual profile, but with windows booted onto the physical machine, is covered in the discussion above.

The issue with slow-gnome and broken vmware-server is really strange and I do not know the inner reason, but adding the line '127.0.0.1 localhost hostname' to /etc/hosts (with 'hostname' changed to your host), magically solves it. I wonder if the problem is related to the mysterious '127.0.1.1' line in the hosts file?

And, last of all, here is the obligatory screenshot showing the ubuntu desktop, with gimp and a gnome game running above the VMWare server console with Windows XP running eclipse showing a Ruby on Rail application with InstantRails windows as well. I know it's weird to be doing ruby and rails development in Windows, but I just happened to get started there, and I like the fact that eclipse on XP has nice compact fonts by default.

4 comments:

I really like this guide, but the second link you provide seems to be dead. I found a backup by the author in the fourth post of this page: http://forums.debian.net/viewtopic.php?p=148047&highlight=&sid=a0f0d43cea051c447a779d49a408a43d