Virtualbox could not map shared folder from CentOS host

Discussions about using Linux guests in VirtualBox.
Post Reply
sokha
Posts: 6
Joined: 28. Jun 2010, 11:05
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Ubuntu

Virtualbox could not map shared folder from CentOS host

Post 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/
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Virtualbox could not map shared folder from CentOS host

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Virtualbox could not map shared folder from CentOS host

Post by Sasquatch »

I have no problems with the command you used and the shared folder it created. Which version of VB are you using?
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
sokha
Posts: 6
Joined: 28. Jun 2010, 11:05
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Virtualbox could not map shared folder from CentOS host

Post 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.
Attachments
VBox.log
(51.4 KiB) Downloaded 25 times
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Virtualbox could not map shared folder from CentOS host

Post 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?
sokha
Posts: 6
Joined: 28. Jun 2010, 11:05
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Virtualbox could not map shared folder from CentOS host

Post 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
....
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Virtualbox could not map shared folder from CentOS host

Post by frank »

Does this path contain any symbolic/hard links?
sokha
Posts: 6
Joined: 28. Jun 2010, 11:05
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Virtualbox could not map shared folder from CentOS host

Post by sokha »

Frank Mehnert wrote:Does this path contain any symbolic/hard links?
No, there is no link.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Virtualbox could not map shared folder from CentOS host

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
sokha
Posts: 6
Joined: 28. Jun 2010, 11:05
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Virtualbox could not map shared folder from CentOS host

Post 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,
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Virtualbox could not map shared folder from CentOS host

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Virtualbox could not map shared folder from CentOS host

Post 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:

Code: Select all

VBoxManage showvminfo "vm name"
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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
sokha
Posts: 6
Joined: 28. Jun 2010, 11:05
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Virtualbox could not map shared folder from CentOS host

Post 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:

Code: Select all

VBoxManage showvminfo "vm name"
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?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Virtualbox could not map shared folder from CentOS host

Post 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.
jdmader
Posts: 1
Joined: 4. Jan 2011, 02:16
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Solaris 10

Re: Virtualbox could not map shared folder from CentOS host

Post 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
Post Reply