设为首页 收藏本站
查看: 1093|回复: 0

[经验分享] Mac OSX Host 上修复VirtualBox Ubuntu Guest不能访问USB移动硬盘的方法

[复制链接]

尚未签到

发表于 2016-1-11 08:17:36 | 显示全部楼层 |阅读模式
Virtualbox XP Guest等系统中也存在类似问题,主要原因是virtualbox的bug,配置的时候选择cpu数量为1 就可以了。

参考文章如下,(此文在.wordpress.com中,包括blogspot上都有好多优秀的技术文章,都得XX才能看,真是对天朝无语了……)

Ok, ladies and gents. If you are a Mac user, you will probably notice there isn’t much documentation on fixing USB access issues on Ubuntu guest operating system.  After spending hours… I mean literally a half a day traversing Mac OS, Ubuntu, and VirtualBox forums, I finally found the answer in the dead of night. Hope you found this solution faster than I did.  Another day in the life of me. DSC0000.gif

Environment:

Host OS-> MacOS 10.7.4 (OSX Lion) x86_64
VirtualBox 4.1.18 , ext: 4.1.18r78361
Guest OS-> Ubuntu 10.04 AMD 64-bit



Pre-configurations:

In order for your system to utilize the virtual USB 2.0 functionality you need to install two software packages (in order):

    Guest Addition: Start up the guest OS and select “Install Guest Additions”.  It will automatically mount a CD file on your desktop.  It may also automatically attempt to run and execute.  I would recommend executing the “open Autorun prompt” just for ease.  If you are unsure, there are plenty of tutorial including youtube videos online.  You will need to restart your VM for the changes to take effect, but for now just it shutdown.
    Now, download your respective extension pack for your version of VirtualBox here. As you can see in the Environment section, I downloaded VirtualBox 4.1.18 for OS X hosts extension pack (4.1.18r78361).Click on the “VirtualBox” home button and select Preferences.  Switch to the Extension tab.  Click the image of the blue diamond superimposed by an upside -down orange triangle to add the downloaded extension package.You may not need to restart VB, but better safe than sorry.

VirtualBox Configurations:

This is assuming you have your USB devices and/or external hard drives already attached to the host machine.

    Once you have opened the VirtualBox application, select the Ubuntu virtual machine. Make sure the guest OS is not currently running.  Then click on Settings.  Navigate to the Ports tab.  Switch to USB configuration window.
    Enable both USB Controller and USB 2.0 (EHCI) Controller.
    Under the USB Device Filter dialogue, you can either create general USB filter (blue circle) or a specified filter (green plus sign) for a currently attached USB device. I created an instance of both. There will be also integrated host devices, and you most likely have no interest in that.  It could also screw with your hardware peripherals’ functionality.
    IMPORTANT: Now here is one of the essential config options that had me stuck for 12 hours. For some odd reason, your external USB devices will not automatically mount or mount at all if you have more than 1 virtual CPU set for the Ubuntu guest OS.  Even if VB notifies you that the devices have been successfully captured by the VirtualBox, the guest OS will not mount it.  So it is imperative that you keep the vCPU at the minimum.
    [Edit]: Apparently the number of allocated virtual CPU has been an issue dating back to VirtualBox 3.2.10. Peruse this forum if you so desire.

Test Drive!!!

Its time to verify if your configurations has granted you USB access via the Ubuntu guest OS. *Cross fingers*

    First, remove the USB devices.  Run the guest OS, and once you have logged in to the VM, connect the devices.
    A couple things can occur after re-inserting the USB peripherals.Your Mac OS may capture the device first before the guest OS. In that case, in a Finder window, just eject the devices.  The guest OS will then automatically capture the devices. If not, a simple click on the VB’s Device -> USB Devices -> diskimage, where “diskimage” is the manufacture’s hardware name associated with your device, will allow you to select your attached device.  Automatically or manually attaching the device will lead to the external devices mounting on the Linux system.The second case is that maybe the host OS automatically directs the USB access to guest OS.  Again, if it does not automatically mount, you will have to manually perform that operation above.Congratulations, you have USB access now via Ubuntu 10.04 guest OS on a Mac OSX Lion host OS.

Notes:

    If you think you need the vboxuser group on your host machine, you DON’T! Let me reiterate that, vboxuser group is only for installing VirtualBox on Linux distributions (i.e. Ubuntu, Fedora, Solaris).  So move on from those Linux forums because they will not help.
    There are some possible errors that I did not cover because there are a plethora of online sources such as this that provide solutions.  Often, errors can be solved just by properly removing the VirtualBox app from the host OS using the uninstall tool and reinstalling it with both Guest_Addition and appropriate Extension pack.
    To verify if the host-attached USB devices are either “unavailable” or “captured” by VirtualBox, in the Mac terminal execute:
    $ VBoxManage list usbhost

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-162753-1-1.html 上篇帖子: VirtualBox映射主机驱动器共享文件夹的方法 下篇帖子: virtualbox下grub硬盘安装mint 和 archlinux的实践
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表