Skip to content
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

toolbox: failed to create container: open /dev/vboxusb: permission denied #247

Closed
zapateo opened this issue Sep 3, 2019 · 11 comments
Closed
Labels
1. Bug Something isn't working 5. Help Wanted Extra attention is needed

Comments

@zapateo
Copy link

zapateo commented Sep 3, 2019

When I run the command

$ toolbox create -c mycontainer

I get the output:

toolbox: failed to create container mycontainer

Running toolbox with the -v option I get

$ toolbox -v create -c mycontainer
toolbox: resolved absolute path for /usr/bin/toolbox to /usr/bin/toolbox
toolbox: checking if /etc/subgid and /etc/subuid have entries for user gianluca
toolbox: TOOLBOX_PATH is /usr/bin/toolbox
toolbox: checking if 'podman system migrate' exists
toolbox: migration not needed: 1.5.1 is unchanged
toolbox: Fedora generational core is f30
toolbox: base image is fedora-toolbox:30
toolbox: container is mycontainer
toolbox: checking value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: parsing value /var/run/.heim_org.h5l.kcm-socket (Stream) of property Listen in sssd-kcm.socket
toolbox: checking if 'podman create' supports --dns=none and --no-hosts
toolbox: 'podman create' supports --dns=none and --no-hosts
toolbox: looking for image localhost/fedora-toolbox:30
toolbox: looking for image registry.fedoraproject.org/f30/fedora-toolbox:30
toolbox: base image fedora-toolbox:30 resolved to registry.fedoraproject.org/f30/fedora-toolbox:30
toolbox: checking if container mycontainer already exists
toolbox: /home/gianluca canonicalized to /home/gianluca
toolbox: checking if /home is a symbolic link to /var/home
toolbox: calling org.freedesktop.Flatpak.SessionHelper.RequestSession
toolbox: creating container mycontainer
Error: open /dev/vboxusb: permission denied
toolbox: failed to create container mycontainer

The problem seems to be in line: Error: open /dev/vboxusb: permission denied

System informations

  • Toolbox version 0.0.12
  • Podman version 1.5.1
@HarryMichal
Copy link
Member

Hi @zapateo, thanks for the ticket. Did this issue appear after you updated your system? Also you are using classic Fedora Workstation, right?

@zapateo
Copy link
Author

zapateo commented Sep 3, 2019

toolbox used to work properly on my system; after that, I updated/installed/removed software many times before finding out that it stopped working, so I can't establish what broke it.

Yes, I'm using Fedora Workstation.

@wesleysliao
Copy link

I'm having the same issue. I'm running Fedora 30 Silverblue with virtualbox layered:

 ● ostree://fedora:fedora/30/x86_64/silverblue

                   Version: 30.20190905.0 (2019-09-05T11:27:32Z)
                BaseCommit: 8790382b1796482b1ab144f2c3c44e625d0d3b674ba31413d93b30644635c5c4
              GPGSignature: Valid signature by F1D8EC98F241AAF20DF69420EF3C111FCFC659B9
           LayeredPackages: VirtualBox fedora-workstation-repositories gnome-tweaks kmod-nvidia xcape xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs
             LocalPackages: rpmfusion-free-release-30-1.noarch rpmfusion-nonfree-release-30-1.noarch

Looking at the permissions of /dev/vboxusb:
drwxr-x---. 3 root vboxusers 60 Sep 5 17:32 vboxusb
I thought maybe to add myself to the vboxusers group with this method but that also fails:

# sudo grep -E '^vboxusers:' /usr/lib/group >> /etc/group
bash: /etc/group: Permission denied

I have no problem entering the existing toolboxes I have, but I can't create any new ones. I also am not sure when this stopped working, I've had several updates since last creating a toolbox.

@HarryMichal
Copy link
Member

HarryMichal commented Sep 10, 2019

I successfully reproduced the issue in a VM. I believe this has to be resolved in VirtualBox itself. The problem seems to be with bind mounting the /dev directory. The vboxusb directory (and the one nested inside) has 750 permission while it should have 755.

To temporarily solve this, you can chmod the permissions manually as administrator. But I recommend checking the permissions of the character device called '002' because you don't want bad permissions :).

@debarshiray
Copy link
Member

toolbox-0.0.11 was the first version where we started bind mounting the entire /dev from the host into the container. That might be when this broke for you.

@zapateo
Copy link
Author

zapateo commented Sep 13, 2019

I manually added myself to the vboxusers group; now I can create and enter containers successfully:

$ toolbox create -c mycontainer
Created container: mycontainer
Enter with: toolbox enter --container mycontainer
$ toolbox enter -c mycontainer
⬢[gianluca@toolbox ~]$ 

but when I run a command using sudo I get the following error:

⬢[gianluca@toolbox ~]$ sudo dnf upgrade
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

Not sure if this problem is related to the current issue. Note that sudo works without any problem on the host and used to work perfectly in containers too (until I have encountered the problem reported in this issue).

System informations

  • toolbox version 0.0.12
  • Linux version 5.2.13-200
  • Running on Fedora 30 Workstation

@HarryMichal HarryMichal added 1. Bug Something isn't working 5. Help Wanted Extra attention is needed labels Nov 7, 2019
@HarryMichal
Copy link
Member

@zapateo, is the issue still happening? Recently I had to deal with VirtualBox on Silverblue and /dev/vboxusb did not have permission set in a bad way anymore.

@zapateo
Copy link
Author

zapateo commented Jul 8, 2020

@zapateo, is the issue still happening? Recently I had to deal with VirtualBox on Silverblue and /dev/vboxusb did not have permission set in a bad way anymore.

No, the issue is not happening anymore. Now I can use toolbox without encountering the problem on:

  • Fedora 32 (Workstation Edition)
  • Fedora 32 (Silverblue, on a virtual machine)

I think that this issue is resolved 🙂

One thing, not sure if related: on both F32 Workstation and F32 Silverblue when I run a command with sudo inside a toolbox this warning is printed on the console:

sudo: setrlimit(RLIMIT_CORE): Operation not permitted

but it seems that everything works as expected.

@HarryMichal
Copy link
Member

Great! Thanks for confirming this!

The issue you're mentioning should already be resolved (#450). Either re-pull your f32/fedora-toolbox images or simply run dnf upgrade in the container.

@debarshiray
Copy link
Member

The root cause here might be #1348

@debarshiray
Copy link
Member

Duplicate of #1348

@debarshiray debarshiray marked this as a duplicate of #1348 Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug Something isn't working 5. Help Wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants