Tuesday 27 January 2009

Integrating Windows XP and Ubuntu Linux

There are not many things that you can not do on Linux that you could on Windows, but there are a few, in particular there are some software packages that I can not manage to get running under Linux using Wine. These are:
  1. Microsoft Office (I know OpenOffice is a good alternative, but it is different to Excel and Word that I use all the time at Work, and switching is difficult. This is especially a problem for the rest of the family that are not as used to switching between operating systems as I am).
  2. Family Tree Maker (My Mam is used to this program, and the Open Source equivalent (can't remember its name) just wasn't as good as far as she is concerned.
  3. Microsoft Home Publishing (My daughter uses this to make cards etc. Although you can use Inkscape or Scribus to do the same under linux, it is not as simple - maybe someone else knows an Open Source equivalent?).
When I heard about VirtualBox I thought it was too good to be true - you are supposed to be able to run Ubuntu Linux as your main system (Host), but run Windows XP as a 'Guest' in an emulator - as far as Windows is concerned it is running on its own stand-alone machine, but VirtualBox is emulating a real computer in software. This sounds like an awful job to do, and I expected everything to grind very slowly, but as my computers now have lots of memory (2GB and 4GB for my Laptop and the Kids desktop respectively), I thought it might be possible.

Installing virtualbox in Ubuntu is easy:
sudo apt-get install virtualbox-ose
Note that Ubuntu has another package "vboxgtk" which is an alternative front end to virtualbox. I struggled this - the windows installer crashed when you used the keyboard, so I just stuck to the normal virtualbox program.

You then start it by running virtualbox as a normal user. You then create a new virtual hard disk on which to install windows, which is actually a normal file in your home directory.

You create a new 'virtual machine' by associating the virtual hard disk with it, and giving it access to your host system cdrom. I put the Windows CD in the host computer CD drive, and selected 'run' to start the new virtual machine. It booted off the CD and windows installed in the new virtual hard disk.

Then the problems started. The main one was that when I tried to boot windows off the new virtual hard disk it hung when it loaded a module called agp440.sys. This was odd because it was the recovery disk for the version of WIndows XP that runs nicely on the real computer. It turned out that the problem was that the recovery disk assumes the hardware configuration for the computer - in particular the graphics card (AGP), and the VirtualBox virtual computer has a different graphics card, which caused the crash. I could not work out how to get around this, but I found another Windows XP CD, and this did a normal windows installation, where it picked the drivers for the particular hardware concerned. This then booted nicely and you get a window, which contains the WinXP desktop.

Using windows was a bit of a pain in this configuration - the desktop was very small, so it was difficult to fit application windows on it. Also windows kept grabbing the mouse and keyboard, and you have to press a secret key (the right Ctrl key) to release it back to the host operating system.

When I read a bit more about VirtualBox I found that it should work 'seamlessly' so you do not have a separate windows desktop - the Windows XP windows sit on the same desktop as the Ubunto Gnome ones. To do this you have to use the web browser in Ubuntu (the host operating system) to download the guest additions package as an iso disk image, and put it in /usr/share/virtualbox with the filename "VBoxGuestAdditions.iso". You can then install the guest additions package using the menu at the top of the windows desktop window.
Once you have installed the Guest Additions package you can set the system into seamless mode using a menu, or pressing -L. This gives you a windows start menu bar at the bottom of the screen, in addition to the usual Ubuntu ones.

There are menu options to give the guest operating system internet access - selecting the 'NAT' option seems to work, and to give it audio access (I selected the 'ALSA' option, which seems OK.

You can share files between the guest operating system and the host one by selecting a 'shared folder' on the host system - this appears as a network share in Windows.

Things appear to work now - MS Office installs and runs. Haven't tried other things yet, and need to work out how printing works, but it looks very promising.

3 comments:

stuaxo said...

The open source family program is Gramps

stuaxo said...

you can try wine for windows programs, it's not as heavy as virtualbox and integration is sometimes better... not as many things work yet though.

Graham Jones said...

Thank you for your comments - I did try wine first, but couldn't get it to work with Family Tree Maker. Gramps works ok, but 'the boss' didn't like it as much as Family Tree Maker....