Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5760546
  • 博文数量: 675
  • 博客积分: 20301
  • 博客等级: 上将
  • 技术积分: 7671
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-31 16:15
文章分类

全部博文(675)

文章存档

2012年(1)

2011年(20)

2010年(14)

2009年(63)

2008年(118)

2007年(141)

2006年(318)

分类: LINUX

2008-12-06 00:04:12

================================================================
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) |
给主人留下些什么吧!~~