Jun 1, 2007

VMWare & Dual-Boot Ubuntu Feisty and Windows XP

A long title I know, but I had to do some serious google searches to get this to work, and it was thanks to other long titles that I found the info I needed. So let me start with the references:
  1. VMWare's document: Configuring a Dual-Boot Computer for Use with a Virtual Machine - good background info covering many (but not all) issues.
  2. Running VMWare on a Physical Partition by Scott Bronson is a really good howto-style article with most of the details you need to do the job step-by-step.
  3. How to install Vmware server From Canonical commercial repository in Ubuntu Feisty - that got me onto the easy install route
  4. HOWTO Configure a dual boot windows linux to be able to open each os in vmware - gentoo based article, but had an interesting suggestion for windows IDE drivers.
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.

My setup:
  • Dell Precision 370 with SATA drives, 2GB RAM, Dell 20" flatscreen (1600x1200)
  • Windows XP installed on C: (/dev/sda1)
  • Ubuntu Feisty (7.04) installed on /dev/sda3
Installation procedure:
  • 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:

Unknown said...

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

Izterica said...

Quick question...
How come your code says "CelloptController"?

Craig Taverner said...

Cellopt is the name of a product I worked on many years ago. Not a rails application, but I used the name for the test code I wrote for this post back in 2007.

Izterica said...

interesting... it looked more like the cellopt code had been "reused"