Score:0

How to passthrough a device to a podman container?

sd flag

I am running Ubuntu Server 22.04.3 LTS and I am trying to use Podman.

I fail to passthrough a device (in my case /dev/ttyUSB0) to the container.

Running

podman --device /dev/ttyUSB0 ...

just does not have any effect, the device isn't there inside the container.

I also disabled AppArmor just to find out if this is causing my problem, yet no luck.

Score:0
vn flag

It seems your syntax is wrong. It should be like this: (notice the = between the option and the device)

podman run --device=host-device[:container-device][:permissions] ...

In your case that would be:

podman run --device=/dev/ttyUSB0 ...

Also please note that the --device option should be part of the run command when you start the container.

See the reference manual for more info on this.

TorstenS avatar
sd flag
Sorry, of course I used the --device together with the run command. And I have seen both --device /dev/xyz as well as --device=/dev/xyz in verious tutorials. Both doesnÄ work.
TorstenS avatar
sd flag
It turns out the problem appears when I start the container with --privileged
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.