USB & Target Boards¶
Alloy Host can pass USB devices (debuggers, boards, programmers) from your host into a VM or WSL2 environment. USB is not supported on the docker backend—use vm or wsl2, or map devices with docker run --device outside alloy-host.
Prerequisites¶
USB passthrough uses VirtualBox. On Linux, add your user to vboxusers:
Run alloy-host on the host OS (Windows, macOS, or Linux)—not only inside WSL without usbipd setup.
Install usbipd-win on Windows and attach devices to WSL before using alloy-host inside WSL:
After installing, reboot. From an elevated PowerShell:
Then use alloy-host usb from your WSL distro.
Not supported. Use --backend vm or wsl2 for on-target debug and flash.
List connected USB devices¶
With a VM name, see which devices are already attached to that environment:
Output is a text block per device (vendor/product, bus ID, attachment state)—not a fixed column table.
Attach a device¶
Syntax: alloy-host usb attach <device> [name]
<device> is a number from usb list, a partial name, or a bus ID.
Inside the VM, verify with lsusb after alloy-host ssh arm-dev.
Flash firmware¶
alloy-host ssh arm-dev
# inside the guest:
lsusb
JLinkExe -device nRF9160 -if SWD -speed 4000 -commandfile flash.jlink
Detach a device¶
Check attachment status¶
Shows attachments across environments (no VM name argument).
Troubleshooting¶
Device not visible in the guest
Linux permission denied
Install udev rules for your debugger in the blueprint (see Extending blueprints).
WSL2 on Windows
Complete the usbipd bind / attach --wsl steps in PowerShell before alloy-host usb attach in WSL.