When trying to access ‘/dev/ttyUSB0’ in the toolbox container using silverblue F36 (system release at bottom) the device fails with the following error
Cannot create lockfile for /dev/ttyUSB0: Permission denied
I’ve check the permissions for the device and it’s assigned to ‘nobody:nobody’ and hence won’t allow me to access.
Looked around I found a guide to use ‘udev rules’ to give me permission for the device, Accessing USB serial devices in Fedora Silverblue – Just another Linux geek and I get the following error.
Unfortunately I fail at the following point.
sudo udevadm control --reload-rules
Failed to send reload request: No such file or directory
I’ve restarted both the container and my system and the udev rule hasn’t been applied so I’m not sure how to access the ttyUSB device.
Does anyone know how to access the tty device in a Silverblue toolbox container as I would like to be able to use software from inside toolbox to access the USB device.
To answer my own question it looks like there’s a limitation in the way that toolbox mounts the ‘/dev’ directory limits the permissions to access certain devices.
Given this I’m going to have to go back to Fedora Workstation for the time being.
In case you’re still on Silverblue and haven’t moved to Workstation yet, have you tried distrobox?
It’s like toolbox but with more features, I quite prefer it. I just found out it’s got a rootful mode, for creating toolboxes with full root privileges (though you’d still enter as your user) which retains privileges if you need to access /dev files.
Example:
$ distrobox create --root toolbox
$ distrobox enter --root toolbox
# inside the toolbox...
toolbox:$ % ll /dev/ttyACM0
crw-rw----. 1 root dialout 166, 0 Jun 5 09:19 /dev/ttyACM0
Let me know if this helps. I’m still on Workstation and want to make the move to Silverblue, and access to /dev files inside a toolbox is important to me as well.