23 September 2016

Ubuntu 16.04 guest + VirtualBox 5 + Windows: major version coordination bugs

Trying to run the latest Lubuntu (and I presume Ubuntu) 16.04 as the guest within a recent VirtualBox version (e.g. 5.0.22) on a Windows 7 host with anti-virus installed requires a certain amount of ... version coordination dancing, because of a series of unfortunate bugs.

The main problem is that the recent VirtualBox 5.x series has some major compatibility problems with Windows and/or the anti-virus installed with it.  Launching a VirtualBox image could result in a pretty scary error message like:
Error relaunching VirtualBox VM process: 5
Command line: ...............
And it's a "hard" error, blocking the VirtualBox image from even attempting to boot the guest OS.  Apparently it's something to do with "Hardened Security" [1].  There's some proposed workarounds but none of the proposed solutions worked for me.

Worse yet, after installation of VirtualBox 5.x (on a Windows 7 host) and successfully testing my Lubuntu guest image, my TrendMicro anti-virus updated overnight which created the above "Hardened Security" problem --- literally overnight!

The only reliable workaround is to downgrade VirtualBox back to the version 4.3.x series.  That's a workaround for the VirtualBox "Hardened Security" problem, but it creates new version compatibility problems between the guest OS and VirtualBox...  argh

But I found working workarounds.

Ubuntu* + VirtualBox Guest Additions + VirtualBox Host: Version Coordination Dance

So to avoid VirtualBox 5.x "Hardened Security" problem, which bricks the guest OS image, we have to run VirtualBox 4.3.x on the Windows host.

The new problem now is that version 4.3.x of VirtualBox's Guest Additions is incompatible with the latest Ubuntu* 16.04 as guest! You'll see an error when installing VirtualBox's Guest Additions 4.3.x on Ubuntu 16.04 if you read the compilation message in the terminal [2].

(* note: I actually have Lubuntu, but I presume Ubuntu is the same.)

The incompatible VirtualBox Guest Addition doesn't mean that the Ubuntu guest won't start up, but you may very well lose the ability to share folders between the guest and host OS, or the ability for the guest OS's screen resolution to be automatically set when resizing the VirtualBox's screen window.

The workaround to that is to install the latest VirtualBox Guest Additions from the version 5.x series (which is compatible with Ubuntu 16.04), and then go back to running the image on VirtualBox version 4.3.x on the host OS.

Now you might say: but VirtualBox 5.x won't run because of that Hardened Security bug, so how can its Guest Additions be installed?

Apparently you can download the Guest Additions separately somewhere to compile and install yourself.  Apparently a version is also available from the Ubuntu software repositories...

For me, I just went to a Mac and installed VirtualBox 5.x, in order to install its Guest Additions on the Ubuntu 16.04 guest image --- and then I moved that image back to the original Windows 7 host machine.  :)

Note that this workaround made folder sharing between host and guest work again.  But the screen resolution still doesn't get auto-set when resizing the VirtualBox screen window, or when going full-screen.  It's rather annoying.

The workaround for that is to manually set the monitor resolution from within the Ubuntu guest OS.  But of course VirtualBox's virtual graphics device doesn't always present the proper resolutions to maximize screen real estate available to the guest OS based on the host OS's screen resolution....  argh

So the workaround for that is to use xrandr to create a new appropriate screen resolution mode line.

To summarize:
  1. Lubuntu 16.04 + VirtualBox Guest Additions (GA) 4.3.x = incompatible
         Workaround: install VirtualBox GA 5.x
  2. Lubuntu 16.04 + VirtualBox GA 5.x + Windows host running VirtualBox 5.x = does not run if Windows + anti-virus creates the "Hardened Security" bug
         Workaround: run with VirtualBox 4.3.x on the Windows host, but this has an incompatibility bug (see next point).....
  3. Lubuntu 16.04 + VirtualBox GA 5.x + Windows host running VirtualBox 4.3.x = okay workaround, but screen resolution will not set automatically
         Workaround: use xrandr within the Lubuntu guest to create an appropriately sized screen resolution mode-line, then manually set the guest monitor resolution to it.
Needless to say, I'm not very happy with the latest VirtualBox + Windows situation...

[1] See also:
Note NONE of the proposed solutions or workarounds worked in my case!

[2] An error like this: Ticket #13278 unknown version of the X Window System installed. Not installing X Window System drivers.

No comments: