特殊:Badtitle/NS100:VirtualBox/SharedFolders:修订间差异
小 创建新页面为 '{{From|https://help.ubuntu.com/community/VirtualBox/SharedFolders}} {{Languages|UbuntuHelp:VirtualBox/SharedFolders}} Note: Before trying to mount/map shared folder you must ins...' |
小无编辑摘要 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/VirtualBox/SharedFolders}} | {{From|https://help.ubuntu.com/community/VirtualBox/SharedFolders}} | ||
{{Languages|UbuntuHelp:VirtualBox/SharedFolders}} | {{Languages|UbuntuHelp:VirtualBox/SharedFolders}} | ||
== Required: Virtualbox Guest Additions == | |||
Before trying to mount/map shared folder you must install '''Guest Additions''' (run machine and choose "Devices" -> "Install Guest Additions" from the menu. | |||
=== Linux guest === | |||
If you are running a Linux guest, open a terminal and type: | |||
<pre><nowiki> | |||
cd /cdrom | |||
</nowiki></pre> | |||
then, if you have 32 bit system: | |||
<pre><nowiki> | |||
sudo sh VBoxLinuxAdditions-x86.run | |||
</nowiki></pre> | |||
or | |||
<pre><nowiki> | |||
sudo sh VBoxLinuxAdditions-amd64.run | |||
</nowiki></pre> | |||
if you have a 64 bit system. | |||
Make sure you have the image VBOXADDITIONS mounted as cdrom before installing it. | |||
Note: The client OS can not be open when adding share. | Note: The client OS can not be open when adding share. | ||
You will have to '''reboot''' the guest machine. | |||
== Prepare host == | |||
On the host (ubuntu) computer, run | On the host (ubuntu) computer, run | ||
<pre><nowiki> | <pre><nowiki> | ||
第9行: | 第27行: | ||
</nowiki></pre> | </nowiki></pre> | ||
Where "XP" is the name of the virtual machine in [[UbuntuHelp:VirtualBox|VirtualBox]], and "share" is the name of the share as the guest machine will see it. The hostpath must be a fully-qualified path. | Where "XP" is the name of the virtual machine in [[UbuntuHelp:VirtualBox|VirtualBox]], and "share" is the name of the share as the guest machine will see it. The hostpath must be a fully-qualified path. | ||
== Prepare guest == | |||
=== Windows === | |||
On the Windows client, run | On the Windows client, run | ||
<pre><nowiki> | <pre><nowiki> | ||
net use x: \\vboxsvr\share | net use x: \\vboxsvr\share | ||
</nowiki></pre> | </nowiki></pre> | ||
If the client is Linux, | === Linux === | ||
If the client is Linux, you have to mount and connect it to a folder. | |||
Run | |||
<pre><nowiki> | <pre><nowiki> | ||
mount -t vboxfs share mountpoint | mount -t vboxfs share mountpoint | ||
第26行: | 第48行: | ||
</nowiki></pre> | </nowiki></pre> | ||
See Section 4.4 Folder Sharing in the [[UbuntuHelp:VirtualBox|VirtualBox]] documentation. | See Section 4.4 Folder Sharing in the [[UbuntuHelp:VirtualBox|VirtualBox]] documentation. | ||
== Troubleshooting == | |||
<pre><nowiki> | |||
/sbin/mount.vboxsf: mounting failed with the error: Protocol error | |||
</nowiki></pre> | |||
The above error could be one of the following. | |||
=== Reinstall Guest additions === | |||
Virtualbox Guest Additions have to be reinstalled after some updates. | |||
So install them as mentioned on the top of this wiki page. | |||
=== Reboot === | |||
Did you reboot? You have to! | |||
=== WRONG: same name for shared folder / mount point === | |||
'''Do NOT''' use the same name for the mount-point folder. | |||
The following example is '''WRONG''': | |||
<pre><nowiki> | |||
$ cd Desktop | |||
$ sudo mkdir shared | |||
$ sudo mount -t vboxsf -o uid=1000,gid=1000 shared shared/ | |||
/sbin/mount.vboxsf: mounting failed with the error: Protocol error | |||
</nowiki></pre> | |||
The following example is '''CORRECT''': | |||
<pre><nowiki> | |||
$ cd Desktop | |||
$ sudo mkdir ubuntushared | |||
$ sudo mount -t vboxsf -o uid=1000,gid=1000 shared ubuntushared/ | |||
</nowiki></pre> | |||
As you can see, there is no error now. :-) | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年11月17日 (二) 21:05的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/VirtualBox/SharedFolders }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/af | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Afrikaans| [[::VirtualBox/SharedFolders/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ar | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|العربية| [[::VirtualBox/SharedFolders/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/az | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|azərbaycanca| [[::VirtualBox/SharedFolders/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/bcc | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|جهلسری بلوچی| [[::VirtualBox/SharedFolders/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/bg | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|български| [[::VirtualBox/SharedFolders/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/br | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|brezhoneg| [[::VirtualBox/SharedFolders/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ca | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|català| [[::VirtualBox/SharedFolders/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/cs | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|čeština| [[::VirtualBox/SharedFolders/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/de | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Deutsch| [[::VirtualBox/SharedFolders/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/el | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Ελληνικά| [[::VirtualBox/SharedFolders/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/es | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|español| [[::VirtualBox/SharedFolders/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/fa | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|فارسی| [[::VirtualBox/SharedFolders/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/fi | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|suomi| [[::VirtualBox/SharedFolders/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/fr | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|français| [[::VirtualBox/SharedFolders/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/gu | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|ગુજરાતી| [[::VirtualBox/SharedFolders/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/he | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|עברית| [[::VirtualBox/SharedFolders/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/hu | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|magyar| [[::VirtualBox/SharedFolders/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/id | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Bahasa Indonesia| [[::VirtualBox/SharedFolders/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/it | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|italiano| [[::VirtualBox/SharedFolders/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ja | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|日本語| [[::VirtualBox/SharedFolders/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ko | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|한국어| [[::VirtualBox/SharedFolders/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ksh | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Ripoarisch| [[::VirtualBox/SharedFolders/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/mr | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|मराठी| [[::VirtualBox/SharedFolders/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ms | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Bahasa Melayu| [[::VirtualBox/SharedFolders/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/nl | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Nederlands| [[::VirtualBox/SharedFolders/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/no | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|norsk| [[::VirtualBox/SharedFolders/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/oc | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|occitan| [[::VirtualBox/SharedFolders/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/pl | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|polski| [[::VirtualBox/SharedFolders/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/pt | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|português| [[::VirtualBox/SharedFolders/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ro | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|română| [[::VirtualBox/SharedFolders/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/ru | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|русский| [[::VirtualBox/SharedFolders/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/si | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|සිංහල| [[::VirtualBox/SharedFolders/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/sq | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|shqip| [[::VirtualBox/SharedFolders/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/sr | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|српски / srpski| [[::VirtualBox/SharedFolders/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/sv | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|svenska| [[::VirtualBox/SharedFolders/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/th | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|ไทย| [[::VirtualBox/SharedFolders/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/tr | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Türkçe| [[::VirtualBox/SharedFolders/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/vi | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|Tiếng Việt| [[::VirtualBox/SharedFolders/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/yue | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|粵語| [[::VirtualBox/SharedFolders/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/zh | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|中文| [[::VirtualBox/SharedFolders/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/zh-hans | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|中文(简体)| [[::VirtualBox/SharedFolders/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:VirtualBox/SharedFolders | UbuntuHelp:VirtualBox/SharedFolders | {{#if: | :}}VirtualBox/SharedFolders}}/zh-hant | • {{#if: UbuntuHelp:VirtualBox/SharedFolders|中文(繁體)| [[::VirtualBox/SharedFolders/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:VirtualBox/SharedFolders|:VirtualBox/SharedFolders|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :VirtualBox/SharedFolders/zh | | {{#ifexist: VirtualBox/SharedFolders/zh | | {{#ifeq: {{#titleparts:VirtualBox/SharedFolders|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:VirtualBox/SharedFolders|1|-1|}} | zh | | }}
Required: Virtualbox Guest Additions
Before trying to mount/map shared folder you must install Guest Additions (run machine and choose "Devices" -> "Install Guest Additions" from the menu.
Linux guest
If you are running a Linux guest, open a terminal and type:
cd /cdrom
then, if you have 32 bit system:
sudo sh VBoxLinuxAdditions-x86.run
or
sudo sh VBoxLinuxAdditions-amd64.run
if you have a 64 bit system. Make sure you have the image VBOXADDITIONS mounted as cdrom before installing it. Note: The client OS can not be open when adding share. You will have to reboot the guest machine.
Prepare host
On the host (ubuntu) computer, run
mkdir ~/VirtualBoxShare VBoxManage sharedfolder add "XP" -name "share" -hostpath /home/your/shared/folder/VirtualBoxShare/
Where "XP" is the name of the virtual machine in VirtualBox, and "share" is the name of the share as the guest machine will see it. The hostpath must be a fully-qualified path.
Prepare guest
Windows
On the Windows client, run
net use x: \\vboxsvr\share
Linux
If the client is Linux, you have to mount and connect it to a folder. Run
mount -t vboxfs share mountpoint
For the above command if you get error as
mount: unknown filesystem type 'vboxfs'
Then just change the vboxfs to vboxsf means the command will be
mount -t vboxsf share mountpoint
See Section 4.4 Folder Sharing in the VirtualBox documentation.
Troubleshooting
/sbin/mount.vboxsf: mounting failed with the error: Protocol error
The above error could be one of the following.
Reinstall Guest additions
Virtualbox Guest Additions have to be reinstalled after some updates. So install them as mentioned on the top of this wiki page.
Reboot
Did you reboot? You have to!
Do NOT use the same name for the mount-point folder. The following example is WRONG:
$ cd Desktop $ sudo mkdir shared $ sudo mount -t vboxsf -o uid=1000,gid=1000 shared shared/ /sbin/mount.vboxsf: mounting failed with the error: Protocol error
The following example is CORRECT:
$ cd Desktop $ sudo mkdir ubuntushared $ sudo mount -t vboxsf -o uid=1000,gid=1000 shared ubuntushared/
As you can see, there is no error now. :-)