Skip to content

Re-introducing USB pass-though but using YAML argument "usb" instead o…#4825

Open
FlUxIuS wants to merge 1 commit intolima-vm:masterfrom
PentHertz:master
Open

Re-introducing USB pass-though but using YAML argument "usb" instead o…#4825
FlUxIuS wants to merge 1 commit intolima-vm:masterfrom
PentHertz:master

Conversation

@FlUxIuS
Copy link
Copy Markdown

@FlUxIuS FlUxIuS commented Apr 10, 2026

Compared to v1.2.3, attaching a USB device is impossible without using the video parameter in a YAML configuration for an instance to inject qemu-xhci,id=usb when running QEMU.

So we introduced a usb: true|false parameters that allows to do so.

@@ -1 +0,0 @@
cidata.TEMPLATE.d/user-data No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remain the symlink

Comment thread pkg/driver/qemu/qemu.go
args = append(args, "-device", "qemu-xhci,id=usb-bus")
} else if *y.USB {
// Add USB controller without display for USB device passthrough
args = append(args, "-device", "qemu-xhci,id=usb-bus")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the qemu-xhci device can be unconditionally added?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, maybe I'm also focusing too much on making it work on macOS Apple Silicon. So maybe the parameter usb should be qemu-xhci instead of true

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or something else

Comment thread pkg/limayaml/default.yaml
@@ -1 +0,0 @@
../../templates/default.yaml No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remain symlink

Comment thread pkg/limatype/lima_yaml.go
Firmware Firmware `yaml:"firmware,omitempty" json:"firmware,omitempty"`
Audio Audio `yaml:"audio,omitempty" json:"audio,omitempty"`
Video Video `yaml:"video,omitempty" json:"video,omitempty"`
USB *bool `yaml:"usb,omitempty" json:"usb,omitempty" jsonschema:"nullable"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
USB *bool `yaml:"usb,omitempty" json:"usb,omitempty" jsonschema:"nullable"`
USB USB `yaml:"usb,omitempty" json:"usb,omitempty" jsonschema:"nullable"`

For consistency with Audio and Video

Comment thread pkg/driver/qemu/qemu.go
args = append(args, "-device", "virtio-"+input+"-pci")
args = append(args, "-device", "qemu-xhci,id=usb-bus")
} else if *y.USB {
// Add USB controller without display for USB device passthrough
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the passthrough implementation?
How did you test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants