I’m going to be using a couple of platforms for this blog:
- Virtualized instance of Ubuntu 14.04 LTS
- Running under Oracle VirtualBox 4.3.20, with a Mac OS X host (Yosemite)
- This configuration requires that the guest OS must be 32 bit.
- Physical instance of Ubuntu 14.04 LTS
- I don’t have the hardware for this yet, but it’s likely to be an AMD A10 based system.
Having physical hardware will be important for this blog, because we’ll be needing access to the CPUs performance counters and debug hardware.
Still, you can get a long way with virtualized systems (not all advanced tools need hardware access), so I’ll get started with a VM.
(By the way, kudos to Oracle for providing a perfectly good hypervisor for free. It works on multiple platforms and has enough features to allow you to get work done.)
The “GuestAdditions” package:
I’ve installed VirtualBox many times, and every time I do it, I get hung up on getting a decent screen resolution. The key is to get the “GuestAdditions” package installed.
Now, the problem is that it’s actually surprisingly hard to find the package. There is a VirtualBox menu item that should allow you to automatically install it into your guest OS, but I’ve had varying results with that method.
It turns out that in VirtualBox 4.3.20, the GuestAdditions are packaged with the application. This is really good to know, because finding Oracle’s download site is a bit tricky.
Locating the included package:
OS X applications are not simply a binary executable file. They contain a bunch of resources that the program needs to run – a bit like the standard ‘bin’, ‘lib’ and ‘share’ directories you’ll see with packaged linux executables.
Navigate to the VirtualBox application with your finder, you can open the contents with a right click, then select “Show Package Contents”. This will drop you into a folder where you can see all the working parts of the application.
Navigate to “<app location>/Contents/MacOS” and you’ll find the file “VBoxGuestAdditions.iso”. This is what you’ll need.
Note : This post is specific to Mac OS X. I don’t know what you’ll find on other platforms, so you may need to take the manual approach described below.
Installing the package:
It’s worth giving the standard GUI based approach a try first.
Start your VM, then navigate to the top menu bar and select “Devices | Insert Guest Additions CD image”. This ought to do the work automatically. Reboot the VM to make sure the changes have been fully applied.
This approach just worked fine for me, but that hasn’t always been the case.
Fetching the package manually:
If you end up needing to fetch and install the GuestAdditions package manually, here’s what to do.
First of all, check to see if your version of VirtualBox already contains the GuestAdditions ISO, as described above. If it does, then you can use that.
If not, you can download the package from here:
http://download.virtualbox.org/virtualbox/
You’ll need to select the directory that matches the version of the VirtualBox hypervisor you’re using.
In my case, I’m using version 4.3.20, so I’d select the package from here:
VBoxGuestAdditions_4.3.20.iso
(Note: WordPress doesn’t seem to allow me to get the text path in the link here.)
Building the package manually:
Installing the GuestAdditions seems to require building a new kernel module. This means that getting the package to install is a two step process.
First you need to get your system ready to build kernel modules, as described in Oracle’s manual here:
https://www.virtualbox.org/manual/ch02.html#externalkernelmodules
Then you’ll need to build the additions themselves, as described in section 4.2.2.1 of Oracle’s VirtualBox manual, here:
https://www.virtualbox.org/manual/ch04.html#idp54932560
The next entry will describe actually doing this, and any pitfalls I encounter – stay tuned!