Ubuntu – Ubuntu 18.04 Gnome hangs on VirtualBox with 3D acceleration enabled

18.04gnomevirtualbox

Setup

  • VirtualBox: 5.2.12 (just released)
  • Host: Windows 10 with the latest update
  • Guest: Ubuntu 18.04, 3D acceleration enabled, Gnome desktop manager
  • Video card: Nvidia GEFORCE GTX980

Behavior

Ubuntu boot, login go fine, desktop shows up, I'm able to start applications, type, move or resize windows (by grabbing the edges), etc.

However, if I maximize any window by double clicking on its title bar, or clicking on the maximize button, response to keyboard or mouse input for the entire system becomes so sluggish (20 seconds or longer response time to any key pressed in gedit for example) that Ubuntu becomes unusable and needs to be shut down (forcefully if I don't want to wait for delayed response to commands).

If I disable 3D acceleration in VirtualBox Manager, Gnome works fine, even when maximizing windows.

If I switch to Unity desktop manager, everything works fine, with or without 3D acceleration.

Since my current Ubuntu 18.04 installation is an update from an older version of Ubuntu (16.04 was the original installed version I think), I created a fresh Ubuntu 18.04 virtualbox, and the same thing happens there too, so it's likely unrelated to the updates.

Also, generally Unity seems to be faster than Gnome, even when Gnome is still responsive.

This issue started with Ubuntu 17.04 (when Gnome was made default desktop manager) and has been happening with all versions of VirtualBox versions available since then.

I would appreciate any suggestions on how to fix this.

Best Answer

VirtualBox devs basically threw their hands up over 3D Acceleration with regards to X11 guests, as stated in this post from over 2 years ago: https://www.virtualbox.org/wiki/X11Guest3D

There are dozens of tickets created on the VirtualBox site, and all of them have gone ignored. Plenty of forum posts as well. The same reply has been given every time, the latest one I can find posted 3 weeks ago by one of the devs (michael):

I am afraid that there is currently no one on the team with enough free time to investigate this (and no sign that it will change in the foreseeable future). It should be something which interested users with skills in OpenGL programming in C should be able to track down and fix. Questions (technical ones) or patches welcome on the vbox-dev mailing list.

Going forward, the current consensus is that you have 4 options:

  1. Disable 3D Acceleration (easiest)
  2. Use any other desktop environment besides GNOME x11, such as GNOME Wayland or Unity
  3. Use any of the other virtualization products
  4. Contribute to the VirtualBox project yourself

Links: https://forums.virtualbox.org/viewtopic.php?f=3&t=84198 https://www.virtualbox.org/ticket/15417 https://www.virtualbox.org/ticket/17014 https://www.virtualbox.org/ticket/17577 https://forums.virtualbox.org/viewforum.php?f=3