mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2868] Virtualbox not able to write to /dev/vbox* #1794
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1794
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Niklas974 on GitHub (Jul 23, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2868
I'm using firejail version 0.9.58.2 and VirtualBox Version 6.06 on Ubuntu 19.04
Running virtualbox in firejail using the default virtualbox profile provided by firejail, I run into networking issues when accessing host-only network adapters in the virtualbox "host-only network manager"
(translated: The Host-Network Interface could not be created)
interestingly, /dev/vbox* looks pretty similar from the outside and from inside the virtualbox firejail:
commenting out "caps.drop all" in the virtualbox profile solves the issue locally
I think this should be fixed or at least annotated in the virtualbox profile.
I know that I do not run the latest version of firejail, but the one provided by ubuntu. If you need me to try with the newest version, please let me know.
EDIT: I previously claimed that commenting out "netfilter" would provide a work-around. It turns out that the "caps.drop all" line is the culprit.
Hint for debugging: On closing the virtualbox GUI, it takes a few seconds for the last virtualbox process to end, if you do not wait for them to end, firejail will not reload the config and thus ignore potential changes.
@Fred-Barclay commented on GitHub (Jul 29, 2019):
Thanks for reporting this @Niklas974 !
Besides the error messages, does this cause any issues with virtualbox? If it's just error messages then it's probably better to say these are just cosmetic issues and not change/remove
netfilter, but if it actually means you can't use firejail+virtualbox then we should maybe change this.Thanks!
Fred
@Niklas974 commented on GitHub (Jul 29, 2019):
NOTE: I edited the original report, it is not "netfilter" but "caps.drop all" that causes the problem!
Hi @Fred-Barclay ,
thank you for helping with this issue!
Using the original config file provided by firejail, VirtualBox does work, at least the following do not work:
a) adding new Host-Only Network Interfaces in the Host-Only Network Manager
b) Accessing the external Network using NAT Interfaces. I have tried using a ubuntu host and a kali Linux Guest, I cannot ping external machines if the "caps.drop all" line is in the config file. Commenting it out and not changing anything else, I can ping external machines.
(see hints on Virtualbox Networking here)
@rusty-snake commented on GitHub (Jul 29, 2019):
@Niklas974
getcap /usr/bin/V*@Niklas974 commented on GitHub (Jul 29, 2019):
(From outside of firejail)
Am I missing something obvious?
@rusty-snake commented on GitHub (Jul 29, 2019):
Same with
getcap /usr/lib64/virtualbox/V* # or where ever on your systemor?@Niklas974 commented on GitHub (Jul 29, 2019):
@rusty-snake commented on GitHub (Jul 29, 2019):
Well, no idea more how to findout what we need for
caps.keep.@Vincent43 commented on GitHub (Jul 30, 2019):
AFAIK vbox uses full suid binaries instead of caps.
@Niklas974 could you show
ls -al /usr/lib/virtualbox?Also could you try replacing
caps.drop allwithcaps.keep sys_adminin profile?Alternatively
caps.keep net_raw,sys_nice@Niklas974 commented on GitHub (Aug 6, 2019):
@Vincent43
ls -alis attached at the bottomcaps.drop allI cannot add and delete host only network adapters, and I cannot use NAT network adapters from within guestscaps.keep sys_adminI can add and delete host only network adapters, but I cannot use NAT network adapters from within guestscaps.keep net_raw,sys_niceI cannot add and delete host only network adapters, but I can use NAT network adapters from within guestscaps.keep sys_admin,net_raw,sys_niceI can add and delete host only network adapters, and I can use NAT network adapters from within guests@Vincent43 commented on GitHub (Aug 7, 2019):
So, this one looks sufficient.
@Niklas974
One more thing before we add it: could you try replacing
sys_adminwithnet_admin, likecaps.keep net_admin,net_raw,sys_nice?@Niklas974 commented on GitHub (Aug 13, 2019):
I have just tried
caps.keep net_admin,net_raw,sys_niceand with this directive I cannot add and delete host only network adapters.@Vincent43 commented on GitHub (Aug 13, 2019):
Ok, we go for
sys_adminthen, thx for testing.@githlp commented on GitHub (Jan 19, 2022):
with this profile i still cannot change the IPv4 address for adapter and DHCP server when adding a Host-only network.
I already created an exception like described in this manual section:
cat /etc/vbox/networks.conf
* 10.0.0.0/8 192.168.0.0/16* 2001::/64and now it works when called dircetly via
/usr/bin/virtualboxBut with firejail i still get this error message:
@ghost commented on GitHub (Jan 19, 2022):
@githlp The virtualbox profile has
private-etc, but that currently doesn't include/etc/vbox. If you can confirm your setup is working when addingprivate-etc vboxto a virtualbox.local IMO we should fix our profile.@githlp commented on GitHub (Jan 19, 2022):
that did not work, the error message remains the same.
@ghost commented on GitHub (Jan 20, 2022):
I noticed the original fix from
d94e38a53fgot changed later on. Did you see the comment about needingsys_adminfor host-only network? I can't find the commit that took that out of the originalcaps.keep sys_admin,net_raw,sys_nicebut that could just be a side-effect of a github etc reorganization we went through. Did you try adding sys_admin to caps.keep yet, in combination withprivate-etc vbox?@githlp commented on GitHub (Jan 20, 2022):
Yes, I followed the comment within virtualbox.profile and added sys_admin to the caps.keep line. I just checked again and both is fullfilled:
/etc/firejail/virtualbox.profile
caps.keep sys_admin,net_raw,sys_nice~/.config/firejail/virtualbox.local
private-etc vbox@ghost commented on GitHub (Jan 20, 2022):
@githlp Good. In that case you have some detective work to do. Adding
ignore caps.keepandignore private-etcto virtualbox.local would be where I'd start. You might need to go through a few different combinations here. TIP: keep a terminal open in which you tail journalctl (or syslog if you don't have a systemd system) so you can spot any relevant errors in there. When in doubt, post errors somewhere online and provide a link here so we can assist.@githlp commented on GitHub (Jan 20, 2022):
well with this setting in virtualbox.local the host-based network adapter can be set up/modified
private-etc vboxignore caps.keepbut does it make sense to ignore the caps.keep completely ?
i still get those messages in journal every time i start virtualbox
and this is the output on the shell
0bin.net
@githlp commented on GitHub (Jan 21, 2022):
The network does not get a connection on the default route 10.0.2.15, too.
Started without firejail it works on same config settings.
@ghost commented on GitHub (Feb 3, 2022):
@githlp Apologies for the radio-silence. The pastebin has expired but here's what I see in my notes:
ignore nodvd(the blacklist violations suggest VBox tries to access /dev/sr0);@githlp commented on GitHub (Feb 7, 2022):
but still no connection on my 10.0.2.x virtual eth