I’m using Torizon docker image. I tried starting debian container image from “sudo” and non-sudo (torizon) mode, the result is the same. After entering debian container, I’m always getting permission error when trying to do I/O accesses : serial ports, usb memory stick mount, etc.:
root@824b072dbf7c:/# [12953.249284] sd 0:0:0:0: [sda] No Caching mode page found
[12953.254684] sd 0:0:0:0: [sda] Assuming drive cache: write through
root@824b072dbf7c:/# ls -la /dev/sda*
brw-rw---- 1 root disk 8, 0 Mar 24 17:51 /dev/sda
brw-rw---- 1 root disk 8, 1 Mar 24 17:51 /dev/sda1
root@824b072dbf7c:/# mount /dev/sda1 /media
mount: /media: permission denied.
root@824b072dbf7c:/#
What can I do to get permission?
Greetings @billerica01,
By default a container is a mostly isolated environment from the host however when starting a container you can poke holes in this isolating and allow access to certain peripherals. The method largely depends on what you want the container to have access to.
For UART/serial port access we have an article here: How to Use UART on TorizonCore | Toradex Developer Center
For USB/SD/generic drive access you want to mount the USB outside of the container then use a bindmount (-v flag) with docker run
to then mount the USB in the container.
Perhaps you can mention what other interfaces you’ve been trying to get access too. Make sure to check if we have an existing article here first: Torizon | Toradex Developer Center
Best Regards,
Jeremias