VirtualBox 3D Acceleration

Since VBox 6.1 (released two weeks ago), 3D acceleration is disabled for VBoxVGA Graphics controller setting. They now only allow 3D Acceleration with VMSVGA setting. (Changelog)

This now results in a limitation of Whonix OVAs. VMSVGA 3D accel doesn’t work in them. I have tried latest 15.0.0.7.1 OVA and both Gateway and Workstation can’t get past a black boot screen with a frozen white cursor in the top left-hand corner.

For a lot of hardware, 3D Accel is needed for proper playback of video in a lot of situations. If not enabled, video in Whonix can be jerky, have glitches, and is not smooth. VBox isn’t the barrier to having decent video performance in Whonix. The whonix OVA appears to be it.

I have ruled out this being an upstream bug - it’s not. I install a new Debian 10.2 VM in my same vbox instance, installed Xfce 4.12 inside it, and 3D Accel with VMSVGA works fine. Debian boots up and video appears to be butter smooth and thus Accel working.

What’s causing this limitation in Whonix OVAs and how do we fix it?

Something kernel-related in the VM? Can we recompile it somehow to make it work?


Edit by Patrick:
Documented here.
Kicksecure ™ Tuning

I am not sure I will be able to fix this.

Please also ask in VirtualBox forums as per The User Co-developer Concept. Hopefully they have any idea.

Also anyone could try to contact Oracle (developers of VirtualBox) and pay them to find a solution. Once a solution is found I will consider applying it by default in Whonix.

Videos work for me either way. I never used 3D acceleration. Therefore I wouldn’t even know how to distinguish 3D acceleration working versus 3D acceleration broken. Fast vs slow isn’t a measurement - unless it is obvious - which I don’t have any slowness issue to begin with.

Can you run this command in the different situations that you described

  • 3D acceleration disabled (Debian buster VM)
  • 3D acceleration enabled and working (Debian buster VM)

and see any difference?

glxinfo | grep -i OpenGL

Nothing special about Whonix kernel by default yet. We’re working on kernel recompilation but nothing one would use without knowing it. I.e. if you used it, you’d know it. Default Debian buster linux kernel. Nothing special. Therefore recompile kernel won’t make any difference since non-Whonix, Debian buster does not have this issue either as you said (which uses exactly the same kernel).

You could try serial console. Try it first with non-broken Whonix. Then switch the option that breaks it. Hope that serial console is still functional. Might help to gather debug information.

1 Like

Hi @Patrick,

Since VBox 6.1, there is now simply no way to have “3D acceleration enabled and working”. That’s the problem.

So it’s an easy test: tick 3D Acceleration for workstation with VMSVGA, and the result we want is for Debian to boot all the way into the system. That’s how we know it is working.

To actually see the difference 3D Acceleration makes, you could test in vbox 6.0 or earlier by comparing “3D Acceleration” ticked or unticked with the setting on VBoxVGA. Inside Workstation, find a 1080p video with a high frame rate like 60fps, e.g. video.mp4 from this github. Then, play the MP4 in mpv (sudo apt install mpv) which is a video player that has hardware decoding enabled by default.

On my hardware, the difference is colossal. GPU accel pass-through is needed for normal smooth video playback unless you have an extremely fast CPU which doesn’t apply to most of us. GPU acceleration exists for a reason.

No guarantee this test would work on your hardware, but for most graphics chips this should be replicable.


  1. A lot of reasons why I can’t do that.

  2. Because I’ve already tested stock Debian 10.2 guest which works with 3d accel, I’m sure they’d say ‘Go back to Patrick because he’s modified Debian in some way, it clearly isn’t the fault of virtualbox.’ I have also tested other Debian-based VMs in the same vbox - Ubuntu, Mint, Xubuntu - and all of them work.

Sure I’ll try that out. Will continue working on this, and I agree I can also ask on vbox forums as part of that.


Another possible clue:

With Gateway set to 256MB RAM, VMSVGA 3D accel WORKS, i.e. Debian fully boots. But not if 768MB / graphical mode.

Could the RAM-adjusted graphics code have something to do with this - if the mod is not contained in stock Debian?


Another possible clue:

I now have an error update-initramfs: failed for /boot/initrd.img-4.19.0-6-amd64 with every apt upgrade now. (Update: doing sudo dpkg --configure -a gets rid of this symptom though.)

Can’t find the link right now but a week ago I found vbox forums thread discussing an idea where the guest kernel needs to reconfigure each time you change from VBoxVGA to VMSVGA, etc? So it may be related?

Can you try in vbox 6.1 changing a workstation to VMSVGA and see if it produces this same symptom?

Update: no, kernel headers in whonix have nothing to do with the problem. I uninstalled & reinstalled headers in workstation, combined with reinstalling guest additions 6.1.0 inside it, and 3D accel still doesn’t work in any of those combinations of things.

Are virtualbox guest additions fully functional? I.e. desktop resolution
and copy/paste from/to VM?

AnonymousUser via Whonix Forum:

Could the RAM-adjusted graphics code have something to do with this - if the mod is not contained in stock Debian?

RAM Adjusted Desktop Starter (rads) ? No. The only
difference is “start lightdm” vs “not start lightdm” (not start desktop
environment). Once desktop environment (lightdm) is started it is the
very same.

Another possible clue:

I now have an error update-initramfs: failed for /boot/initrd.img-4.19.0-6-amd64 with every apt upgrade now. Can’t find the link right now but a week ago I found vbox forums thread discussing an idea where the guest kernel needs to reconfigure each time you change from VBoxVGA to VMSVGA, etc? So it may be related?

Not sure if related (virtualbox guest additions installation does not
result in initramfs update) but this could be much more serious (prevent
boot). Please open a separate forum thread for this with full error message.

All features listed at Chapter 4. Guest Additions work and I’ve used almost all those features daily for a long time. (Including graphics acceleration pass-through.)

The only thing I see not working is dynamic guest display resolution adjustment of the VM via VM window’s View > Virtual Screen 1 > Resize to 640 x 480 etc.

Maybe that’s not meant to be dynamic - or is it? Could this be another symptom of the same problem we’re trying to hunt down - i.e. that on VMSVGA, the Whonix OVA is not fully working in terms of virtualbox’s graphics functions?

Then these three GA features I either don’t understand or use: " Seamless windows", " Generic host/guest communication channels", and " Time synchronization".


OK, for now I’ll just assume that’s correct, and I’m not sure how to ‘fully remove’ the RAM Adjusted Desktop Starter from a Whonix VM Debian to test for it being the culprit.


But that problem has now gone away. It’s been two weeks now but IIRC what I did was uninstall the -headers package, re-install it manually, and the error went away.


This is still my highest Whonix priority right now, I’m just a bit busy IRL.

Could creating the OVA template (in vbox 6.1) with 3D Accel ticked from the very start reveal anything or make it work? There are obviously a lot of customizations in the Whonix OVA - it must be one of those many things. Or, some factor I’ve never known about when it comes to creating / using an OVA VM template.

Untested but recent improvements in Whonix VirtualBox 15.0.0.9.4 - Testers Wanted! might have fixed this.

1 Like

I seem to experience this issue in a current fully updated Whonix15. The machine starts to boot, and then reaches a screen that remains black and does not proceed. I have tested a separate Debian VM and it works with VMSVGA and 3d enabled.
Virtualbox version 6.1.4
Guest additions 2 packages from Debian repo: virtualbox-guest-dkms, and virtualbox-guest-utils
Debian Buster host machine, also up to date. Kernel 4.19.0-8amd64

2 Likes

@Patrick:

Have now tested 15.0.0.9.4 dev OVA. You’re right, it fixed it!

Actual usage of in-VM 3D acceleration is another matter however. The success of smooth hardware decoded video playback of a 1080p 60fps file has now changed from before, but it’s not Whonix’s fault, it’s because of a forced change by VirtualBox to go from VBoxVGA to VMSVGA after 6.1.

It also not Whonix’s fault because I notice similar changes or problems in a vanilla Debian 10.2 VM and such problems are probably out of scope of Whonix project’s responsibility. I’ll update here if there’s anything relevant, but graphics card pass-through issues can be complex and depend on your hardware so I probably won’t.

So I consider this bug ‘fixed’ in 15.0.0.9.4, thanks! Can’t wait for it to arrive in the Whonix stable channel.

Indeed.

Cool.

Thanks for the report, great to hear!

Tested myself now due to How can I watch youtube in Whonix Workstation?. Works for me. Documented just now:

Kicksecure ™ Tuning

Tested with glmark2, there is no significant visual difference between enabling and disabling 3D acceleration, just terminal output difference.

Disabled:

[workstation user ~]% glmark2      
 GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
 Failed to set swap interval. Results may be bounded above by refresh rate.
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      Mesa/X.org
    GL_RENDERER:    llvmpipe (LLVM 15.0.6, 128 bits)
    GL_VERSION:     4.5 (Compatibility Profile) Mesa 22.3.6
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=32 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
 GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
 Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=false: FPS: 153 FrameTime: 6.575 ms
 GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
 Failed to set swap interval. Results may be bounded above by refresh rate.
[build] use-vbo=true: FPS: 156 FrameTime: 6.420 ms
 GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
 Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=nearest: FPS: 179 FrameTime: 5.614 ms
 GLX does not support GLX_EXT_swap_control or GLX_MESA_swap_control!
 Failed to set swap interval. Results may be bounded above by refresh rate.
[texture] texture-filter=linear: FPS: 170 FrameTime: 5.910 ms
=======================================================
                                  glmark2 Score: 163 
=======================================================
[workstation user ~]%

Enabled:

[workstation user ~]% glmark2                     
=======================================================
    glmark2 2023.01
=======================================================
    OpenGL Information
    GL_VENDOR:      VMware, Inc.
    GL_RENDERER:    SVGA3D; build: RELEASE;  LLVM;
    GL_VERSION:     4.1 (Compatibility Profile) Mesa 22.3.6
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0 samples=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 634 FrameTime: 1.578 ms
[build] use-vbo=true: FPS: 885 FrameTime: 1.131 ms
[texture] texture-filter=nearest: FPS: 855 FrameTime: 1.170 ms
[texture] texture-filter=linear: FPS: 861 FrameTime: 1.162 ms
[texture] texture-filter=mipmap: FPS: 851 FrameTime: 1.176 ms
=======================================================
                                  glmark2 Score: 816 
=======================================================
[workstation user ~]%
1 Like