8000 not possible to share tty (e.g. usb-dongle) devices with privileged containers · Issue #16925 · containers/podman · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
not possible to share tty (e.g. usb-dongle) devices with privileged containers #16925
Closed
@fho

Description

@fho

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I want to run a rootless privileged podman container and access a Sonoff USB zigbee stick in the container.
The container shows up on the host as /dev/ttyACM0.
The host user has access to the device.

In the container the device node is missing.
I found the previous related bugfix #3593.
I believe the issue is that in AddPrivilegedDevices() devices are skipped if their path starts with /dev/tty:

if d.Path == "/dev/ptmx" || strings.HasPrefix(d.Path, "/dev/tty") {
continue
}

Steps to reproduce the issue:

  1. have a tty device to share on the host:
$ ls -la /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Dec 22 18:30 /dev/ttyACM0
$ groups
homeassistant dialout
  1. run a privilieged podman container and check if /dev/ttyACM0 is available:
$ podman run  -i -t --privileged  ghcr.io/home-assistant/home-assistant:2022.12.7 ls /dev/tty*

Describe the results you received:
/dev/ttyACM0 device file does not exist in the container

Describe the results you expected:
/dev/ttyACM0 exists in the container

Additional information you deem important (e.g. issue happens only occasionally):

I can share the device via --device if i start it as unprivileged container.

Output of podman version:

podman version 4.3.1

Output of podman info:

N/A

Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):

N/A

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

No, same if-condition exist in the latest commit in main (d20dbcd) branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.locked - please file new issue/PRAssist humans wanting to comment on an old issue or PR with locked comments.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0