Shared folder won't mount

Discussions about using Linux guests in VirtualBox.
ehassick
Posts: 5
Joined: 30. Nov 2009, 16:35
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu Server 9.10 (JeOS)

Re: Shared folder won't mount

Post by ehassick »

I've been trying to figure out how to automount shared folders as well with no success.

I've put this in my /etc/rc.local:

sudo mount -t vboxsf -o uid=1000,gid=1000 code /home/joe/code

But this doesn't do anything.

I'm thinking it doesn't do anything because when I execute that command outside of ~/code, I receive:

/sbin/mount.vboxsf: mounting failed with the error: Protocol error

However, when I'm inside of ~/code and run that command, the shared folder mounts...

What do I have to do to just have this thing automount :?
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: Shared folder won't mount

Post by Sasquatch »

Use a different name. My howto specifically states that you MUST use different names (mount point and share name), or you will likely get a protocol error. Just take a look at your TTY1, there is probably the protocol error.
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.
ehassick
Posts: 5
Joined: 30. Nov 2009, 16:35
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu Server 9.10 (JeOS)

Re: Shared folder won't mount

Post by ehassick »

Alright so:

If the host share and guest folder are the same name, and I run "sudo mount.vboxsf share ~/share" after I log in, it works.
If the host share and guest folder are different, and I run "sudo mount -t vboxsf share ~/share" after I log in, it works.

If I put either of those in /etc/rc.local, nothing automounts upon logging in.
If I put either of those in /etc/fstab, I receive errors.

However, if the share and folder are named differently and I add "share ~/share vboxsf rw,gid=1000,uid=1000,auto 0 0" to /etc/fstab, I receive a "no such device" error and not protocol error.

I just want these things to automount <.<

Edit: Trying what you posted in your howto right now...
Edit: Still can't seem to get this thing to automount.
Last edited by ehassick on 30. Nov 2009, 17:18, edited 1 time in total.
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: Shared folder won't mount

Post by Sasquatch »

Share name != mount point name = successful mount.
Share name == mount point name = unsuccessful mount.
Simple as that.
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.
ehassick
Posts: 5
Joined: 30. Nov 2009, 16:35
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu Server 9.10 (JeOS)

Re: Shared folder won't mount

Post by ehassick »

I have this in /etc/rc.local:

mount -t vboxsf code /home/joe/projects

And still nothing.
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: Shared folder won't mount

Post by Sasquatch »

You have the Guest Additions installed? Working properly? There is no other reason why it would fail. Unless, of course, you're using a distro that doesn't use rc.local. Ubuntu should though.
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.
ehassick
Posts: 5
Joined: 30. Nov 2009, 16:35
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu Server 9.10 (JeOS)

Re: Shared folder won't mount

Post by ehassick »

Ok so this is now in my /etc/fstab:
projects /home/joe/code vboxsf gid=1000,uid=1000,auto 0 0
When I boot up the VM it spits out a bunch of crap:
/sbin/mount.vboxsf: mounting failed with error: No such device
mountall: mount /home/joe/code [291] terminated with status 1
mountall: Filesystem could not be mounted /home/joe/code
/sbin/mount.vboxsf: mounting failed with error: No such device
mountall: mount /home/joe/code [291] terminated with status 1
mountall: Filesystem could not be mounted /home/joe/code
However, when I finally log into the system, the folder is in fact mounted now.

Uh?
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: Shared folder won't mount

Post by Sasquatch »

Reason is in my howto, the module isn't loaded for the SF yet. The client then takes care of it somehow. I had a few VMs that had the fstab part and worked just fine after I logged in to the CLI (they didn't have a GUI). Even my other method, through rc.local worked like a charm, which should be used now in case fstab fails (does that on occasion). The rc.local fix, you did note the command BEFORE the exit 0 entry, right?
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.
fptmark
Posts: 6
Joined: 30. Nov 2009, 12:18
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: ubuntu 9.10

Re: Shared folder won't mount

Post by fptmark »

No, I can not get the share to work no matter what. That is why I've been digging so deeply. I've even try rebuilding the vbox kernel modules (/etc/init.d/vboxadd setup). Everything else (monitor sizing, mouse integration, etc) works fine. I have been through the HowTo's

I started this journey when the mount failed (mount -t vboxsf host_d /ddrive).
ehassick
Posts: 5
Joined: 30. Nov 2009, 16:35
Primary OS: MS Windows Vista
VBox Version: OSE Debian
Guest OSses: Ubuntu Server 9.10 (JeOS)

Re: Shared folder won't mount

Post by ehassick »

Sasquatch wrote:Reason is in my howto, the module isn't loaded for the SF yet. The client then takes care of it somehow. I had a few VMs that had the fstab part and worked just fine after I logged in to the CLI (they didn't have a GUI). Even my other method, through rc.local worked like a charm, which should be used now in case fstab fails (does that on occasion). The rc.local fix, you did note the command BEFORE the exit 0 entry, right?
Yes the mount cmd was before exit 0 in rc.local. I took that out though.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Shared folder won't mount

Post by Perryg »

fptmark wrote:No, I can not get the share to work no matter what. That is why I've been digging so deeply. I've even try rebuilding the vbox kernel modules (/etc/init.d/vboxadd setup). Everything else (monitor sizing, mouse integration, etc) works fine. I have been through the HowTo's

I started this journey when the mount failed (mount -t vboxsf host_d /ddrive).
The actual mounting of the share is first done in the VBox program where you drill down and select the folder you want to share in the shared folder section.
Then you need to give it a simple name with no caps, spaces or characters. Use something like share.

Then you need to create a folder on the linux guest to mount this share.
Example: sudo mkdir /mnt/ddrive

Then you need to use the proper mount statement.

sudo mount -t vboxsf <the name of share> /<the path to the mount folder>
Example: mount -t vboxsf share /mnt/ddrive

After you have confirmed that the mount works then you can put the mount statement in the /etc/rc.local file. (above the exit 0 statement) do not delete the last line of the file.
fptmark
Posts: 6
Joined: 30. Nov 2009, 12:18
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: ubuntu 9.10

Re: Shared folder won't mount

Post by fptmark »

Thanks for your suggestion, but what you gave me were just the basic instructions that I had already said I followed in my first post last nite. I was *much* deeper into this than that surface answer.

It was actually very easy. Whenever dealing with Windows, remember your ABC's. Always Boot the Computer. After I rebooted my Windows host (which I should have done days ago), everything worked fine. I have no idea why that worked, but that's Windows for you ;)
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: Shared folder won't mount

Post by Sasquatch »

ehassick wrote:
Sasquatch wrote:Reason is in my howto, the module isn't loaded for the SF yet. The client then takes care of it somehow. I had a few VMs that had the fstab part and worked just fine after I logged in to the CLI (they didn't have a GUI). Even my other method, through rc.local worked like a charm, which should be used now in case fstab fails (does that on occasion). The rc.local fix, you did note the command BEFORE the exit 0 entry, right?
Yes the mount cmd was before exit 0 in rc.local. I took that out though.
As stated by Perry, don't take it out. It's there for a reason, remove it, and you break it.
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.
Post Reply