X

A Bridge to the Cloud...

Oracle VM VirtualBox 6.0: 3D Acceleration for Ubuntu 18.04 Guest

Simon Coter
Senior Manager, Oracle Linux and Virtualization Product Management

VirtualBox 6.0 introduced a renovated 3D acceleration support; thanks to the huge work done by the VirtualBox engineering team we're now able to have improved performance for 3D on Virtual Machines running on VirtualBox. 

To Configure a VM to use VirtualBox 6.0 3D acceleration:

  • Make sure you install the VirtualBox 6.0 Guest Additions into the Guest Machine (Ubuntu on this example)
  • Enable 3D acceleration in the VM settings
  • Select "VMSVGA" or "VBoxSVGA" as "Graphic Controller"

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 18.04, type the following command:

# /usr/lib/nux/unity_support_test -p

If you see something like this:

... i.e. the OpenGL Renderer is NOT "SVGA3D", then you are NOT using the correct OpenGL drivers.

To get best performance possible, you have to install VirtualBox 6.0 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 SVGA3D renderers being seen to be used:

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

A further comment, from "Christian Mahner", that could help:

Try installing xorg vmware drivers on your Ubuntu guest Virtual Machine:

# sudo apt-get install xserver-xorg-video-vmware-hwe-18.04

and use the following settings vor your vm:
Controller: VMSVGA (!)
3D Acceleration enabled
Scale Factor: 100%

Here the results I've obtained by executing "glmark2" on an Ubuntu 18.04 guest running on Oracle VM VirtualBox 6:

scoter@ubuntu1804:~$ glmark2
=======================================================
    glmark2 2014.03+git20150611.fa71af2d
=======================================================
    OpenGL Information
    GL_VENDOR:     VMware, Inc.
    GL_RENDERER:   SVGA3D; build: RELEASE;  LLVM;
    GL_VERSION:    2.1 Mesa 18.2.8
=======================================================
[build] use-vbo=false: FPS: 1493 FrameTime: 0.670 ms
[build] use-vbo=true: FPS: 1672 FrameTime: 0.598 ms
[texture] texture-filter=nearest: FPS: 1538 FrameTime: 0.650 ms
[texture] texture-filter=linear: FPS: 1866 FrameTime: 0.536 ms
[texture] texture-filter=mipmap: FPS: 863 FrameTime: 1.159 ms
[shading] shading=gouraud: FPS: 1495 FrameTime: 0.669 ms
[shading] shading=blinn-phong-inf: FPS: 1465 FrameTime: 0.683 ms
[shading] shading=phong: FPS: 1308 FrameTime: 0.765 ms
[shading] shading=cel: FPS: 1344 FrameTime: 0.744 ms
[bump] bump-render=high-poly: FPS: 707 FrameTime: 1.414 ms
[bump] bump-render=normals: FPS: 1703 FrameTime: 0.587 ms
[bump] bump-render=height: FPS: 1925 FrameTime: 0.519 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 1701 FrameTime: 0.588 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 938 FrameTime: 1.066 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1747 FrameTime: 0.572 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 517 FrameTime: 1.934 ms
[desktop] effect=shadow:windows=4: FPS: 608 FrameTime: 1.645 ms

Join the discussion

Comments ( 13 )
  • JYAK Friday, June 7, 2019
    First off, TYVM for blogging/posting. It is a help to eternal noobs like myself! ;o)

    It doesn't appear that I have 3D acceleration working:

    I'm running Mint 19 xfce in VB 6.0.8 on top of Win10 on an AMD A10-9630p


    $ uname -a
    Linux mint19 4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

    $ echo $DESKTOP_SESSION
    xfce

    $ glmark2
    => The first 2 FPS are 76 & 90
    => https://pastebin.com/grKKr7DN

    $ /usr/lib/nux/unity_support_test -p
    bash: /usr/lib/nux/unity_support_test: No such file or directory

    My web search skills appear to be lacking. I haven't found info on how to install "unity_support_test" for Mint/xfce.

    Regardless, based on glmark2's numbers, I don't think 3D acceleration is working correctly.

    Where to from here?

    Thanks in advance.
  • Simon Tuesday, June 25, 2019
    Hi,

    I've just tested the same on Mint 19 and I got the same results I also saw with Ubuntu (thousands of FPS).
    I would suggest you to verify that you have latest VirtualBox Guest Additions correctly installed and running on Linux Mint:

    # sudo lsmod |grep vboxvideo (to see if module is loaded)
    # sudo modinfo vboxvideo (to check the release)

    Simon
  • Jon Tuesday, October 22, 2019
    Hi,

    Been scratching my head, and I'm a newbie. I followed your instruction and when I tried running `VirtualBox:/usr/lib/nvidia$ /usr/lib/nux/unity_support_test -p
    bash: /usr/lib/nux/unity_support_test: No such file or directory` any idea why? I'm using 6.0.14 in macbook pro catalina os
  • Simon Thursday, October 24, 2019
    Hi Jon,

    the binary "/usr/lib/nux/unity_support_test" is part of the package "nux-tools"; so you just need to install this package on your system.

    Simon
  • Steve Wednesday, November 27, 2019
    It is not working with the exact same steps. No error at all, but always got this:
    OpenGL vendor string: VMware, Inc.
    OpenGL renderer string: llvmpipe (LLVM 8.0, 256 bits)
    OpenGL version string: 3.1 Mesa 19.0.2

    Not software rendered: no
    Not blacklisted: yes
    GLX fbconfig: yes
    GLX texture from pixmap: yes
    GL npot or rect textures: yes
    GL vertex program: yes
    GL fragment program: yes
    GL vertex buffer object: yes
    GL framebuffer object: yes
    GL version is 1.4+: yes

    Unity 3D supported: no
  • Simon Wednesday, November 27, 2019
    Hi Steve,

    I just retried this configuration with VirtualBox 6.1-RC1 and updated kernel for Ubuntu 18.04: it perfectly works.
    I see two possible options:

    - you have the wrong VGA adapter configured for your VM
    - VirtualBox Guest Additions are not correctly installed (and so VirtualBox drivers are not available on Ubuntu)

    Simon
  • Bob Friday, January 31, 2020
    Hello Simon, at which resolution are you getting these benchmark results? I'm running 6.1.2 and getting almost 2k on most of the tests when running on a low resolution (800x600) but once I change it to something usable (1920+), the results drop to 60-70 and the whole desktop stops being smooth (dragging a window is choppy, scrolling in a browser jumps and stutters, there's a very noticeable lag when typing etc). Any ideas?
  • Simon Friday, January 31, 2020
    Hi Bob,

    I just re-tested with the same machine and updated VirtualBox 6.1.2.
    First thing I've done: I've installed the VirtualBox 6.1.2 guest-additions within the VM, rebooted, changed the resolution to 1920+ and then re-executed the test.
    I didn't have any issue: I've shared my results, now available at:

    https://pastebin.com/hPWFCBxZ

    Please, consider to always run the VM with "Normal START" and hot the "Headless" one while you need to use the GUI.
    Hope this helps.

    Simon
  • Achraf Tuesday, February 4, 2020
    Thanks this helped me.
    The latest VirtualBox Guest Additions should be used and it worked for me even with older VirtualBox version installed (5.2.6).
  • Nic Steussy Sunday, March 22, 2020
    This did not work on the current standard VirtualBox 6.0.x. However, after upgrading to the in-process 6.1.x it worked exactly as described. Thank you for your efforts.
  • Nico Orru Tuesday, March 24, 2020
    Hi Simon,

    Thanks for the nice tips!

    I have observed the same outcome as Bob's. As screen resolution increases, glmark2 results progressively become worse and worse, even if glmark's windows stays the same size. At 4k the GUI becomes unresponsive.

    Tried with both Xfce4's compositor enabled and disabled, with no changes.

    Is there anything that can be done to increase the video memory size, just to rule it out? Glxinfo reports 1MB available. VirtualBox GUI configuration allows up to 128Mb, which can be tweaked up to 256Mb via CLI, but no further than that.

    Extended renderer info (GLX_MESA_query_renderer):
    Vendor: VMware, Inc. (0x15ad)
    Device: SVGA3D; build: RELEASE; LLVM; (0x405)
    Version: 19.2.8
    Accelerated: no
    Video memory: 1MB
    Unified memory: no
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 2.0

    DRI seems to have been loaded:

    [ 308.370] (II) vmware(0): Initialized VMWARE_CTRL extension version 0.2
    [ 308.376] (II) vmware(0): Gallium3D XA version: 2.5.0.
    [ 308.376] (II) vmware(0): Path of drm device is "/dev/dri/card0".
    [ 308.376] (II) vmware(0): [DRI2] Setup complete
    [ 308.376] (II) vmware(0): [DRI2] DRI driver: vmwgfx
    [ 308.480] (--) vmware(0): Render acceleration is enabled.
    [ 308.480] (==) vmware(0): Rendercheck mode is disabled.
    [ 308.480] (--) vmware(0): Direct rendering (DRI2 3D) is enabled.
    [ 308.480] (--) vmware(0): Direct rendering (DRI3 3D) is enabled.
    [ 308.480] (==) vmware(0): Direct presents are disabled.
    [ 308.480] (==) vmware(0): Hardware only presents are disabled.
    [ 308.480] (==) vmware(0): Backing store enabled
    [ 308.480] (==) vmware(0): Silken mouse enabled
    [ 308.480] (==) vmware(0): DPMS enabled


    It doesn't appear that the Xfce4 compositor is making use of the acceleration either.

    I've got Virtualbox 6.1.4 host on Windows 10, Ubuntu 18.04.4 with 6.1.4 guest extensions installed. vboxguest and vboxvideo modules are loaded.

    Is this behaviour expected, if not, have you got any suggestions on how I can investigate further?


    Thanks,
    Nico
  • MAJID Friday, May 1, 2020
    Hi,

    /usr/lib/nux/unity_support_test -p
    doesn't work on Ubuntu 20.04 !
  • Simon Thursday, May 7, 2020
    Hi Majid,

    that binary is supplied by the package named "nux-tools"; you can install it by:

    # apt-get install nux-tools

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