New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/virtualbox-guest: support VMSVGA graphics adapter #86473
Conversation
@bachp thanks for this, I run into this issue and was looking for a solution. One question, I noticed that I'm also wondering if virtualbox guest addition should install libnotify when that package is installed with x11, when I added this package the error popup shows up, which would help diagnosing problems like this in the future. Will this be backported in 20.03? |
AFAIK the VBoxVGA model is somewhat deprecated / in maintenance mode, so switching to VMSVGA is the right choice. I've also verified that the screen resizing now works with VMSVGA |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/does-anybody-have-working-automatic-resizing-in-virtualbox/7391/4 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/does-anybody-have-working-automatic-resizing-in-virtualbox/7391/6 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Do we also need to have the generated OVA appliance use VMSVGA? --- a/nixos/modules/virtualisation/virtualbox-image.nix
+++ b/nixos/modules/virtualisation/virtualbox-image.nix
@@ -72,6 +72,7 @@ in {
audiocontroller = "ac97";
audio = "alsa";
audioout = "on";
+ graphicscontroller = "vmsvga";
rtcuseutc = "on";
usb = "on";
usbehci = "on"; |
Indeed looks like it is needed. Without it, the appliance built with |
The library could not be loaded which prevented autoresizing when using the VMSVGA adapter.
VMSGVA is recommended by virtualbox for Linux clients. Compared to VBoxVGA and VBoxSVGA it also supports 3D acceleration. Adding the driver makes nixos work with all three supported graphics card types.
Virtualbox recommends VMSVGA for Linux guests. It is also currently the only one supporting 3D acceleration and it works out of the box with NixOS and auto screen resizing.
@bachp I was able to run it by adding: systemd.services.virtualbox-resize = {
description = "VirtualBox Guest Screen Resizing";
wantedBy = [ "multi-user.target" ];
requires = [ "dev-vboxguest.device" ];
after = [ "dev-vboxguest.device" ];
unitConfig.ConditionVirtualization = "oracle";
serviceConfig.ExecStart = "@${config.boot.kernelPackages.virtualboxGuestAdditions}/bin/VBoxClient -fv --vmsvga";
}; to Looking at other distros they also add it as a service. |
@takeda I think we should take this up in a separate PR improving on this one. Are you OK with this? |
@bachp sorry I just noticed your response. Yes, I think it is better to have something working right now than nothing. |
Anything remaining here? |
This makes VMSVGA the default and recommended graphics adapter for virtualbox.
Motivation for this change
Currently with virtualbox 6.1.6 guest resizing is broken.
Also Virtualbox complains that
VBoxVGA
is not the recommended graphics adaptere for linux guests, and thatVMSVGA
should be used. In newer versions of Virtualbox (6.1+)VMSVGA
seems to be the only adapter supporting 3D acceleration (#81850).This PR makes
VMSVGA
work out of the box in NixOS, including Auto resize and 3D acceleration.Things done
I tested the resulting machine with:
VMSVGA
with 3D (OK)VMSVGA
without 3D (OK)VBoxVGA
(OK, no auto resize)VBoxVGA
is still supported, but I could not test autoresizing as it is currently broken, even before my changes.sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)