Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Trouble accessing USB devices. #22

Open
LucidEye opened this issue Feb 15, 2021 · 5 comments
Open

Trouble accessing USB devices. #22

LucidEye opened this issue Feb 15, 2021 · 5 comments

Comments

@LucidEye
Copy link

Thank you for making such an amazing and useful project!!!

However I am having trouble accessing USB devices connected to the pi when inside the container running the image file.

Specifically, I am trying to run Gqrx and other RTL-SDR apps from the PiSDR image... (https://github.com/luigifcruz/pisdr-image)

I have run the volk_profile command (inside the container) to detect and setup the RTL-SDR dongle, and that seemed to work, but when i run Gqrx or any other app that needs to access the SDR USB device from inside the container it tells me it can not open the device, and the device name and serial number do not show in the devices list like it should in any of the apps.

lsusb from inside the container sees the device, but for some reason apps can't access it.

I'm wondering if this is a permissions issue (do i need to run the apps with sudo) or is there some special "porting" we need to setup to pass through full USB functionality from inside the container?

Hope you can help, because this is the only way i can get all the SDR software to work on the latest Raspberry Pi OS.. by running the image file that someone has already done getting all the bugs out of the installation for those apps :-(

Also, another small issue... when running the OS in the container, I changed the default raspberry password, now the OS no longer boots to the desktop in the container, instead it goes to a prompt telling me the login was wrong, then i need to enter the user and new password and manually start the desktop with startx. How do I fix this so the new password is recognized in the container boot up process and it automatically boots to the desktop like it's supposed to?
Thanks

@Botspot
Copy link
Owner

Botspot commented Feb 15, 2021

For your information, Pi Power Tools is not currently being developed.

But luckily, Pi Power Tools simply runs vdesktop, which is a higher priority for me. Vdesktop is dedicated to the virtual machine stuff, and is very easy to use from the command line.
Also it's a lot more flexible. (more features than PPT's wrapper functionality)

For example, you can change vdesktop's username and password.

Enabling USB device passthrough is also possible by changing vdesktop's nspawn shell script. Just add two lines, per device, to the bottom like this:

--bind=/dev/usb0 \
--property="DeviceAllow=/dev/usb0 rwm" \

Final remarks:
Compared to emulators, vdesktop does a sloppy job. It's underlying systemd-nspawn is overly restrictive, and sometimes the Xorg server misbehaves. It took half a year to track down why Chromium always crashed, so if you find problems, there's a good chance I won't have any idea how to fix them.

@LucidEye
Copy link
Author

Thanks for the quick reply :-)
Well that's a bummer that you are no longer developing this.. it's such a useful and time saving tool :-(
The GUI made it all so simple, not having to remember a bunch of cli commands every time i want to run a different image.
Do you have any plans to continue developing Pi Power Tools in the future?
I was going to suggest adding menu options to allow you to enable USB support or add other arguments to the vdesktop run string from within the Pi Power Tools app.... but I guess now I have to find another way to make this work, and I thought I was so close :-(

I know nothing about vdesktop... is there a config file i can edit in your Pi Power Tools app where i can edit the vdesktop run string to use the proper password and tell it to mount the entire device folder from the host to the container using "-v /dev:/dev"?

@Botspot
Copy link
Owner

Botspot commented Feb 15, 2021

Thanks for the quick reply :-)
Well that's a bummer that you are no longer developing this.. it's such a useful and time saving tool :-(
The GUI made it all so simple, not having to remember a bunch of cli commands every time i want to run a different image.
Do you have any plans to continue developing Pi Power Tools in the future?
I was going to suggest adding menu options to allow you to enable USB support or add other arguments to the vdesktop run string from within the Pi Power Tools app.... but I guess now I have to find another way to make this work, and I thought I was so close :-(

I know nothing about vdesktop... is there a config file i can edit in your Pi Power Tools app where i can edit the vdesktop run string to use the proper password and tell it to mount the entire device folder from the host to the container using "-v /dev:/dev"?

Simple reason: Pi-Apps takes almost 100% of my development time. I was hoping Pi-Apps would settle down and fit snugly alongside my other projects, but it's grown much bigger than that to 100+ thousand users. Now it's a hard-to-control monster where I try to keep up with the maintenance and app submissions.
I guess it's a good thing. Pi-Apps was sorely needed by the world, and I'm honored to be the one to get it done. But it doesn't come without sacrifices.

Anyway, don't worry, vdesktop is very easy to use. I wouldn't even say there's a learning curve. And as I said, Pi Power Tools is just a dumbed-down front-end for vdesktop.

So, download vdesktop:

git clone https://github.com/Botspot/vdesktop

Run vdesktop to boot something:

sudo ~/vdesktop/vdesktop /home/pi/2020-08-20-raspios-buster-armhf.img

(After booting something once, vdesktop will create a terminal command vdesktop. Simplicity, I love it.)
Vdesktop has a bunch of easily-changeable config options. To customize the password, you can do this:

VDESKTOP_PASSWORD=1234 vdesktop /home/pi/2020-08-20-raspios-buster-armhf.img

OR, if you want the password changed long-term so you don't have to put it there every time, simply change the line in vdesktop's settings.env config file:

PASSWORD=1234

From now on, vdesktop will use 1234 as the password, instead of raspberry.

@LucidEye
Copy link
Author

Ok, so just to clear up my confusion, if I've already installed Pi Power Tools, then that also installed vdesktop underneath, right?
If that is the case, then making the edits to the vdesktop nspawn shell script like you mentioned will allow me to still run containers from the GUI, only with the USB fixd, correct?
Or do I need to install vdesktop separately? And will the GUI app still function as the front end?
What is the full path to the vdesktop's nspawn shell script for Pi Power Tools? I don't see a "vdesktop" folder in /home/pi.
I would really prefer to continue using the GUI front end, I just need to know the full paths to the config files i need to edit per your suggestions. I'm just trying to get all my SDR software to see my USB dongle for now, don't want to install more stuff if i can easily make what i already have work for the moment.
Thank you for your help.

@Botspot
Copy link
Owner

Botspot commented Feb 15, 2021

Ok, so just to clear up my confusion, if I've already installed Pi Power Tools, then that also installed vdesktop underneath, right?
If that is the case, then making the edits to the vdesktop nspawn shell script like you mentioned will allow me to still run containers from the GUI, only with the USB fixd, correct?
Or do I need to install vdesktop separately? And will the GUI app still function as the front end?
What is the full path to the vdesktop's nspawn shell script for Pi Power Tools? I don't see a "vdesktop" folder in /home/pi.
I would really prefer to continue using the GUI front end, I just need to know the full paths to the config files i need to edit per your suggestions. I'm just trying to get all my SDR software to see my USB dongle for now, don't want to install more stuff if i can easily make what i already have work for the moment.
Thank you for your help.

I suppose that could work. Pi Power Tools does install vdesktop into its own folder: /home/pi/Pi-Power-Tools/vdesktop
If you made those file changes, vdesktop should still work under Pi Power Tools. But this has never been tested.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants