zoukankan      html  css  js  c++  java
  • VirtualBox 及一些特殊USB(无驱动)的识别问题(二)解决了不能识别一些特殊USB的问题(其实就是插着USB重启,很简单)

    原来手机怎么也连不上Linux ,碰巧这几天又在搞VirtualBox虚拟,刚好手机当时又插上USB的,重启了下,识别出来了:),只要重启电脑,不作如下设置,手机都能被识别(不知原因) ;作个标记,有时间再慢慢研究。(或者按下面流程过一遍,再恢复原状,手机就可以被识别了 ),求解?(请各位知道具体情况的留言,谢过)

    再论述一下我的问题吧:

    卸载了手机之后,仍可以用 lsusb 查看到其USB与PC的连接;如下:
    “Samsung SemiConductor, Inc. ”

    但问题来了,这时候mount -a 就不能成功加载我的手机了,当然,df 也没有它的踪影;请各位指点!

    如果要在VB下识别USB,正常程序还是按以下的来;


    这是别人的总结,也不知道其链接了,在此谢过;

    VirtulaBox下U盘设置
    一、想起了VirtualBox安装目录下有一个UserManual.pdf的使用手册,便查看关于USB的相关设置。
    总的来说意思有如下几 点:
    1.确保正在使用VirtualBox的用户是否为用户组vboxusers一员.
    2.确保该用户是否有权限去读写usbfs这个文件系统
    3.修改/proc/bus/usb没有效果,只能通过修改/etc/fstab文件。
    4.修改/etc/fstab文件,让USB用户组必须有权限去读写usbfs.加入:
    none /proc/bus/usb usbfs devgid=85,devmode=664 0 0
    其中devgid, 85为USB用户组的id。 devmode,664 为对usbfs 文件系统的权限664
    5.如果系统没有usb用户组,那么你需要用vboxusers这个在安装VirtualBox的时候产生的用户组。

    二、了解后,接着下 一步:
    2.1、添加当前用户为vboxusers一员
    [root@localhost yorks]# cat /etc/group |grep vboxusers
    vboxusers:x:501:
    [root@localhost yorks]# /usr/sbin/usermod -G vboxusers -a yorks
    [root@localhost yorks]# cat /etc/group |grep vboxusers
    vboxusers:x:501:yorks


    2.2、 查看是否有USB的用户组
    [root@localhost yorks]# cat /etc/group|grep usb
    [root@localhost yorks]# cat /etc/group|grep USB
    [root@localhost yorks]#
    这里两个都没有,因 为没有任何东西输出。

    2.3、修改/etc/fstab文件。
    [root@localhost yorks]# echo "none /proc/bus/usb usbfs devgid=501,devmode=664 0 0" >> /etc/fstab
    [root@localhost yorks]# tail -2 /etc/fstab
    /dev/sda7 /home ext3 defaults 0 0
    none /proc/bus/usb usbfs devgid=501,devmode=664 0 0
    [root@localhost yorks]#
    注意:501是在2.1查到的 vboxusers组id.

    2.4、重新执行/etc/fstab的挂载操作。
    [root@localhost yorks]# mount -a
    mount: none already mounted or /proc/bus/usb busy
    [root@localhost yorks]#
    出错了。

    2.5、google: none /proc/bus/usb usbfs devgid=501,devmode=664 0 0,结果:
    ************Fedora中文论坛里面的说的。发现/proc/bus/usb和/sys /bus/usb/drivers不同,于是就试着修改,将/proc/bus/usb换成/sys/bus/usb/drivers。**********
    再次测 试:
    [root@localhost yorks]# mount -a
    [root@localhost yorks]#
    这次没 有错误了。接着打开VirtualBox,出现了这个提示:
    不鸟它。启动guest,插上U盘,提示找到新硬件...OK啦。。享用吧。

    从这个链接也得到了一些启发:

    http://www.phpfans.net/ask/answer1/6861957371.html

    附:VirtualBox USB解决方案之官方原文

    USB

    To get USB support, you need the PUEL (non-free) version. Via the GUI, there is an option to enable USB. Furthermore, your user must be able to access /proc/bus/usb/* Since Gutsy, /proc/bus/usb is not mounted by default. Version 2.0.6 removes the need for the following lines to be added, but /proc/bus/usb must still be mounted. Previously, in Intrepid, you needed to add the following lines to /etc/init.d/mountdevsubfs.sh right after domount devpts "" /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE but before the ending } for the dostart shell function. For Gutsy and Hardy you just need to edit /etc/init.d/mountdevsubfs.sh and uncomment the following lines:

            #
            # Magic to make /proc/bus/usb work in virtualbox version < 2.0.6
            #
            mkdir -p /dev/bus/usb/.usbfs
            domount usbfs "" /dev/bus/usb/.usbfs usbfs -obusmode=0700,devmode=0600,listmode=0644
            ln -s .usbfs/devices /dev/bus/usb/devices
            mount --rbind /dev/bus/usb /proc/bus/usb

    Then run the script that you just edited:

    sudo /etc/init.d/mountdevsubfs.sh start

    In order to give users in the vboxusers group write permissions to the devices in /proc/bus/usb, you'll need to edit some rules in /etc/udev/rules.d. Under Gutsy, edit /etc/udev/rules.d/40-permissions.rules to say the following:

    # USB devices (usbfs replacement)
    SUBSYSTEM=="usb_device",                MODE="0664", GROUP="vboxusers"

    Under Hardy and Intrepid, edit /etc/udev/rules.d/40-basic-permissions.rules to say the following:

    # USB devices (usbfs replacement)
    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="vboxusers"
    SUBSYSTEM=="usb_device",                MODE="0664", GROUP="vboxusers"

    Then, restart the udev service:

    sudo /etc/init.d/udev restart

    Now, if you haven't done it already, make sure your user is part of the group vboxusers using the following command:

    sudo usermod -G vboxusers -a `whoami`

  • 相关阅读:
    广域网(ppp协议、HDLC协议)
    0120. Triangle (M)
    0589. N-ary Tree Preorder Traversal (E)
    0377. Combination Sum IV (M)
    1074. Number of Submatrices That Sum to Target (H)
    1209. Remove All Adjacent Duplicates in String II (M)
    0509. Fibonacci Number (E)
    0086. Partition List (M)
    0667. Beautiful Arrangement II (M)
    1302. Deepest Leaves Sum (M)
  • 原文地址:https://www.cnblogs.com/dartagnan/p/2003574.html
Copyright © 2011-2022 走看看