USB devices
Hand a USB device on your Mac to a Linux instance - including hardware macOS has no driver for.
On this page 5 sections
Some devices macOS simply has no driver for: a development board, a programmer, a vendor-specific dongle, a piece of lab equipment whose manufacturer only ever shipped a Linux driver. Plug one into a Mac and nothing happens. Linux, very often, knows exactly what it is.
MSL can hand the device over. It carries it into the instance over USB/IP, which has been part of Linux since 2008 and is built into every image MSL ships - so there is nothing to install on the Linux side and no driver to find.
Seeing what is there#
msl usb list
| Column | What it tells you |
|---|---|
LOCATION | The device's location ID, which is what you pass to attach. It is the port it is plugged into, so it changes if you move it. |
ID | Vendor and product, as vendor:product. You can use this instead of the location ID. |
macOS DRIVER | Which of macOS's own drivers is holding it, or none - native. |
ATTACHED TO | Which instance has it, if any. |
That third column is the one that matters, because it decides which of two quite different things happens next.
A device macOS does not know#
msl usb attach 00100000 work
This is the case MSL is built for. Nothing on your Mac has claimed the device, so MSL opens it and serves it to the instance directly. No password, no approval, nothing to grant. It appears in the guest a moment later and lsusb lists it like any other device.
A device macOS does know#
Most things you own are in this group: anything speaking USB serial (macOS ships drivers for the FTDI, CH34x, CP210x and Prolific chips), anything CDC-ACM, and every flash drive. macOS has already claimed it, so MSL has to take it, and taking hardware away from the system needs an administrator password.
MSL asks for it with a prompt that says what it is for, and only a small helper program runs with those privileges - never the whole app, and never anything between one attach and the next. The attachment lasts as long as that command: press Ctrl-C, or close the window, and the device goes back.
Giving it back#
msl usb detach 00100000 work
macOS picks the device up again by itself. So does stopping or hibernating the instance - nothing is left stranded, and you never have to unplug something physically to get it back.
An instance holding a device will not be paused or hibernated by the idle timer, because a paused machine cannot answer the device and it would appear to die.
Checking it works, with nothing plugged in#
msl usb test work
This attaches a device MSL makes up: it has no hardware behind it, and exists so the whole path - the connection into the guest, the kernel attach, the protocol - can be checked on a Mac with nothing connected. If it appears in the instance, passthrough itself is working, and anything that then fails is about that particular device.