Skip to content

Add USB device support for systemd-vmspawn #42818

Description

@dvzrv

Component

systemd-vmspawn

Is your feature request related to a problem? Please describe

Hi! 👋

In the Signstar project (cc @wiktor-k) we're currently evaluating the use of systemd-vmspawn for a virtualized test environment.
A requirement for this would be to forward a USB device of the host to the virtual machine.
Currently there seems to be no way to make use of qemu's -device options though.

See https://www.qemu.org/docs/master/system/devices/usb.html for more information on the topic.

Describe the solution you'd like

It would be great to enable users of systemd-vmspawn to - in some form - make use of the -device option that qemu offers, e.g. -device qemu-xhci -device usb-host,vendorid=0x1234,productid=0x5678.

Now, when thinking about this naively, this sounds easy, but I'm of course aware that for systemd this will be a bit more involved (given the security features it offers when it comes to services accessing device nodes).
However, maybe a specific/narrow abstraction over only the subset of required options for dealing with USB devices could be feasible and compatible with the security requirements and integration?

As of writing this, I'm not sure whether this is something on the roadmap for systemd-vmspawn or not.
However, I'd be happy to hear your thoughts on this matter.

Describe alternatives you've considered

Current alternatives are to use more full fledged solutions like libvirt, or less involved, more scripted solutions such as calling qemu directly from a shell script.

The systemd version you checked that didn't have the feature you are asking for

261.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions