Hi
I can’t get USB pass through to work with distrobox.
I also followed the advice on github ( in the issues I could not find references) here for example…
it all works, virt-manager starts , I also install a linux distribution correctly, but there is no way to get usb redirection to work.
ps. even installing virt-manager with flathub there are permissions issues and usb doesn’t work.
I would like to avoid using transactional-update
I don’t know what flavour of distrobox you’re using, but if its a tumbleweed distrobox, you’d need to do sudo zypper in usbutils to get /usr/bin/lsusb it’s not there in the base image.
If it’s arch or fedora, or something else, you’d need to sort out which package provides it.
in the end my goal is to run the usb oscilloscope management program.
the program is here.
And I can do it in 3 ways.
using virt-manager and installing manjaro. in AUR there is the management program. BUT in virt-manager the usb are not passed.
or by entering as root in the same virt-manager container but without launching virt-manager and from there use the install program that is on github. Which is what I did and I finally get to see the management program (written in java) but as in the first case (with manjaro) the instrument is not seen (even if lsusb sees it).
Always permission errors.
ch.ntb.usb.USBException: LibusbJava.usb_open: Permission denied (0)
at com.owon.uppersoft.vds.core.usb.CDevice.open(CDevice.java:86)
at com.owon.uppersoft.vds.core.usb.CDevice.getDevices(CDevice.java:300)
at com.owon.uppersoft.dso.source.usb.USBSourceManager.refreshUSBPort(USBSourceManager.java:79)
at com.owon.uppersoft.dso.source.comm.detect.USBLoopChecker.checkUSBDevice(USBLoopChecker.java:74)
at com.owon.uppersoft.dso.source.comm.USBDaemonHelper.onNotConnecting(USBDaemonHelper.java:35)
at com.owon.uppersoft.vds.machine.InfiniteDaemonTiny0.onNotConnecting(InfiniteDaemonTiny0.java:37)
at com.owon.uppersoft.dso.source.comm.Flow.run(Flow.java:79)
at com.owon.uppersoft.dso.global.ControlAppsTiny$1.run(ControlAppsTiny.java:38)
if instead I use virt manager provided by flathub, then I have the usb redirection that seems active but if I select my tool (which is therefore seen) … permissions error … and therefore I’m at ground.
yes. to tell the truth it is the first thing I had tried. but I always get permission errors. Not only with my scilloscope but also if I try to insert a usb stick into the host.
The strange thing is that if I use gnome boxes and try to mount a usb stick it works. not very well but it works. but even here the oscilloscope is not seen. I think the problem is in the installer of the management program… it sets permissions of the usb ports in some way that evidently are annoying in an immutable distro. well… today if I can I will try to directly install the possible dependencies (a few… I think… java… libusb… rpm-build ) via transactional-update and then try the installation program as root. If there are problems then I will run a rollback
I’ve not had a usecase for doing usb-passthrough to virtual machines, so it’s just not something I’ve looked into. I’m mostly just throwing things against the wall to see what sticks.
If you can see the usbdevice within the distrobox (and have the appropriate permissions to access it from within the distrobox), it has to be something in the virt-manager setup, within the distrobox that’s screwing stuff up.
I don’t know that it’s the issue, but the distrobox you’re attempting to use, is it rootful? i.e. distrobox create --root and have you tried doing it with --init and making sure that systemd is installed in that distrobox?
I installed the main dependencies (java, libusb, rpm-build) via transactional-update. Then I had to modify the installation script because it uses zypper. If I understood correctly, the script tries to understand what type of package manager is used. In our case rpm. Then it runs a build ( rpm or deb or pet or…) installs the generated package by launching the package manager (in our case zypper .and here I replaced it with transactional-update.) and sets the permissions of the usb. Now I should understand how to put everything in the menu… because to start it I must first open konsole with --profile ‘Root Shell’, log in, and run the java program.
I would say that I am satisfied even if I did not understand why it does not work with distrobox or distrobox --root…
There are some things, that require direct hardware access, for whatever reason, that just aren’t covered by things like distrobox, virtualization, or flatpaks. I suspect there might always will be.