================================================================
Settings:
step 1:
sudo vim /etc/init.d/mountdevsubfs.sh
Add those lines in the end of do_start()
#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s /dev/bus/usb/.usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
Step 2: Create a group "usbfs" and add yourself to this group
sudo groupadd usbusers
sudo adduser $USER usbusers
Step 3:
for ubuntu 7.10:
sudo vi /etc/udev/rules.d/40-permissions.rules
or ubuntu 8.04/8.10:
sudo vim /etc/udev/rules.d/40-basic-permissions.rules
Search for the following lines
# USB devices (usbfs replacement)
SUBSYSTEM=="usb_device", MODE="0664"
Change them to the following
# USB devices (usbfs replacement)
SUBSYSTEM=="usb_device", GROUP="usbusers", MODE="0664"
Step 4:
sudo vim /etc/group
search for the follow lines
"usbusers:x:1001:yourname"
log the usb device id "1001" (may get difference of yours)
sudo vi /etc/fstab
add follow scripts:
none /proc/bus/usb usbfs devgid=1001,devmode=664 0 0
NOTES: Here group id maybe different with your machine.
Step 5:
sudo reboot
================================================================
Usage:
In HOST:
#lsusb
#kvm -usb -usbdevice host:xxx:xxx
In KVM:
Ctrl+Alt+2
#info usb
#info usbhost
#usb_add host:xxx:xxx
#info usb
#usb_del 0.3
================================================================
Reference:
http://hi.baidu.com/weiqi228/blog/item/5c3fb48f8d7e34fd513d92b2.html
阅读(2266) | 评论(0) | 转发(0) |