# Ubuntu – How to compile an 4.2.x version of Guest Additions on Ubuntu 14.04.3 LTS

I would like to compile the Guest Additions from Virtual Box 4.2.12 on Ubuntu 14.04.3 LTS. It is required to run gvim properly (see addendum below).

I can confirm that I was able to do so in 13.04 with Virtual Box 4.3.6. After countless hours of rebooting and reinstalling VMs and different Guest Additions I know with 100% certainty, regardless of the source of the bug, that 4.2.12 solved all my partial redraw issues in gvim.

Now in a new 14.04 VM I am unable to compile 4.2.12 and am desperate to get it working. I tried under Virtual Box 5.0.4 and 4.3.30. Heck even installing Guest Additions 4.3.0 (VB 4.3.30, Ubuntu 14.04.3 LTS) fails.

The compilation fails, on a fresh installation of Ubuntu 14.04.3 (with updates) under Virtual Box 5.0.4 and 4.3.30. Either it fails at the shared folder module, or it says:

Warning: unknown version of the X Window System installed. Not installing
X Window System drivers.


Even when I do manage to compile (Guest Additions 4.3.30), it always says:

The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.


I did all the usual tips, to no avail:

sudo apt-get update
sudo apt-get remove dkms build-essential linux-headers-*
sudo apt-get install build-essential
sudo apt-get install module-assistant


Is it possible to compile Guest Additions 4.2.12 at all under 14.04.3 ?

Why install 4.2.12 you may ask? Well there is a very obscure bug with either GTK or Guest Additions for Ubuntu under a Windows 7 host (both 64 bit, with 3D enabled). There are redraw issues in gvim when switching tabs (tabs do not redraw properly) and when moving through the file, where only partial updates happen. gvim is absolutely essential for my workflow. You can see in my answer here that I have tried many VMs and Guest Additions versions, to isolate 4.2.12.

I also compiled gvim 7.3.637 under 14.04.3, and applied the patch from Chris in issue 91 to no avail.

Other things that don't solve my gvim issue (without 4.2.12), just in case:

• setting ttyscroll=0 in vim
• enabling "Qt Window Fix" in Compiz Config Settings Manager
• starting gvim with --syncoption