Installing Ubuntu 13.04 on a Mac

I like having a Ubuntu install handy to play around with. It’s already on my PC as a VirtualBox image, but 3D acceleration refuses to work, so I can’t upgrade it beyond 12.04 as there’s no more Unity 2D after that and upgrading prompts dire warnings about terrible performance. I decided to try installing 13.04 (Raring Ringtail) onto the Mac with VirtualBox.

Installing VirtualBox was easy. Download the Mac versio and drag it to the Applications folder. That’s generally the case for installing Mac apps, although some of the newer ones can be obtained from the App store, just like for mobile devices.

Creating a new image, mounting the ISO file and installing Ubuntu was no problem. In fact, the install wizard seems to have been streamlined a bit.

However, running it was a different issue. Opening the ‘Start’ menu took ages as it slowly fades in, and just getting it to go away took another eternity as it slowly faded away. A bit of Googling revealed that the problem was a lack of 3D acceleration. That apparently causes it to use the CPU to render the graphics, leading to terrible performance.

The solution was found in this forum thread. Basically, install the VirtualBox extensions, install guest editions, then insert the line ‘vboxvideo’ to /etc/modules

Reboot and check that 3D is supported with the following command.

/usr/lib/nux/unity_support_test -p

If that shows all green, everything should be running much smoother!

Advertisements

Resizing VirtualBox Partitions

My Ubuntu VM was running out of space. The good thing about VMs is that the hard disk storage file can just be expanded. I followed the steps from this blog post.

First, expand the size of the disk. My host OS is Windows, so the following command is for the Windows version of VirtualBox. If the VirtualBox folder isn’t in the PATH variable, you will have to use the full path to VBoxManage.exe. For the command below to work, your working directory should be where the vdi file is. The final parameter is the new desired size of the partition.

VBoxManage.exe modifyhd mydisk.vdi --resize 20000

The partition must now be resized to make use of the expanded disk. Boot to a liveCD of Ubuntu to use the GParted partition editor. If you have an ISO file, it’s a pretty simple matter of assigning it to the virtual CD drive. Boot from the liveCD, select “Try Ubuntu” and start GParted.

If the Swap partition is in the way, right click on it, select Swapoff so that the partition can be moved. This is also necessary to do other stuff to the swap partition, like deleting it.

Swapoff

The swap partition was in the way, preventing me from expanding the primary partition, so I first had to move the extended partition all the way over. To do so first required deleting the swap partition. Right click on the swap partition to open the context menu and select delete.

Now click on the cyan border of the extended partition to select it, then right click and select Resize/Move. Adjust the sliders to move it to the end. This post here had the solution to the problem of moving the extended partition.

Recreate the swap partition in the extended partition. linux-swap is one of the options for the filesystem type.

Finally, extend the primary partition to take up the space. Remember to click on the green tick to apply the changes.

Shutdown the VM and remove the liveCD from the virtual CD drive. Reboot, and the available disk space has been increased!

Could not open VirtualBox hard disk

After a fresh install of Windows, I had to reinstall VirtualBox. Starting the virtual machine for the first time after that resulted in an error of not being able to find the hard drive.

This forum thread on the VirtualBox forums explains how to fix it.

The solution involves editing the .vbox file with a text editor and removing the <AttachedDevice> section.