Re-mapping pass-thru USB

Solved3 replies
infobro
10 posts

Team.

When a lsusb device number changes, maybe a power cycle, unplug, or whatever causes this, if you have had the USB pass-thru enabled for the device there is seemingly no way to remove it.  I think it's a configuration file issue or something that can be corrected with virsh but that is unclear.

Even though the new device number is then listed in antMan you can't use it, it seems, because the old mapping persists.  This is the problem that I had.  I had an original device number of 0049, something I'm not sure what, caused that to change and I got an error when trying to start the antlet that the device didn't exist.  When I went to look at the listing it wasn't there to be removed from the listing of USB devices because it simply no longer existed.  I tried to select the new device number but that triggered a similar error about the old device number.

I dug around and found the old mapping in a QEMU XML file but changing it there didn't work either, not even removing that device altogether worked.

What is a method for either re-mapping or removing a USB pass-thru device when this type of issue occurs?  Thanks in advance.

daniel.luckStaffAnswerPicked by the antsle Team
551 posts

Hi infobro:

Yes, we've seen this behavior before and we have created bug ticket for the issue.

In the meantime, you can reset the USB pass-through by editing the antlet's XML by using these commands:

For KVM antlets:
virsh edit antlet_name

For LXC antlets:
vc edit antlet_name

Remove the contents between <host dev...> and </hostdev>.

Here's an example of mine:
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='2' device='2'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='1' device='3'/>
</source>
</hostdev>

▲ 1
infobro
10 posts

Daniel,

Thanks.  That's the goto move now, to be clear though, I had to remove that entire XML element <hostdev></hostdev> or I got a validation failure for the edit.  Thanks a bunch for that one.

daniel.luckStaff
551 posts

Hi infobro,

Glad to hear that it was working for you.

Yes, I've had to use that edit on my antlets when having trouble with USB pass through.

▼ 1

Log in to reply. New here? It takes a minute.