特殊:Badtitle/NS100:VirtualBox/USB:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第4行: | 第4行: | ||
== Set up USB for Virtualbox == | == Set up USB for Virtualbox == | ||
'''''Note: Only the non-free version has USB support at present.''''' | '''''Note: Only the non-free version has USB support at present.''''' | ||
=== For Lucid === | |||
'''''Do not follow these intructions for Lucid. [https://bugs.launchpad.net/ubuntu/+bug/507881 It will render your system unbootable.]''''' | |||
From initial tests, it seems that virtualbox has built in USB support and no longer needs the instructions below anyway (editing fstab to mount usbfs). usbfs is deprecated and (it seems that) [[UbuntuHelp:VirtualBox|VirtualBox]] PUEL changed direct handling of usb devices. | |||
=== For Karmic === | |||
From a terminal run the following command: | |||
<ol><li>Add yourself to the vboxusers group if not already there: -</li></ol> | |||
<pre><nowiki> | |||
if [ "`grep vboxusers /etc/group|grep $USER`" == "" ] ; then sudo usermod -G vboxusers -a $USER ; fi | |||
</nowiki></pre> | |||
==== This works for Karmic 9.10 Host and Windows XP Guest ==== | |||
From a terminal run the following command: | |||
<ol><li>This will check for your vbox user id which you'll need for the next steps.</li></ol> | |||
This will display a line that looks a bit like this: vboxusers:x:123:myself | |||
123 is the user id of your machine you're looking for | |||
<pre><nowiki> | |||
grep vbox /etc/group | |||
</nowiki></pre> | |||
<ol><li>This will edit your FSTAB File</li></ol> | |||
<pre><nowiki> | |||
sudo gedit /etc/fstab | |||
</nowiki></pre> | |||
<ol><li>Add the following line to the bottom of the fstab file: Replace userid with the number displayed from step 1.</li></ol> | |||
<pre><nowiki> | |||
none /proc/bus/usb usbfs devgid=userid,devmode=664 0 0 | |||
</nowiki></pre> | |||
''Example:'' none /proc/bus/usb usbfs devig=123,devmod=664 0 0 | |||
<ol><li>Reboot Ubuntu 9.10 | |||
</li><li>Once logged into Ubuntu 9.10 start [[UbuntuHelp:VirtualBox|VirtualBox]] (Don't power on a guest OS yet) | |||
</li><li>Click Settings from the [[UbuntuHelp:VirtualBox|VirtualBox]] main page for the Windows XP Guest OS | |||
</li><li>Click the System tab on the left side of screen | |||
<ol><li>Enable IO APIC is needs to be selected | |||
</li></ol></li><li>Click the USB tab on the left side of screen | |||
<ol><li>Enable USB Controller and Enable USB 2.0 (EHCI) Controller need to be selected | |||
</li><li>Your USB device should be recognized and ticked in the lower screen. If not, press the 'add' button (to the far right, 2nd one with the green cross) and add it.</li></ol> | |||
10. Power on your Guest OS and USB Should work | |||
=== For Jaunty === | === For Jaunty === | ||
From a terminal run these commands: | From a terminal run these commands: |
2010年5月20日 (四) 00:45的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/VirtualBox/USB }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/af | • {{#if: UbuntuHelp:VirtualBox/USB|Afrikaans| [[::VirtualBox/USB/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ar | • {{#if: UbuntuHelp:VirtualBox/USB|العربية| [[::VirtualBox/USB/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/az | • {{#if: UbuntuHelp:VirtualBox/USB|azərbaycanca| [[::VirtualBox/USB/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/bcc | • {{#if: UbuntuHelp:VirtualBox/USB|جهلسری بلوچی| [[::VirtualBox/USB/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/bg | • {{#if: UbuntuHelp:VirtualBox/USB|български| [[::VirtualBox/USB/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/br | • {{#if: UbuntuHelp:VirtualBox/USB|brezhoneg| [[::VirtualBox/USB/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ca | • {{#if: UbuntuHelp:VirtualBox/USB|català| [[::VirtualBox/USB/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/cs | • {{#if: UbuntuHelp:VirtualBox/USB|čeština| [[::VirtualBox/USB/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/de | • {{#if: UbuntuHelp:VirtualBox/USB|Deutsch| [[::VirtualBox/USB/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/el | • {{#if: UbuntuHelp:VirtualBox/USB|Ελληνικά| [[::VirtualBox/USB/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/es | • {{#if: UbuntuHelp:VirtualBox/USB|español| [[::VirtualBox/USB/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/fa | • {{#if: UbuntuHelp:VirtualBox/USB|فارسی| [[::VirtualBox/USB/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/fi | • {{#if: UbuntuHelp:VirtualBox/USB|suomi| [[::VirtualBox/USB/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/fr | • {{#if: UbuntuHelp:VirtualBox/USB|français| [[::VirtualBox/USB/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/gu | • {{#if: UbuntuHelp:VirtualBox/USB|ગુજરાતી| [[::VirtualBox/USB/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/he | • {{#if: UbuntuHelp:VirtualBox/USB|עברית| [[::VirtualBox/USB/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/hu | • {{#if: UbuntuHelp:VirtualBox/USB|magyar| [[::VirtualBox/USB/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/id | • {{#if: UbuntuHelp:VirtualBox/USB|Bahasa Indonesia| [[::VirtualBox/USB/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/it | • {{#if: UbuntuHelp:VirtualBox/USB|italiano| [[::VirtualBox/USB/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ja | • {{#if: UbuntuHelp:VirtualBox/USB|日本語| [[::VirtualBox/USB/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ko | • {{#if: UbuntuHelp:VirtualBox/USB|한국어| [[::VirtualBox/USB/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ksh | • {{#if: UbuntuHelp:VirtualBox/USB|Ripoarisch| [[::VirtualBox/USB/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/mr | • {{#if: UbuntuHelp:VirtualBox/USB|मराठी| [[::VirtualBox/USB/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ms | • {{#if: UbuntuHelp:VirtualBox/USB|Bahasa Melayu| [[::VirtualBox/USB/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/nl | • {{#if: UbuntuHelp:VirtualBox/USB|Nederlands| [[::VirtualBox/USB/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/no | • {{#if: UbuntuHelp:VirtualBox/USB|norsk| [[::VirtualBox/USB/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/oc | • {{#if: UbuntuHelp:VirtualBox/USB|occitan| [[::VirtualBox/USB/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/pl | • {{#if: UbuntuHelp:VirtualBox/USB|polski| [[::VirtualBox/USB/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/pt | • {{#if: UbuntuHelp:VirtualBox/USB|português| [[::VirtualBox/USB/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ro | • {{#if: UbuntuHelp:VirtualBox/USB|română| [[::VirtualBox/USB/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/ru | • {{#if: UbuntuHelp:VirtualBox/USB|русский| [[::VirtualBox/USB/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/si | • {{#if: UbuntuHelp:VirtualBox/USB|සිංහල| [[::VirtualBox/USB/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/sq | • {{#if: UbuntuHelp:VirtualBox/USB|shqip| [[::VirtualBox/USB/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/sr | • {{#if: UbuntuHelp:VirtualBox/USB|српски / srpski| [[::VirtualBox/USB/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/sv | • {{#if: UbuntuHelp:VirtualBox/USB|svenska| [[::VirtualBox/USB/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/th | • {{#if: UbuntuHelp:VirtualBox/USB|ไทย| [[::VirtualBox/USB/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/tr | • {{#if: UbuntuHelp:VirtualBox/USB|Türkçe| [[::VirtualBox/USB/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/vi | • {{#if: UbuntuHelp:VirtualBox/USB|Tiếng Việt| [[::VirtualBox/USB/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/yue | • {{#if: UbuntuHelp:VirtualBox/USB|粵語| [[::VirtualBox/USB/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/zh | • {{#if: UbuntuHelp:VirtualBox/USB|中文| [[::VirtualBox/USB/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/zh-hans | • {{#if: UbuntuHelp:VirtualBox/USB|中文(简体)| [[::VirtualBox/USB/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/USB | UbuntuHelp:VirtualBox/USB | {{#if: | :}}VirtualBox/USB}}/zh-hant | • {{#if: UbuntuHelp:VirtualBox/USB|中文(繁體)| [[::VirtualBox/USB/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:VirtualBox/USB|:VirtualBox/USB|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :VirtualBox/USB/zh | | {{#ifexist: VirtualBox/USB/zh | | {{#ifeq: {{#titleparts:VirtualBox/USB|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:VirtualBox/USB|1|-1|}} | zh | | }}
<<Include(Tag/ContentCleanup)>>
Set up USB for Virtualbox
Note: Only the non-free version has USB support at present.
For Lucid
Do not follow these intructions for Lucid. It will render your system unbootable. From initial tests, it seems that virtualbox has built in USB support and no longer needs the instructions below anyway (editing fstab to mount usbfs). usbfs is deprecated and (it seems that) VirtualBox PUEL changed direct handling of usb devices.
For Karmic
From a terminal run the following command:
- Add yourself to the vboxusers group if not already there: -
if [ "`grep vboxusers /etc/group|grep $USER`" == "" ] ; then sudo usermod -G vboxusers -a $USER ; fi
This works for Karmic 9.10 Host and Windows XP Guest
From a terminal run the following command:
- This will check for your vbox user id which you'll need for the next steps.
This will display a line that looks a bit like this: vboxusers:x:123:myself 123 is the user id of your machine you're looking for
grep vbox /etc/group
- This will edit your FSTAB File
sudo gedit /etc/fstab
- Add the following line to the bottom of the fstab file: Replace userid with the number displayed from step 1.
none /proc/bus/usb usbfs devgid=userid,devmode=664 0 0
Example: none /proc/bus/usb usbfs devig=123,devmod=664 0 0
- Reboot Ubuntu 9.10
- Once logged into Ubuntu 9.10 start VirtualBox (Don't power on a guest OS yet)
- Click Settings from the VirtualBox main page for the Windows XP Guest OS
- Click the System tab on the left side of screen
- Enable IO APIC is needs to be selected
- Click the USB tab on the left side of screen
- Enable USB Controller and Enable USB 2.0 (EHCI) Controller need to be selected
- Your USB device should be recognized and ticked in the lower screen. If not, press the 'add' button (to the far right, 2nd one with the green cross) and add it.
10. Power on your Guest OS and USB Should work
For Jaunty
From a terminal run these commands:
- Add yourself to the vboxusers group if not already there: -
if [ "`grep vboxusers /etc/group|grep $USER`" == "" ] ; then sudo usermod -G vboxusers -a $USER ; fi
- Enter a root shell, eg
sudo -i
- In that shell, set up /etc/fstab
vGid="`grep vboxusers /etc/group|cut -d\: -f3`" # Determine the devgid for the vboxusers group if [ "$vGid" ] && [ "`grep usbfs /etc/fstab`" == "" ] ; then echo "none /proc/bus/usb usbfs devgid=${vGid},devmode=664 0 0" >>/etc/fstab mount -a fi
Pre-Jaunty
To get USB support, you need the PUEL (non-free) version. Via the GUI, there is an option to enable USB. Since Gutsy, /proc/bus/usb is not mounted by default. 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 # mkdir -p /dev/bus/usb/.usbfs domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644 ln -s .usbfs/devices /dev/bus/usb/devices mount --rbind /dev/bus/usb /proc/bus/usb
In Intrepid the lines required to mount usbfs have been removed entirely, so you need to add the following lines to /etc/init.d/mountdevsubfs.sh at the end of the do_start() function. Note that this is subtly different than the lines required for Gutsy/Hardy. the arguments for the domount function are slightly different from previous versions.
# # Magic to make /proc/bus/usb work # 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`
Finally, log out and login again to apply these changes. See also: [1]