LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-31-2020, 07:56 PM   #1
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 72

Rep: Reputation: Disabled
Trying to wrestle with usb permissions and passing through devices. (Qemu/VMS)


Hello slackers, I recently made this thread, and I figured it would be better to respond in here since I haven't gotten a response from LQ's Virtualization forum in over 48 hours to my question.

I am almost there with a gamer's VM, but I just have a few more hurdles that are proven to be quite obnoxious. I need guest audio and I need to transfer some backed-up data from an external to my guest.
  • Data Transfer
trying to do it through XFCE has resulted in no success. I can read manuals and learn things but I didn't know where to start to transfer through network-related programs.

At this point I tried to pass through a usb port using this line along with my other usb options.
Code:
-device usb-host,hostbus=3,hostport=2
The other options worked, but for that usb port, all I got was "permissioned denied", so it seems like I was having a permissions issue.

I ended up finding this thread, and hoping things would work I blindly adjusted a command from that thread to the one below.

Code:
chmod a+w /dev/bus/usb/003/002
Nothing seems to have happened because I still kept getting permission denied.

I personally want to pass the usb through rather than use networking (or some kind of hack involving copying what I want to a disk image and plugging that to the vm.) That way, only only would I be able to drop USB disks in and out at will, I could use game controllers or other usb devices whenever I needed or felt like it.
  • Audio
A few reddit posts I've seen mention either passthough onboard, connected to a USB DAC (which I have), or the other way around. I tried reading up how to do this on the qemu wiki, and I didn't know where or how to start, so I ran this command:

Code:
bash-5.0$ qemu-system-x86_64 -audio-help
Environment variable based configuration deprecated.
Please use the new -audiodev option.

Equivalent -audiodev to your current environment variables:
(Since you didn't specify QEMU_AUDIO_DRV, I'll list all possibilities)
-audiodev id=pa,driver=pa
-audiodev id=alsa,driver=alsa
-audiodev id=oss,driver=oss
-audiodev id=sdl,driver=sdl
-audiodev id=none,driver=none

// from lspci
...
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
...
Tried testing out my onboard audio's functionality to see if it worked on the host. Nothing. Audio works fine through my DAC, otherwise. What kind of driver do I need so I can pass through either one?

thank you for your help!

Last edited by lawnm0wer; 03-31-2020 at 07:57 PM. Reason: typo
 
Old 04-01-2020, 01:09 PM   #2
Ian M
LQ Newbie
 
Registered: Oct 2017
Location: UK
Distribution: Slackware 14.2
Posts: 23

Rep: Reputation: Disabled
Quote:
Originally Posted by lawnm0wer View Post

I ended up finding this thread, and hoping things would work I blindly adjusted a command from that thread to the one below.
Have you tried following the advice right at the bottom of that thread about adding a udev rule to give your user write access to the USB port. That works for me, I don't know if there's a better way of doing it.

Sorry I don't know anything about doing audio pass through.
 
Old 04-01-2020, 02:16 PM   #3
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 72

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ian M View Post
Have you tried following the advice right at the bottom of that thread about adding a udev rule to give your user write access to the USB port. That works for me, I don't know if there's a better way of doing it.

Sorry I don't know anything about doing audio pass through.
I never thought of using that because there wasn't a /etc/udev/rules.d/flash.rules file, and I didn't think you could add a new file.

It works (and the guest is being uncooperative with it, typical windows.), but even though it's a mostly permanent solution, I still would have to add every single device I plan to use by hand to the udev rules. It's clunky, but a good enough solution.

Thank you.
Now, it's just a matter of linking my host and guest audio- either through hardware means or software.

EDIT: I think I might be able to pass the DAC through to the guest, and link the host through my onboard soundcard, my problem is, my onboard sound is an HDA (intel) device, and I don't know where I can get the software to get that to work.

Last edited by lawnm0wer; 04-01-2020 at 02:25 PM.
 
Old 04-01-2020, 02:24 PM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 7,240

Rep: Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932Reputation: 4932
Quote:
Originally Posted by lawnm0wer View Post
I never thought of using that because there wasn't a /etc/udev/rules.d/flash.rules file, and I didn't think you could add a new file.
Just to give you the info... The system comes with udev rules in /lib/udev/rules.d/ and these should not be edited by a user. But /etc/udev/rules.d/ is designed to allow adjustment to the udev system by users. By default, Slackware will put a 70-persistent-net.rules file in there to try and ensure your network devices always stay the same, but you are able to add any additional rules that you might need to your system.

And if you find out that a rule in /lib/udev/rules.d/ isn't doing what you want it to do, you can copy that rule to /etc/udev/rules.d/ and make the changes there. If there are two rules that are named the same, the rules in /etc/udev/rules.d/ will always take precedence.
 
1 members found this post helpful.
Old 04-01-2020, 02:41 PM   #5
Ian M
LQ Newbie
 
Registered: Oct 2017
Location: UK
Distribution: Slackware 14.2
Posts: 23

Rep: Reputation: Disabled
Quote:
Originally Posted by lawnm0wer View Post
I still would have to add every single device I plan to use by hand to the udev rules. It's clunky, but a good enough solution.
I don't think you should have to do that, as far as I know, once you've given write access to the usb hub anything you plug into it should work,
 
Old 04-01-2020, 07:20 PM   #6
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 72

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ian M View Post
I don't think you should have to do that, as far as I know, once you've given write access to the usb hub anything you plug into it should work,
it doesn't.

Code:
bash-5.0$ vms start avm
starting avm ...

//after plugging a different USB drive in.
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/003/014: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/003/014: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/003/014: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
I've tried this for two different external hard drives. same result.

EDIT: would adding the unconnected hub in the udev rules achieve a more uniform result than just passing each device as it's connected?

EDIT2: I think a good amount of the usb hubs on my case and motherboard are in fact just single ports treated as a hub... If so, then that may explain why I'm having this issue.

Last edited by lawnm0wer; 04-01-2020 at 08:32 PM. Reason: reformatting code for clarity
 
Old 04-01-2020, 08:51 PM   #7
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 72

Original Poster
Rep: Reputation: Disabled
Here's my lsusb, with no devices connected

Code:
bash-5.0# lsusb
bash-5.0# lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 013 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 006 Device 002: ID 0d8c:8808 C-Media Electronics, Inc. USB Advanced Audio Device
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 012 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 011 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0bda:0811 Realtek Semiconductor Corp. 802.11ac WLAN Adapter 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 010 Device 011: ID 17f6:0862 Unicomp, Inc Unicomp R7_2_10x_Kbrd_v7_37
Bus 010 Device 010: ID 1af3:0001 Kingsis Peripherals ZOWIE Gaming mouse
Bus 010 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
EDIT: Is it normal for a device number to increase each time it's pulled out and reinserted into the port? each time I do that with a flash drive on my case's outside ports, it happens.

Last edited by lawnm0wer; 04-01-2020 at 09:13 PM.
 
Old 04-05-2020, 03:11 PM   #8
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 72

Original Poster
Rep: Reputation: Disabled
Turns out, rebuilding the VM from scratch and passing -M q35 has fixed the USB issue but has the unintended side-effect of causing issues with the guest not being able to see the GPU... I'm really getting sick of this "untangle one knot only to find the other side has knotted up again" crap.

Since this is about usb issues, I will mark this one solved and make a new thread for which to resolve these issues.

Last edited by lawnm0wer; 04-05-2020 at 03:13 PM.
 
  


Reply

Tags
passthrough, permissions, qemu, slackware, vms


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
QEMU newbie, audio & data transfer [Slackware Host, Qemu, VMS] lawnm0wer Linux - Virtualization and Cloud 0 03-30-2020 04:44 AM
LXer: How to Wrestle Control of Sudo With Sudoers LXer Syndicated Linux News 0 11-05-2016 07:33 PM
[SOLVED] Problem passing through usb devices in qemu insectiod Slackware 8 11-09-2014 03:53 PM
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
LXer: Gnome and KDE Wrestle With Menus LXer Syndicated Linux News 0 09-30-2009 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration