Friday, July 25, 2008

The saga of upgrading Breezy to Hardy (on VMWare)

It all started with me downloading UltimateLAMP, a pre-configured VMWare appliance image, to try out phpOpenChat. I did get the phpOpenChat to work (mostly) with some php script tinkering. Considering my limited knowledge on php, I'm relatively proud of myself. Even the virtual appliance hasn't been updated for almost 3 years, it still works pretty well. So I kinda thought, "why don't I make a good thing better?". My idea is to upgrade it to current software (it's based on Ubuntu Breezy) so I may even able to use it for testing some other things. Simple enough, right?

I didn't quite envision a walk in the park, but it did turn out to be close to an odyssey.

There's no direct path from Breezy to Hardy (the current Ubuntu, version 8.04 LTS). So I had to go to Dapper first (6.06 LTS). I replaced all breezy in apt source list with dapper. A "dist-upgrade" by apt-get got me to Dapper pretty easily (or I thought). But upon restart X no longer ran. Granted this is somewhat a server thing so I don't have to have X, but I just like to have a GUI to make some things easier. I went ahead to install update-manager and used it to upgrade to Hardy, thinking "I'll fix X once I'm there". It took some time to download and set up things. After a restart I found myself in an even worse shape. Hardy couldn't boot into normal mode - it would hang - so I had to drop into recovery. Then I had no network, and of course no X. To get the network to work, I realized I need to recompile vmware-tools, which contains the driver for the interface. But I couldn't: there's no gcc or make -the virtual appliance didn't include it. But without network I couldn't even download build-essential and headers. Damn! I don't want to have to make a CD-ROM...

So I grabbed the original Breezy vmdk and restarted the whole thing. This time I remembered to do snapshots along the way so it's easier to go back. I couldn't install build-essentials under Breezy, because the repository is no longer there. So I did it after getting to Dapper. For some odd reason, at presumeably Dapper level, it showed a Breezy kernel (guess either kernel image isn't there or GRUB wasn't done right). So I couldn't do "install linux-headers-`uname -r`"; instead I had to find the Dapper kernel version from another computer and used it to install the headers. With build-essential and headers I should be able to compile stuff once I'm fully upgraded. When I reached Hardy, things seemed to look better. I even had X running fine, minus mouse, which forced me to learn how to navigate Nautilus with keyboard. I thought instead of recompiling the old vmware-tools, I would just upgrade to the current vmware-tools (Workstation 6). Well, it's also because old vmware-tools reported a wrong kernel version - what the heck is @@VMWARE-release@@ - so it refused to recompile. Mounting the tools iso turned out to be a mini journey too. For some reason it didn't want to work if I make CD-ROM IDE in VM settings (missing ata driver?).

Now I got tools upgraded. Deep breath, restart. Bam! No gdm again. Still no network. WTF? It turned out that the gdm problem is just a missing symlink (/usr/bin/X11/X). But where is my network card? I updated modules.conf to reflect the correct driver, vmxnet (it was using vmnic). I could see vmxnet module loaded. But ifup kept saying "No such device". I remembered the annoying /etc/iftab Ubuntu has. With upgraded VM version, it may well have a new MAC. So I checked iftab and found out it's been replaced by an even more arcane file, /etc/udev/rules.d/70-persistent-net/rules. Opening up that file and sure enough, the old MAC was there with my eth0. And there's also an eth1 with the new MAC. The two lines are in different format. After some thinking I decided to comment out old eth0 and changed the other one's name to from eth1 to eth0. Still, there's no network after restarting networking service. So I restarted the machine (good'ol Windows habit) and guess what? All is merry again!

Hope my experience will be some help to anyone who wants to embark on such feat.

No comments:

Post a Comment