-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
"virtualbox: Enable hardening by default" breaks VirtualBox #5283
Comments
VirtualBox with hardening support requires the main binaries to be setuid root. Using VBOX_WITH_RUNPATH, we ensure that the RPATHs are pointing to the libexec directory and we also need to unset VBOX_WITH_ORIGIN to make sure that the build system is actually setting those RPATHs. The hardened.patch implements two things: * Set the binary directory to the setuid-wrappers dir so that VboxSVC calls them instead of the binaries from the store path. The reason behind this is because nothing in the Nix store can have the setuid flag. * Excempt /nix/store from the group permission check, because while it is group-writeable indeed it also has the sticky bit set (and also the whole store is mounted read-only on most NixOS systems), so we're checking on that as well. Right now, the hardened.patch uses /nix/store and /var/setuid-wrappers directly, so someone would ever want to change those on a NixOS system, please provide a patch to set those paths on build time. However, for simplicity, it's best to do it when we _really_ need it. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Geesh, seems to only happen with VBoxManage directly, going to have a look at it later, thanks for reporting. |
I'm seeing this just by starting VirtualBox. An error dialog with the same text also shows up.
|
@ambrop72: Did you start it using the setuid wrapper? What does |
Forgot to say that I don't use the virtualbox nixos service. I just:
I know this is not a supported configuration. But I don't want to use the virtualbox-host nixos service because it uncodnitionally sets up a network interface. I see that this module does add a setuid wrapper around VirtualBox which I do not have. I'm wondering, why did it work before (4.3.18 I think)? |
Ah, you might want to add But since we now have a NixOS module for VirtualBox it might be a good idea to allow disabling the set up of the vboxnet interface. |
I went with the disabling approach, works okay now, thanks! #5300 |
@iElectric: This is not solved yet! Currently working on a fix and a test. |
My VBox is also broken although I'm not sure if by the commit in question and if even same problem. NS_ERROR_FACTORY_NOT_REGISTERED is given if I try to start it up. |
FTR my issue was due to some permissions going wrong on /tmp/.vbox-$USER-ipc in case anyone wonders in the future. Removing the file made the problem fix itself. And pushed fix works for the issue at hand too ;) |
I think this is going to be more painful than what it seems. We still don't know if every old virtualbox usage works after the hardening has landed. I suggest to remove virtualbox hardening from 14.12, and let it settle in master for future backport in 14.12 cc @iElectric |
Hi there on current unstable I do now get the same error:
In the config I have:
|
I suspect it's #22914 |
Unfortunately #22914 didn,'t help. Sill have the same issue: 17.09pre105060.0a6a06346a (Hummingbird) |
@sjau: Is this only the case when you're enabling the extension pack? |
meanwhile it works again for me. |
Let's close until someone can reproduce it (again). |
We only need to have setuid-root wrappers for VBox{Headless,SDL} and VirtualBox, otherwise VBoxManage will run as root and NOT drop privileges! Fixes NixOS#5283. Signed-off-by: aszlig <aszlig@redmoonstudios.org> (cherry picked from commit 0d71ec8)
Commit 3e49487 breaks VirtualBox (at least for users, I haven't tried it as root) by creating files in
/root/VirtualBox VMs
:Reverting 3e49487 (as I did in 9dcdeed) yields the expected behavior:
In both cases I use following configuration:
The text was updated successfully, but these errors were encountered: