VirtualBox

Ticket #2262 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

USB still no go from non-root account

Reported by: yk Owned by:
Priority: major Component: USB
Version: VirtualBox 2.1.0 Keywords:
Cc: Guest type: Windows
Host type: Linux

Description

Your latest 2.0.2 on a RHEL 5 current (17 Sept 2008) host with a MS Win XP Pro guest is a big improvement, but USB still does not work properly from a non-root account. USB devices are shown as these are inserted into the hardware and recognised by Linux, but are grey and cannot be attached to the MS Win guest from a non-root account. This feature does work as root. Moreover, you have one dangerous provision: you allow the Linux USB pointing device (e.g., a Logitech track ball) to be disconnected from Linux and thus never reconnected without a lot of editing of configuration files as root from a scrolling screen on a plain terminal (e.g., ctrl-alt-F1). The greyed out check box widget is a permission issue, but you should automatically correct this; the pointing device should not be offered if possible or given either protection or a GUI recovery. Without easy access to USB, I will continue to use VMWare in which all of these work as they should.

Change History

comment:1 follow-up: ↓ 2 Changed 6 years ago by frank

To access USB devices as non root you have to remount the /proc/bus/usb directory with the correct permissions so that the VBox user can read /proc/bus/usb/devices and read+write all files in /proc/bus/usb/*/*. We are aware of the fact that this is handling sucks and we are working on a better solution. However, as I said, it is at least possible.

Regarding the pointing device: No USB device is automatically passed to the guest. Either the device has to be explicitly selected in the Devices or there must be a matching filter. Using an empty USB filter matching to every USB device is not a good idea.

comment:2 in reply to: ↑ 1 Changed 6 years ago by yk

Replying to frank: Your method does not work for a Palm PDA using a USB connection and a hotsync button on the PDA. After chmod a+rwx -R /proc/bus/usb, the PDA shows up as a non-grey check box that can be attached to the VirtualBox instance running MS Win XP. However, whenever the hot sync PDA physical connector button is pushed, the check box goes grey. A dynamic application that senses whatever the hotsync button does with respect to the USB mount must make the unit available again to VirtualBox non-root user. In current (6.x) VMware this problem does not happen (in earlier releases, such as 4.x, USB worked no better than current VirtualBox). Note that Linux module visor and the like have been removed from the Linux host as required for Palm to hotsync via VMware. Note that Linux native Palm (but NOT from Palm) applications do not work with my Palm PDA, a TX. Please reply what to do or when you want me to test a fix. I am trying to recommend VirtualBox to my students over VMware because VMware Workstation is not licensed for free to students nor is VMware source available; I am a Professor of Computer Science.

To access USB devices as non root you have to remount the /proc/bus/usb directory with the correct permissions so that the VBox user can read /proc/bus/usb/devices and read+write all files in /proc/bus/usb/*/*. We are aware of the fact that this is handling sucks and we are working on a better solution. However, as I said, it is at least possible.

Regarding the pointing device: No USB device is automatically passed to the guest. Either the device has to be explicitly selected in the Devices or there must be a matching filter. Using an empty USB filter matching to every USB device is not a good idea.

comment:3 follow-up: ↓ 4 Changed 6 years ago by frank

Please could you check if the permissions of any file in /proc/bus/usb changed (without your intervention) after you pushed the sync button?

comment:4 in reply to: ↑ 3 Changed 6 years ago by yk

Replying to frank:

Please could you check if the permissions of any file in /proc/bus/usb changed (without your intervention) after you pushed the sync button?

Below find the output of ls -la of /proc/bus/usb

[root@jb344 bus]# ls -la usb/*/* -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/001/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/002/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/003/001 -rwxrwxrwx 1 root root 64 Sep 24 12:51 usb/003/008 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/004/001 -rwxrwxrwx 1 root root 52 Sep 17 16:14 usb/004/004 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/005/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/006/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/007/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/008/001 -rwxrwxrwx 1 root root 59 Sep 17 16:14 usb/008/003 [root@jb344 bus]# ls -la usb/*/* -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/001/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/002/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/003/001 -rw-r--r-- 1 root root 64 Sep 24 12:56 usb/003/009 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/004/001 -rwxrwxrwx 1 root root 52 Sep 17 16:14 usb/004/004 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/005/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/006/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/007/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/008/001 -rwxrwxrwx 1 root root 59 Sep 17 16:14 usb/008/003 [root@jb344 bus]# chmod -R a+rwx usb [root@jb344 bus]# ls -la usb/*/* -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/001/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/002/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/003/001 -rwxrwxrwx 1 root root 64 Sep 24 12:56 usb/003/009 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/004/001 -rwxrwxrwx 1 root root 52 Sep 17 16:14 usb/004/004 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/005/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/006/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/007/001 -rwxrwxrwx 1 root root 43 Sep 17 16:14 usb/008/001 -rwxrwxrwx 1 root root 59 Sep 17 16:14 usb/008/003

Note that the PDA was on 003/008 but upon pushing the hotsync button on the PDA it changed to 003/009 . Interestingly, the MS Win Palm application did make the hotsync sound when the button was pushed, indicating that 003/008 was alive then (the device was listed by VirtualBox under the device USB button and was shown with an x in the box next to the device under USB, which changed to grey and no x once the hotsync button was pushed), but that something done by the PDA caused 003/008 to be removed and 003/009 to be created. How do I force the permissions to be correct upon creation? Note that after I manually changed the permissions, VirtualBox did not recognize the change -- it only recognizes such things when I restart VirtualBox (shutdown MS Win XP, then exit VirtualBox, then restart VirtualBox, and the USB device is active to VirtualBox USB).

Please reply.

comment:5 Changed 5 years ago by sandervl73

  • Version changed from VirtualBox 2.0.2 to VirtualBox 2.1.0

comment:6 Changed 5 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

This should be fixed in a later version. Please try version 2.2.4 or 3.0.0. On recent Linux distributions we now use links in the sysfs to communicate with USB devices.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use