[Droid Eris Android Development] bftb0:
The newest Android SDK API (v9 - Android 2.3) for linux seems to require glibc 2.11. I didn't know that, and blithely installed it last night from within eclipse - on my Ubuntu 8.04 LTS VM - and then found out that the emulator would no longer work correctly because of the glibc requirement.

So, I took the plunge and decided to do an online upgrade of Ubuntu 8.04 -> 10.04. Sort of wanted to see what Ubuntu 10 looked like anyway. Normally I am not a big fan of major upgrades (as opposed to clean installs), but it succeeded well enough. Here's some notes from that process.

I'm using VirtualBox (3.6.12) with a Win7 x64 (i5-750, has VT) host, and the Ubuntu VM is an x32 guest.

- First, I cloned off the VirtualBox disk for the Ubuntu machine:

VboxManage clonehd Ubuntu-8.04-LTS.vdi Ubuntu-10.04.vdi --format VDI

that way, if disaster struck, I would still have the old VM available - my .VDI is about 32 GB. (I think that you can not simply copy a .VDI because the "VboxManager clonehd" modifies a "UID" VM disk identifier label when you clone, and if you don't do this, it will cause problems with VirtualBox, possibly even screw up the other (saved) VM Hard Drive file)

- Second, you go in to Virtualbox's media manager (File -> Virtual Media Manager), and let VirtualBox know that the .VDI you just created on the command line is available as a VM Hard Drive. Next, click on the "New" (VM) wizard, and create a new VM - the only thing you need to get right in this step is that rather than create a new VM hard drive, you just pick the newly-created .VDI to be your hard drive.

Don't start the VM yet.

- Third, make very careful notes about the existing settings for the current Ubuntu VM, and then select the new (Ubuntu 10.04) VM, and update all the settings ("Settings" icon) to match - after all, when you are initially booting it, it will still be 8.04, and will expect to see the exact hardware that it previously saw. You can probably get away with a few things changing (e.g. main memory size), but to avoid hassles, I was very careful - even copying the same MAC address (Network -> Adapter 1 -> Advanced) to the new machine definition. (OT, I don't know why VB doesn't just have a "clone the whole damn machine menu item, but that's a rant for another day). After you are sure everything matches, fire up the new VM - it will be running an exact copy of the old (8.04) VM.

- 4th: After logging in, System -> Administration -> Update Manager. The update spent about 45 minutes downloading files (3.6 Mbits/sec, about 1.1 GB total), and then the update processes took another 45 minutes or so. You don't need to hover over it all the time, but you might want to check on it every once in a while - in my case it stopped once to let me know it was obsoleting some packages as part of the upgrade.

- 5th: When it reboots, the old VirtualBox extensions are still present in the VM, but they do not work since they no longer match the new kernel - so the video will be in "minimal mode". Also, if you had a "vbox" mount in your /etc/fstab, it will not mount - if the system asks you about it during boot, just hit the "S" key for "Skip". You just need to live with this for 10 or 20 minutes while you do the next step - don't worry about fooling with it, as both the video and shared folders will come right back once you get the guest extensions reinstalled. Also, you might find it is impossible for the VM Manager to "mount" the VirtualBox Extensions .iso as a CD-ROM device, so, you do the following:

a) Copy the VBoxGuestAdditions.iso file (30+Mb) from the C:\Program Files\Oracle\VirtualBox folder to someplace where you can get it to the VM. The shared folders will also not be working yet, so you could put it on a browsable network server or a thumb drive; I used the latter, and then did a USB pass-through to the guest VM (VirtualBox VM "Devices -> USB Devices" menu)

b) Do a loopback mount, e.g.

$ sudo /bin/bash
# mkdir /mnt/VBox
# losetup /dev/loop0 /home/user/foo/VBoxGuestAdditions.iso
# mount -t iso9660 -o ro /dev/loop0 /mnt/VBox

You might need to

$ sudo apt-get install dkms

as the VirtualBox installer needs the dkms package to install - I did.

Then

# cd /mnt/VBox
# sh VBoxLinuxAdditions-x86.run (or the AMD equivalent if you have AMD uP)
# cd /
# umount /mnt/VBox
# losetup -d /dev/loop0
# rmdir /mnt/VBox

At this point you should reboot the VM. If everything went OK, the VirtualBox guest additions will be active, and you will have decent video and the shared folders will be available. I had a minor problem where I could write to the (host) shared folders no problem, but all files were then owned by root, and that made Firefox unhappy when DL'ing directly to the shared folders. So, I unmounted it (as root), , added uid=,gid= options to my /etc/fstab entry which corresponded to the regular user login (1000/1000), and then remounted it (as root).

/etc/fstab entry:

VM_ubuntu	/home/user/VM_shared	vboxsf	rw,uid=1000,gid=1000	0	0

("VM_ubuntu" is the "Folder Name" I shared the host folder with in the VirtualBox Host app window)

Sixth, the last thing is Java - I had used either "apt" or the Synaptic Package manager to add JSE 5 to Ubuntu 8.04, and that was invalidated and uninstalled during the upgrade, so I needed to to go and manually get a JDK directly from Sun/Oracle. It's a bit difficult to find, as JSE 6 is now the shipping release. 1 year ago, the Android SDK did not work correctly with JSE 6 (frankly, I don't know if it is an eclipse issue or the Android SDK), which necessitated installing JSE 5. That may have changed (I got lazy and didn't research it - just installed JSE 5) but if it hasn't, here's the "older versions" download page at Oracle:

http://www.oracle.com/technetwork/java/javase/downloads/previous-jsp-138793.html

You might need to fix up PATH, or CLASSPATH environment variables from your prior settings if you install the JSE to a new location.

Success! The Emulator works again!

Finally, if you read this far, here is the good news: I don't know why, but the Ubuntu 10.04 desktop seems WAY SNAPPIER than the old (Hardy Heron) 8.04 default desktop. This seems very hard to believe, as I am using exactly the same VM host and guest extensions, but it makes 8.04 look very sluggish by comparison. Seems hard to believe that a new X11 server. or libraries, or even a new kernel would do that - maybe the old (gnome-based?) window manager was a POS? Dunno - but I think you will like Ubuntu 10.04

cheers,

bftb0