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.

Sunday 25 January 2009

MusicPal USB Socket

Other people have reported that it is easy to add a USB socket to the MusicPal. As its internal memory is very limited I think this will be useful for software development, so decided to give it a try.
Sure enough, you can open the case easily by removing three screws and pulling the knobs off the front panel. There are clips on the right hand side of the front panel, so you have to start to open the case from the left (speaker) side and pull the front panel to the left a bit to release the clips. I think it would have been possible to remove the front panel without removing the warranty seal on the screws behind the speaker - just removing the middle screw is probably enough to get the front panel off.
I bought a USB socket from RS Components and it soldered easily onto the circuit board, then just had to cut the back panel blank out and it went together nicely. Now if you plug a USB memory stick into it, an extra menu item appears on the Freecom Nashville application menu, and you can play music off it. I haven't tried to disable writing to the memory stick as they did here because I think I will want to write to it from the musicpal. We'll see....
Haven't tried running software off it yet though.

Monday 19 January 2009

Nearly Broke It

I'm trying to get back into fiddling with the MusicPal internet radio after I got distracted by a few other things instead over Christmas.
The first thing I noticed was that I had broken the manufacturers' software - it appeared to boot up ok, and I could play files of my server, but internet radio didn't work, and neither did the clock on the device.
I tried fiddling around with the settings via the MusicPal's menu, but couldn't find anything wrong.
It turned out that I had filled up the filesystem on the device, so it did not have enough storage space to create /etc/resolve.conf or similar, so the internet DNS resolution did not work. Once I deleted my experimental files, it all started to work again....

This got me thinking that to do any serious development on this, I will need more storage space - deleting the manufacturers' software altogether is a bit of a big step given the rate I work on these things. The simplest would be to persuade it to boot over the network, just like the MediaMVP - this means I can easily change the root filesystem image, and if it doesn't work it is trivial to put hte original back. The trouble with this is that I will have to update the uboot configuration - this would be easy if I had a serial console for the device, but I don't. I think there is a real possibility of turning it into a brick if I get this wrong.....
The less intrusive alternative would be to compile a kernel with NFS support and have it nfs mount a filesystem with my software on it. This is less drastic, but I will have to make sure I can do the emergency re-flash of the firmware in case I mess it up. A job for later.
The simplest would be to put my files on a USB memory stick and use that - people seem to have added USB support to the musicpal quite easily, so I had a look inside. Sure enough, there is space for a solder connection USB socket, and a punch out panel in the back of the case. I think I will get a USB socket and try this first to see how it goes - I can't find one in anything I can dismantle at the moment, so will have to buy one.