Hi all,
I’m using whonix via kvm. I encountered issues with the desktop rendering slowly (jumps when scrolling and trying to play video in fullscreen results in freezes) I tried giving the VM more CPU’s and RAM (6 VCPU cores and 6GB of RAM) but the issue is still there and CPU usage is nowhere near maxed out (only ~20%) does anyone know what might be causing this? Thanks,
btw I run stuff where anonymity is a lower priority (or not possible as I need to sign in) though my regular desktop and vpn using privacy friendly browsers, what other measures can I take to minimize data collection when anonymity is not an option?
Thanks. Anything else I can do to improve rendering performance? I’ve got a decently high-spec machine so it’s easy enough to throw a few cores and a chunk of ram at it but if there’s a better way to do things I’d love to know.
It’s an attempt to protect against host resource exhaustion by a rogue guest. If the performance hit is too much, we can either bump it up or remove it completely.
The performance on Workstation is very poor, and I’m not sure if there’s a way to improve it. It becomes a problem when trying to play a video with VLC. If I try to maximize or fullscreen pretty much any video, the screen tearing is severe, and then the entire virt-manager GUI disappears with the VM still running in the background. I have to re-open virt-manager from my host’s application menu then re-open the VM and attempt to quickly pause the video before it happens again. This is far worse than Virtualbox, where I was easily able to play videos in fullscreen without crashing. I thought KVM was supposed to have better performance, so this doesn’t make sense.
I’ve tried editing the CPU topology to match my host cpu configuration (1 socket, 4 cores, 2 threads), but the performance was the same, if not worse. I’ve tried multiple different combinations of sockets, cores and threads, and nothing helps.
This should be easily reproducible if you just download or drop in any video from YouTube to a Whonix guest via shared folder. I think my CPU should be powerful enough, otherwise why would the performance in Virtualbox be better?
I’ve checked and followed the instructions in the wiki for adding vcpus:
I’ve switched from the virtio to the QXL driver, and performance seems to have improved, but it’s still not ideal. I had to add vgamem and add an entry for xrandr to get 4K resolution[1], but when displaying at 4K the display freezes often, especially when moving a window around too fast. 1080p performs much better, but I wanted 4K. Even on Virtualbox the display would just resize to whatever the current VM’s window’s dimensions were, which I would usually just leave maximized with a 4K host resolution, and I didn’t get nearly as many freezes as I am now using KVM.
I’ve done some more testing on a generic Linux Mint install, and I hate to admit I think this issue may be unspecific to Whonix. I’m getting the same crashes/video playback issues there. I am just in disbelief that so many people say that qemu-kvm is better than Virtualbox, when the performance I’m experiencing on kvm is significantly worse, making me think I still might be doing something wrong…
The QXL driver is unusable, the freezes are rampant. The virtio driver is slightly better but the Virt Manager GUI will abruptly close if it gets overloaded.
Although the CPU usage reported by Virt Manager for the VM does not go very high, my host’s CPU usage reports much higher levels. Simply playing a 1080p YouTube video at full screen with guest 4K resolution raises it up to nearly 80%, and the screen tearing is significant. After a short while Virt Manager will disappear.
My CPU is not very powerful but it’s not old. virsh nodeinfo reports a frequency of 4241 MHz. I would have thought that’d be enough to simply play back video, but maybe not. Supposedly Virtualbox has a form of 3D acceleration enabled by default[1], so maybe that’s why the performance seems so much better
I attempted following the instructions in the below link for CPU pinning, adjusting the commands to match my hardware, and it didn’t do anything. Maybe I’ll continue researching this, because I really wanted to start using kvm, not just for Whonix but in general
I’ve enabled 3D acceleration and the performance has improved. It’s not great but the crashes are no longer happening when playing video, and screen tearing is significantly reduced. I had to install libvirglrenderer1 and qemu-system-gui on the Debian 12 host, otherwise it wouldn’t boot.
Edit: I forgot to mention that I had to change the ‘Display Spice’ setting ‘Listen Type’ to None, then check OpenGL and choose my GPU
I’m going to try this next, but I haven’t found it in the GUI settings yet. I found documentation here, but it just gives virsh commands to change it, doesn’t say anything about completely removing it:
Yes, this should probably be merged with my other post
I found it, it’s toward the top of the XML data in the Overview section
I haven’t noticed much of a difference removing the blkiotune tag, but now with 3D acceleration the performance matches what I’ve come to expect from Virtualbox. It may even be a bit better. I just wish it wasn’t a security risk.
For those following along at home, I remove the CPU pinning settings and bump up their number for the VM and it plays video sufficiently without having to resort to 3D acceleration.