X

Technical articles, news, and insights
for Oracle's Infrastructure Software offerings

Oracle VM VirtualBox 5.1: 3D Acceleration for Ubuntu guests.

Simon Coter
Director of Product Management

VirtualBox offers 3D acceleration by intercepting OpenGL requests made by the guest vm, and passing then down to the host's OpenGL library to be executed directly by the host. 

To Configure a VM to use VirtualBox 3D acceleration:

  • Make sure you install the Guest Additions into the Linux guest (Host+D);
  • Enable 3D acceleration in the VM settings;

Then simply start-up your Ubuntu guest.

But on some platforms, and in some circumstances, the wrong renderers may be used by the guest OS which results in very slow 3d performance of the guest.  

To check that you're using VirtualBox 3D acceleration on Ubuntu 16/17, type the following command:

/usr/lib/nux/unity_support_test -p 

If you see something like this:

... i.e. the OpenGL Renderer is NOT Chromium, then you are NOT using the VirtualBox OpenGL drivers.

To get best performance possible, you have to install VirtualBox guest-addition within the VM; to accomplish this target you have to execute following steps:

  • Install  required packages for building kernel modules.
sudo apt install dkms build-essential module-assistant
  • Prepare your system to build kernel module
sudo m-a prepare
  • In VirtualBox menu bar, select Devices => Insert Guest Additions CD image; at this point you'll be asked to run the software contained in it, click Run button:

Once the guest additions have been installed, press Enter to close the terminal window and "reboot" your Ubuntu guest-machine.

Once you do this, and then you reboot the guest you should re-rerun: 

/usr/lib/nux/unity_support_test -p  

Which hopefully will result in the Chromium renderers being seen to be used:

And a consequence is that your Linux guest will be faster and smoother.

Join the discussion

Comments ( 17 )
  • Zoran Banković Saturday, December 2, 2017
    Did everything as you wrote here but Ubuntu guest stuck just before user login window. Can switch to terminal (ctrl+alt+f2). Getting syslog errors like:
    Ubuntu-vm org.gnome.Shell.desktop[943]: OpenGL Warning: vboxCall failed VBox status code VERR_BUFFER_OVERFLOW

    Looks like Guest Additions building went OK..
    Memory is set to 128MB
    Ubuntu is booting when 3D Acceleration is unchecked in Virtual Box settings
  • Simon Saturday, December 2, 2017
    Hi Zoran,

    which release of VirtualBox are you using ?

    Simon
  • Monish Sunday, December 3, 2017
    Hi Simon,

    What is equivalent command (/usr/lib/nux/unity_support_test -p ) for Oracle Linux guest.

    Thanks.
  • Simon Monday, December 4, 2017
    Hi Monish,

    you can try to run commands like:

    # glxgears

    or some OpenGL 3d screensaver like:

    # /usr/libexec/xscreensaver/sproingies

    Simon
  • Monish Monday, December 4, 2017
    Hi Simon,

    VirtualBox: 5.1.30
    Oracle Linux 7.4

    #glxgears displays the gears/graphic, with or without 3D Acceleration being turned on (via Settings -> Display).

    Also, the FPS is higher without 3D Acceleration being turned on.

    Does that look normal.

    Thanks,
    Monish
  • Leo Saturday, January 6, 2018
    I have the same problem as Zoran on guest U64 16.04 LTS. I did not check the logs.

    In my case the booting is OK.
    When I try to enter a GUI session, though, with a password then the screen stays with login screen color and nothing changes and the launcher does not show. If I poke the window or try to force close the VBox window and "send a shutdown symbol" then I can see a grayed desktop with which I cannot interact.
  • Simon Monday, January 8, 2018
    Hi Monish,

    you should move to the latest 5.2 and retry.
    Thanks

    Simon
  • Simon Monday, January 8, 2018
    Hi Monish,

    you should try to move to the latest 5.2.4 release of VirtualBox and retry.
    An other suspect that I have is that you are using a too high resolution within your VM.

    Simon
  • TheCommoner282 Tuesday, January 16, 2018
    Hey everyone,
    is there a similar guide for Ubuntu 17.10? No "/usr/lib/nux/unity_support_test -p " command here, since Unity is gone.
  • Simon Wednesday, January 17, 2018
    Hi,

    commands like "glxgears" or "glmark2" should help you to verify your 3d performance.

    Simon
  • Sergey Thursday, July 5, 2018
    I installed guest additions and enabled 3D acceleration, OpenGL rendered shows " Chromium", but the system is unusably slow, even slower than without 3D acceleration. I'm using Ubuntu 16.04 and VirtualBox 5.2.14.
  • Graeme Paterson Saturday, July 28, 2018
    HP Pavilion x360 Convertible - 15-bk193ms, win 10 host, Vbox 5.2.16r123759, Ubuntu 18.04 with 3d acceleration checked in vb settings and guest additions installed. Both openSCAD and Gazebo start but die before their GUI starts. They work but very slowly with 3D acc. disabled. I tried all the steps above; guest additions re-installed but still no luck.
    /usr/lib/nux/unity_support_test -p > file not found.
  • Simon Sunday, July 29, 2018
    Hi Graeme,

    I've just tested it on Ubuntu-18.04 and those steps correctly work.
    To get the binary "unity_support_test" installed you need to install "nux-tools" package:

    # apt-get install nux-tools

    Thanks

    Simon
  • Globot Thursday, August 30, 2018
    I have tested on guest kubuntu 18.04 lts, but it don't work... most of application O open don't work properly...

    Konsole will not diplay in desktop, if I resize the VBox window, then I see a screen with a black background and the Konsole, but everything very slow.

    if I try a kwin --replace, i see those errors:

    OpenGL Warning: glXQueryContext not implemented by Chromium
    kf5.kcoreaddons.desktopparser: Property type "Url" is not a known QVariant type. Found while parsing property definition for "X-KWin-Video-Url" in "/usr/share/kservicetypes5/kwineffect.desktop"
    OpenGL Warning: glXChooseVisual: ignoring attribute 0x22
    OpenGL Warning: glXChooseVisual: bad attrib=0x20b2, ignoring
    OpenGL Warning: glXQueryContext not implemented by Chromium
    OpenGL Info: Using XSHM for GLX_EXT_texture_from_pixmap
    OpenGL Warning: glXQueryContext not implemented by Chromium
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1250, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1251, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1252, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1254, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1256, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1257, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1262, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1263, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1264, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1266, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1268, resource id: 0, major code: 14 (GetGeometry), minor code: 0
    QXcbConnection: XCB error: 9 (BadDrawable), sequence: 1269, resource id: 0, major code: 14 (GetGeometry), minor code: 0
  • Simon Thursday, August 30, 2018
    Hi "Globot",

    I hope you're using (now) our latest 5.2.18 release, if not you should try it.
    If you are already using latest one, please reach out our community forum at http://forum.virtualbox.org and share your problems and logs of the VM.
    Thanks

    Simon
  • Michal Rain Monday, September 10, 2018
    Hello,
    I did all of those tips, and got all "yes" but only 1 frame per 10 sec :/
    Ubuntu 16.04 / Gforce 960M
  • Simon Tuesday, September 11, 2018
    Hi Michal,

    what do you mean with "1 frame per 10sec" ?
    Can you please share more details ?

    Simon
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services