Skip to content

sytemd-nspawn Bind cannot bind mount with dev option #6

@Markus328

Description

@Markus328

I have an issue about systemd-nspawn containers and --placement on-host. It seems like systemd-nspawn cannot bind mount with dev option a path within a nodev /run

Firstly, I was not using --placement on-host and it worked fine, but I want to use nspawn with --private-users=pick and I got permission issues of devices created on /dev/input. seatd rejects inputs with messed ownership even though it has read permission (libinput debug-events works very well, but sway cannot enumerate any device because seatd doesn't want to).

I tried many ways of mounting /dev/input with dev, but I cannot afford to do it while using idmap mounts (to fix ownership). I found out a way that simply mounts a tmpfs on /run/.../dev-input with dev option and here systemd-nspawn copies those options in container, and I can have access to input devices on container.

mkdir -p /run/vuinputd/vuinput/dev-input
mount -t tmpfs -o rw,dev tmpfs /run/vuinputd/vuinput/dev-input

and the passing Bind in nspawn I could get a valid /dev/input inside container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions