Friday, 15 October 2010

Configuring Portable Ubuntu

I have installed Portable Ubuntu under Windows XP and have been configuring it to run some experiments.

Portable Ubuntu is conceptually like running Ubuntu in a virtual machine, except that the Windows all feel like native Windows windows.

Actually getting it working properly involves a bit of tweaking. Here is a summary of what I have done.

First of all, the default install button on SourceForge doesn't actually point to the full install. You can get it from the folder labeled TRES.

To run, just invoke pubuntu.exe. Start up takes a while -- actually as long as a normal boot sequence. To see the boot messages, single click on the Portable Ubuntu icon in the system tray.

The very first thing I would recommend is to disable the Ubuntu screen saver, otherwise your windows will lock up after a period of inactivity and there's no way to unlock them. You can disable the screen saver in System/Preferences/Screen Saver in the GUI.

Portable Ubuntu comes with Open Office. I am running experiments and have no interest in word processing applications. I saved 366MB disk space by removing Open Office:

sudo apt-get remove openoffice*

The default root password is 123456.

To give Ubuntu access to your drive c:, you need to edit a file in your Windows file system. Go the directory where pubuntu.exe lives, and edit the file config\portable_ubuntu.conf. Add the following line:

shared_folder0=c:\

While you're in that file, you might want to increase the amount of RAM allocated to Linux too. You have to restart your Portable Ubuntu session for these changes to take effect.

On start-up your drive C: should be mounted and available as /media/cofs2.

To enable DNS resolution, inside your Portable Ubuntu session, edit the file /etc/dhcp3/dhclient.conf to specify the DNS servers to use. To use the Open DNS servers, add the following line before the request line.

prepend domain-name-servers 208.67.222.222,208.67.220.220;

On start up I often get an error about not being able to mount the Linux partition. There's extensive discussion and some good solutions on this Ubuntu forum. People offer various partial solutions like dropping into an emergency console during boot up and typing:

mount -o remount /
Then Ctrl-D to exit the emergency console

But these mask the underlying issue: one of the start up scripts has inserted a line containing -e into the /etc/fstab file, which causes mounting of volumes to fail.

I finally resolved this. Portable Ubuntu copies aside your /etc/fstab file and makes its own during startup. Inside Portable Ubuntu you can edit the version it copied aside. It's called /etc/fstab.pubuntu.bak. Remove the line that says -e. Shut down Portable Ubuntu. This will copy back fstab.pubuntu.bak to fstab. Restart pubuntu.exe. Problem solved.