Cannot write to shared folders

Discussions about using Linux guests in VirtualBox.
Post Reply
tsv
Posts: 2
Joined: 13. Jun 2010, 18:01
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu

Cannot write to shared folders

Post by tsv »

Hi,

I know this problem has come up before but I simply cannot find a solution that helps me out. I have multiple shared folders, made permanent but not read-only, and when I mount them in Ubuntu they mount fine, but I cannot write to them.

I have tried mounting it manually with the following command:

Code: Select all

sudo mount -t vboxsf -o uid=1000,gid=1000 Video video
And adding this line to my fstab:

Code: Select all

Video /home/trevor/Videos vboxsf defaults,rw,uid=1000,gid=1000 0 0
My UID and GID are both definitely 1000.

Help appreciated!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot write to shared folders

Post by Perryg »

tsv
Posts: 2
Joined: 13. Jun 2010, 18:01
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu

Re: Cannot write to shared folders

Post by tsv »

Which part? As far as I can see it tells you to do what I have already tried.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot write to shared folders

Post by Perryg »

First this part cannot be right. Where did you create your mount point? The complete path please

Code: Select all

sudo mount -t vboxsf -o uid=1000,gid=1000 Video video
This looks promising but in the wrong file. fstab gets loaded before the vboxsf so you need this in the /etc/rc.local and the syntax needs to be different (see below)

Code: Select all

Video /home/trevor/Videos vboxsf defaults,rw,uid=1000,gid=1000 0 0
I assume that the mount point is /home/trevor/Videos and the share was called video (notice the case. Linux is case sensitive)
then the mount would be

Code: Select all

mount -t vboxsf -o rw,uid=1000,gid=1000 video /home/trevor/Videos
Add this to the /etc/rc.local and make the rc.local executable. Of course this is all done as sudo. Easy way to do this is start the terminal then type sudo -i <enter> password <enter> then you will stay in sudo as long as that terminal is open.

Here is a copy of my rc.local so you can see where to put the command.

Code: Select all

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
mount -t vboxsf -o rw,uid=1000,gid=1000 Transfer /mnt/Transfer  
exit 0
Oh and one more piece of information for you. Windows is really stubborn about sharing things. The share should not be in your Windows home folder. Best to create a folder yourself and make it available to everyone before you share it.
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: Cannot write to shared folders

Post by Sasquatch »

Added note to Perry's note: The 'special' folders in your Windows user profile, like Downloads, Documents, Videos, Music, etc. are all bound by the same sharing limitations. Either create a new folder to share in your user profile or on a different drive where you have full access/control on.
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