Sys-usb - How to handle "temporary" devices, i.e. tb3 dock

I hope the topic is clear enough, otherwise please feel free to modify it!

sys-usb has assigned (not really surprising) all usb-controllers available and as long as they are actually available, everything works as expected (beside I cant pass ethernet to sys-net, but thats an other story).

But … one of these usb-controllers is the (Lenovo, Gen 2) TB3 Dock device which provides ethernet, audio and ports which is naturally only available when docked/connected. For sure there are a lot more devices which are only temporary available/connected.

And here the problem starts. When the dock is disconnected/unplugged while shutdown, on next boot sys-usb cant start because (Error:) “PCI Device [TB3 dock] does not exist”. The entry in the list of assigned PCI Devices changes to “Unknown Device”.

It cant be that the only solution is to remove this device to get sys-usb started. Maybe I just missed something obvious, sorry then, but there has to be a better solution! Any help welcome!

To make a full picture: As the TB3 Dock device has to be assigned first to sys-usb (again), just plug in (and play) while running is not possible. And unplugging while running most of the times doesnt get recognized.

1 Like

One solution is to have more than one sys-usb - one for ordinary use and
one for docked.
I don’t have any qubes starting by default, but there’s no reason why you
shouldn’t start sys-usb by default, because that will always work.
When you dock, qvm-kill sys-usb and qvm-start sys-usb-dock - you can
bind this to a shortcut, (or even a dbus change) - the pain will be
minimal and it may work for you.

Thanks for your answer!

I had a similar idea, but ended with the same problem: Ethernet :-/ which is the main reason to use this dock.

How would I use this “sys-net+usb”-dock (as I cant assign ethernet from sys-usb-dock to sys-net) as second “sys-net” in parallel to the regular sys-net (holding wifi)? Mainly, how does sys-firewall (as example) gets connected? I cant config multiple networking-vm’s per vm, right? Would I have to switch the current networking-vm to the actual one (sys-net vs sys-(net)-usb-dock)?

second “sys-net” in parallel to the regular sys-net (holding wifi)?

Yep.

Mainly, how does sys-firewall (as example) gets connected?

You can easily switch (while running) using

qvm-prefs sys-firewall netvm sys-net
or
qvm-prefs sys-firewall netvm sys-dock

…since all other qubes get their network from sys-firewall, the switch
will be transparent to them.

second “sys-net” in parallel to the regular sys-net (holding wifi)?

Yep.

Mainly, how does sys-firewall (as example) gets connected?

You can easily switch (while running) using

qvm-prefs sys-firewall netvm sys-net
or
qvm-prefs sys-firewall netvm sys-dock

…since all other qubes get their network from sys-firewall, the switch
will be transparent to them.

Yes, I have a script to do this for docking, tied to a keyboard toggle
shortcut.
It also “fixes” entries in other custom scripts to make sure that the
“right” sys-usb is being addressed.
If you do use any scripts, don’t forget to make the change there too.