Page 1 of 1
Virtualbox could not map shared folder from CentOS host
Posted: 28. Jun 2010, 11:36
by sokha
I have a problem of mounting shared folder from CentOS host OS to Ubuntu 10 LTS guest OS. I already read the HOWTO in
http://forums.virtualbox.org/viewtopic.php?f=3&t=15868 but I could not make it work.
I have done these already:
1. (HOST): VBoxManage sharedfolder add "ubuntu_vpn" -name "media" -hostpath "/home/username/media"
2. (GUEST): VBoxLinuxAdditions is already installed in Guest OS successfully
3. Reboot Guest OS
4. I try to use both commands:
Code: Select all
sudo mount -t vboxsf media /home/username/shared
and
Code: Select all
sudo mount.vboxsf media /home/username/shared
Those two commands give the same error:
Code: Select all
mounting failed with the error: Protocol error
Any solution? I posted this problem also in LQ:
http://www.linuxquestions.org/questions ... st-816564/
Re: Virtualbox could not map shared folder from CentOS host
Posted: 28. Jun 2010, 13:11
by frank
Please attach (use the attach function) the VBox.log file of such a VM session where you tried to mount the shared folder.
Re: Virtualbox could not map shared folder from CentOS host
Posted: 28. Jun 2010, 20:15
by Sasquatch
I have no problems with the command you used and the shared folder it created. Which version of VB are you using?
Re: Virtualbox could not map shared folder from CentOS host
Posted: 29. Jun 2010, 01:18
by sokha
Frank Mehnert wrote:Please attach (use the attach function) the VBox.log file of such a VM session where you tried to mount the shared folder.
Please see the attached file. I had tried with several shared folder name but still get the same error message. I also used different shared folder path.
Sasquatch wrote:I have no problems with the command you used and the shared folder it created. Which version of VB are you using?
Code: Select all
VBoxManage showvminfo ubuntu_vpn
Sun VirtualBox Command Line Management Interface Version 3.0.14
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.
Name: ubuntu_vpn
Guest OS: Other/Unknown
UUID: f88aadaa-e92e-43f8-9843-0bfce6939b36
Config file: /home/username/.VirtualBox/Machines/ubuntu_vpn/ubuntu_vpn.xml
Memory size: 256MB
VRAM size: 8MB
Number of CPUs: 1
Boot menu mode: message and menu
Boot Device (1): DVD
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
Hardw. virt.ext: on
Nested Paging: off
VT-x VPID: off
State: aborted (since 2010-06-18T08:14:19.000000000)
Monitor count: 1
3D Acceleration: off
Floppy: empty
SATA: disabled
IDE Controller: PIIX4
Primary master: /home/username/.VirtualBox/HardDisks/ubuntu_vpn.vdi (UUID: e2140201-8915-4599-8a9a-2a23dde45233)
DVD: empty
NIC 1: MAC: 08002702FBE3, Attachment: Bridged Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
UART 1: disabled
UART 2: disabled
Audio: disabled
Clipboard Mode: Bidirectional
VRDP: disabled
USB: disabled
USB Device Filters:
<none>
Shared folders:
Name: 'vpn_shared', Host path: '/home/username/public_html/shared' (machine mapping), writable
Guest:
Statistics update: disabled
I also reinstall Guest Addition several times too.
Re: Virtualbox could not map shared folder from CentOS host
Posted: 29. Jun 2010, 09:29
by frank
Hmm, are you sure that the path /home/username/public_html/shared exists on your host and that the user who started the VM is able to write to this folder?
Re: Virtualbox could not map shared folder from CentOS host
Posted: 29. Jun 2010, 10:52
by sokha
Frank Mehnert wrote:Hmm, are you sure that the path /home/username/public_html/shared exists on your host and that the user who started the VM is able to write to this folder?
I was thinking that too but that username has fully permission in that host directory:
Code: Select all
[username@server ~]$ ll /home/username/public_html
...
drwxr-xr-x 3 username username 4096 Jun 27 07:09 shared
....
Re: Virtualbox could not map shared folder from CentOS host
Posted: 29. Jun 2010, 15:42
by frank
Does this path contain any symbolic/hard links?
Re: Virtualbox could not map shared folder from CentOS host
Posted: 29. Jun 2010, 18:52
by sokha
Frank Mehnert wrote:Does this path contain any symbolic/hard links?
No, there is no link.
Re: Virtualbox could not map shared folder from CentOS host
Posted: 29. Jun 2010, 20:23
by Sasquatch
The log suggests you have defined other shared folders and it keeps on resetting when you try to access it, or when the VM tries to load them (or you reset the VM yourself).
Code: Select all
138:33:54.931 SharedFolders host service: connected, u32ClientID = 1
138:34:07.853 SharedFolders host service: request to map folder media
138:34:07.853 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
..
139:01:29.108 Changing the VM state from 'RUNNING' to 'RESETTING'.
....
138:44:22.176 SharedFolders host service: connected, u32ClientID = 4
138:45:19.849 SharedFolders host service: request to map folder /home/username/media
138:45:19.849 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
..
144:42:43.332 Changing the VM state from 'RUNNING' to 'RESETTING'.
....
144:45:04.492 SharedFolders host service: request to map folder media
144:45:04.492 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
144:47:55.754 SharedFolders host service: request to map folder shared
144:47:55.755 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
....
171:22:15.809 SharedFolders host service: request to map folder vpn_shared
171:22:15.809 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
Re: Virtualbox could not map shared folder from CentOS host
Posted: 30. Jun 2010, 01:33
by sokha
Sasquatch wrote:The log suggests you have defined other shared folders and it keeps on resetting when you try to access it, or when the VM tries to load them (or you reset the VM yourself).
I tried to change the host shared folder name and remap the sharedfolder, the Guest OS still says the same error. I notice that
VERR_FILE_NOT_FOUND in the log too. So, what would you recommend I should do?
Thanks,
Re: Virtualbox could not map shared folder from CentOS host
Posted: 30. Jun 2010, 15:19
by frank
Please start the VM from a terminal like this:
Code: Select all
sudo chmod u+s /usr/bin/strace
strace -s128 -o ~/log -f /usr/lib/virtualbox/VirtualBox --startvm VM_NAME
Then try to access the shared folder from the guest, then shutdown the VM, wait for some seconds and then compress the resulting ~/log file and attach it here.
Re: Virtualbox could not map shared folder from CentOS host
Posted: 30. Jun 2010, 20:08
by Sasquatch
Before creating the log, recheck the defined shared folders. If you don't have a GUI to work with, use the following command:
Remove those that are invalid or no longer needed. I think that you defined a couple of invalid shared folders when looking for the proper command to add a shared folder. If it still doesn't work, create the log asked by Frank.
ps. Sorry Frank, I hope we can do without the log.
Re: Virtualbox could not map shared folder from CentOS host
Posted: 1. Jul 2010, 01:57
by sokha
Sasquatch wrote:Before creating the log, recheck the defined shared folders. If you don't have a GUI to work with, use the following command:
Remove those that are invalid or no longer needed. I think that you defined a couple of invalid shared folders when looking for the proper command to add a shared folder. If it still doesn't work, create the log asked by Frank.
ps. Sorry Frank, I hope we can do without the log.
I just remove the sharedfolder and do it again. After removing sharedfolder:
Code: Select all
[username@host ~]$ VBoxManage showvminfo ubuntu_vpn
Sun VirtualBox Command Line Management Interface Version 3.0.14
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.
Name: ubuntu_vpn
Guest OS: Other/Unknown
UUID: f88aadaa-e92e-43f8-9843-0bfce6939b36
Config file: /home/username/.VirtualBox/Machines/ubuntu_vpn/ubuntu_vpn.xml
Memory size: 256MB
VRAM size: 8MB
Number of CPUs: 1
Boot menu mode: message and menu
Boot Device (1): DVD
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
Hardw. virt.ext: on
Nested Paging: off
VT-x VPID: off
State: aborted (since 2010-06-18T08:14:19.000000000)
Monitor count: 1
3D Acceleration: off
Floppy: empty
SATA: disabled
IDE Controller: PIIX4
Primary master: /home/username/.VirtualBox/HardDisks/ubuntu_vpn.vdi (UUID: e2140201-8915-4599-8a9a-2a23dde45233)
DVD: empty
NIC 1: MAC: 08002702FBE3, Attachment: Bridged Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
UART 1: disabled
UART 2: disabled
Audio: disabled
Clipboard Mode: Bidirectional
VRDP: disabled
USB: disabled
USB Device Filters:
<none>
Shared folders: <none>
Guest:
Statistics update: disabled
After adding sharedfolder name: vpn_shared
Code: Select all
[username@host ~]$ VBoxManage showvminfo ubuntu_vpn
Sun VirtualBox Command Line Management Interface Version 3.0.14
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.
Name: ubuntu_vpn
Guest OS: Other/Unknown
UUID: f88aadaa-e92e-43f8-9843-0bfce6939b36
Config file: /home/username/.VirtualBox/Machines/ubuntu_vpn/ubuntu_vpn.xml
Memory size: 256MB
VRAM size: 8MB
Number of CPUs: 1
Boot menu mode: message and menu
Boot Device (1): DVD
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
Hardw. virt.ext: on
Nested Paging: off
VT-x VPID: off
State: aborted (since 2010-06-30T23:36:58.000000000)
Monitor count: 1
3D Acceleration: off
Floppy: empty
SATA: disabled
IDE Controller: PIIX4
Primary master: /home/username/.VirtualBox/HardDisks/ubuntu_vpn.vdi (UUID: e2140201-8915-4599-8a9a-2a23dde45233)
DVD: empty
NIC 1: MAC: 08002702FBE3, Attachment: Bridged Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: Am79C973, Reported speed: 0 Mbps
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
UART 1: disabled
UART 2: disabled
Audio: disabled
Clipboard Mode: Bidirectional
VRDP: disabled
USB: disabled
USB Device Filters:
<none>
Shared folders:
Name: 'vpn_shared', Host path: '/home/username/public_html/shared' (machine mapping), writable
Guest:
Statistics update: disabled
Now in Ubuntu Guest OS:
Code: Select all
username@vpn:~$ sudo mount.vboxsf vpn_shared /home/username/host_shared
(error: mount.vboxsf: mounting failed with the error: Protocol error)
@Frank:
Code: Select all
strace -s128 -o ~/log -f /usr/lib/virtualbox/VirtualBox --startvm ubuntu_vpn
Failed to open the X11 display!
Could I use VBHeadless?
At this point I am wondering about one thing. I run the Guest OS by using
/usr/bin/VBoxHeadless -startvm VM_NAME. Could it be the cause?
Re: Virtualbox could not map shared folder from CentOS host
Posted: 1. Jul 2010, 02:33
by Perryg
Just a little something that I have found out. You can not use characters in the share name so loose the _ and no spaces either call it vpnshare, or share. Something simple.
Re: Virtualbox could not map shared folder from CentOS host
Posted: 4. Jan 2011, 02:33
by jdmader
removing the underscore "_" from the absolute path of a directory (changed "/foo/bar/my_dir" to "/foo/bar/mydir") also fixed the following error detail for me (vbox 4.0.0)
VBoxManage: error: Shared folder named 'solaris_share' already exists
VBoxManage: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component SessionMachine, interface IMachine, callee nsISupports
Context: "CreateSharedFolder(Bstr(name).raw(), Bstr(hostpath).raw(), fWritable, fAutoMount)" at line 730 of file VBoxManageMisc.cpp