VirtualBox 6.1 introduced an improved 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.1 3D acceleration:
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 or 20.04, type the following command:
# /usr/lib/nux/unity_support_test -p
If the binary above is not available, you have to proceed to install a package named "nux-tools" with the following step:
# apt-get install nux-tools
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:
# sudo apt install dkms build-essential module-assistant
# sudo m-a prepare
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