The Big Picture

Tools

Ubuntu Intrepid 8.10 Quickstart

This article is a quick rundown of everything that I needed to do, before I became reasonably productive, after a reinstall of Ubuntu. A recent virus attack on my Windows desktop left me fuming - the loss of productivity for two days and the amount of damage done, was enough to propel me back to my Linux desktop.

I got the time and opportunity recently to get my desktop set for its second-innings with Linux. This page serves as a holder for all that I learned in the process and to prevent me from trying to relearn all of this, if I have to do this again. Hopefully, it’ll help anyone else trying to go through the same process.
My wife likes to work on Windows, so it has been my primary OS at home, so far. I didn’t want another outage due to a virus attack, so I decided to install Windows under VMWare for her, while I have some peace of mind with Linux on my desktop. I had the following goals for my new setup:

Dual-boot between Ubuntu and Windows XP from my first hard-disk

Find suitable Ubuntu replacements for all the goodies I have been using in Windows

I am going to gloss over details in most of the steps below, because this post is not really meant to explain the why or how of things. However, in case someone wants details, I have provided links covering the same in-depth. I have leveraged a lot of work done by other people and my gratitude goes out to them for their time and effort.

My planned dual-boot setup looks like this:

So here’s a quick walkthrough of steps needed to reach the above goals:

Install Windows XP first

No brainer. This is an insurance against something not working in the VMWare Windows XP guest OS. I create an extra common partition for use by both Windows/Ubuntu. In previous configurations its been FAT32 since both Linux and Windows could write to it easily, but this time I created it as NTFS, since Ubuntu has read-write support for NTFS partitions now and it seems to be working fine for some time now. Yeah, I am feeling adventurous! But just in case, I won’t be using the partition for any mission-critical stuff, that I can’t afford to lose. If something goes wrong, this partition is going back to being FAT32.

Install Ubuntu Intrepid 8.10

I created a big /var partition so that I can put my virtual machines in that partition. I also want to play with sharing virtual machines between Windows and Linux host OS. Such virtual machines would be copies of guest VMs in /var/vmware and kept in the common partition.

Update packages in Ubuntu 8.10

The update manager in Ubuntu will be prompting you for updates by now, which may run into hundreds of Mbs. We can start the updates and leave them running overnight. Or you could complete the steps below and update later. As long as updates are being downloaded, you won’t be able to install anything else.

Update: On a Ubuntu 8.10 system which is fresh and hasn’t been updated you may not be able to install Samba, because of some packaging errors, so you may want to complete any updates first, before going ahead.

Install applications in Ubuntu 8.10

The next step is to install all needed applications, replacements for what you use in Windows etc. Before doing this just add Google’s repositories to your system. Here you go:

Download and install VMWare Server 2.0 for Linux

There are several flavors of VMWare, VMWare Server being the free one for both Windows and Linux. Download the server from here. Install it as described here. You may run into a problem when configuring VMware server 2.0.1 in Ubuntu 8.10. It tries to build the VSOCK module and load it in the kernel, but fails. This can be solved by patching the vmware-config.pl file with a patch provided by an enterprising user. Download it here.Before the patch:

...
...
Unable to make a vsock module that can be loaded in the running kernel:
insmod: error inserting '/tmp/vmware-config0/vsock.o': -1 Unknown symbol in module
There is probably a slight difference in the kernel configuration between the
set of C header files you specified and your running kernel. You may want to
rebuild a kernel based on that directory, or specify another directory.
_
The VM communication interface socket family is used in conjunction with the VM
communication interface to provide a new communication path among guests and
host. The rest of this software provided by VMware Server is designed to work
independently of this feature. If you wish to have the VSOCK feature you can
install the driver by running vmware-config.pl again after making sure that
gcc, binutils, make and the kernel sources for your running kernel are
installed on your machine. These packages are available on your distribution's
installation CD.
[ Press the Enter key to continue.]

Disable KVM

VMWare Server won’t be able to execute your guest OS until you unload/turn-off the built-in KVM virtualization engine in the Linux kernel. Do this:

> sudo rmmod kvm_intel
> sudo rmmod kvm
> sudo chkconfig -e kvm

chkconfig will open an editor. Just replace on with off.

Install Windows XP as guest OS

Access VMWare Server using your web-browser at this link: http://localhost:8222. Add a datastore. I use /var/vmware (that’s the reason behind /var partition being so big). Create a virtual machine and install the guest OS. Windows XP in VMWare server 2.0.1 can only run on IDE disks. I am not sure if you’d face this problem during a fresh install, but I faced this when migrating a Windows XP guest VM to Ubuntu, which was created in Windows XP itself as host OS on a virtual SCSI disk. So I had to use Acronis TrueImage first, to clone the virtual SCSI disk to a new virtual IDE drive within the guest VM and then migrate it to Linux host. Some users tried out Norton Ghost for the same but reported having problems with it (although I have seen others using it successfully, with some hoops and twists).

Next, add a new disk to your virtual machine. Start the Windows XP guest OS and format this new drive. Then turn on file sharing and give read-write access to this particular drive. I like to give the host read-write access to the guest’s drive, so that its easy to transfer data between the host and guest using this shared drive. Also the guest stores all data on this drive. The advantage of a separate drive for your data is that this disk can easily be moved to another VM, in case your current VM goes kaput.

Access the shared folders in guest VMs from Places > Network. You could setup this folder to be mounted easily by tweaking instructions provided here. You can also create a shortcut for your guest OS from VMWare server browser console, for easy access.

Install the VMWare tools in the Windows XP guest OS from the VMWare browser console. You’d need these for seamless integration of the guest OS with the host. These tools make life a lot easier, when dealing with display settings, mouse cursor etc.

Update: The key mappings for some of the keys in your guest Windows XP OS may be wrong at this time. Some keys such as the Del, Arrow keys etc. might not work for you in the guest OS. To fix this problem add the following line to your /etc/vmware/config file. This fixed the problem for me. For more details, see this thread.

xkeymap.nokeycodeMap = true

Set up VMWare networking

You might want to read this first. You’d want to configure your guest OS to use NAT VMWare networking option in order to let it access the Internet, as well as communicate with the host OS. VMWare will use the vmnet8 interface for this purpose. Find out the subnet configured by default on the vmnet8 interface, by VMWare server. On my machine this is 192.168.4.0. The default gateway and the DNS server for your guest OS in that case is 192.168.4.2. You can use DHCP within your guest OS to configure its network and VMWare’s DHCP server will automatically assign IP addresses to your guest VMs. I use static addresses though, which allows me to set up permissions easily using IP addresses in various other configuration files such as Samba etc.

We could now install other operating systems and test them out too. One of the things that I have been planning to do is to give direct access to rest of the 3 physical disks to a NAS distribution such as OpenFiler, FreeNAS etc and see which one can I use for managing my disks under RAID protection. But more on that in some later post. For now our setup should begin to look like this:

Download and install other apps

Set up your fonts

Configure your UPS

I have an APC Back UPS RS 800 (as written on front-panel), which the driver identifies as Back UPS BR 800. I tried installing NUT for monitoring my UPS but it did not work. Finally after much mucking around, I found apcupsd which was able to monitor my UPS and shutdown/hibernate it when the power goes off. A detailed guide on configuring it is present here. You can find a shorter one here. The program gapcmon is a great way to keep a tab on the UPS including past history. My /etc/apcupsd/apcupsd.conf file is as shown below and that is followed by some troubleshooting tips.

You might want to reboot once, if it does not start the first time. That should start the hald-addon-hid-ups process, which is necessary for apcupsd to monitor the UPS.

Since a lot of us don’t have the luxury of continuous power, unlike the developed world, we’d want to shutdown/hibernate the machine when the power goes off. I prefer hibernation, instead of shutting it down, because any virtual machines running don’t have to be shut down as well when the power goes off. Apart from that, when the power returns, we get the luxury of having our desktop back with any virtual machines running in the exact pristine state, as they were. Also we could configure the BIOS to power ON the machine automatically when the power returns (if your BIOS has that option). Just follow these ArchLinux instructions to configure UPS triggered hibernation. These worked for me on Ubuntu 8.10 as well.

Configure your apps

For me this involves downloading the configuration files such as .vimrc, .bashrc etc. that I maintain in a subversion repository online. Other things that we’d like to do at this point is adding icons of most frequently accessed apps to the panel, add any useful applets (especially the hardware temperature monitoring applet - it saved my graphics card once, which I found running at more than 85 degrees), etc. Another thing I like to do is to turn on Compiz from System > Preferences > Appearance > Visual Effects. Then I fire up System > Preferences > CompizConfig Settings Manager and turn on Blur Windows, Window Previews. Also to turn on Nautilus’s subversion integration scripts run this command:

> nautilus-script-manager enable Subversion

Update: The vpnc client for Ubuntu 8.10 keeps on dropping connections frequently. To fix this, add the following line to the file /etc/vpnc/default.conf file:

DPD idle timeout (our side) 0

Setup screen rotation

When working with source code, I like to rotate my screen by 90 degrees, so that I can see more of the source code on my Dell monitor in one go. My Nvidia GeForce 8800 GTS card allows me to rotate the screen in Ubuntu. Its a shame that this support does not come built into Ubuntu’s display preferences dialog box - yeah, it says it can rotate the display, but won’t. To add this support, edit /etc/X11/xorg.conf file and add this line to the Screen: section:

Now that you have installed all the basic apps you’d want to backup your Windows XP VM so that you don’t need to repeat the Windows XP installation ever. Copy the contents of the directory containing your virtual machines. Compress this copy and keep it safe somewhere - I am sure you’ll need it someday, Windows being what it is!

Configure Samba in Ubuntu Intrepid 8.10

To share files in the Ubuntu host with the Windows XP guest you’d want to setup Samba in Ubuntu such that it shares the data folders with the guest. A typical Samba setup is described here. If you need a simpler no frills setup, find it here. The first link worked for me within a couple of minutes.

Phew! That was a long task list. If you want to find out more about some other stuff you could tweak, take a look at thesepages as well. Well, this page maybe already outdated (Ubuntu 9.04 just got released, but hopefully I am not off by a huge margin, when I make a jump to the next release of Ubuntu). For now I am not going to the next Ubuntu distribution unless there’s a really compelling reason to do so.

The maximum amount of time I spent in Ubuntu was in setting up the UPS and troubleshooting the installation of VMWare server in Ubuntu. That stuff just works in Windows. Add a bunch of utilities on top of that and you are ready to go! I wish it was the same with Ubuntu…