Problem with shared folders

Discussions about using Linux guests in VirtualBox.
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Problem with shared folders

Post by Entegy »

This problem has existed for me under multiple versions of VirtualBox and over multiple host Windows OSs. In all my virtual machines, I give full access for sharing to two folders: J:\, which is my FAT32 partition on an external drive and my user's download folder (C:\Users\Entegy\Downloads).

The problem does not exist in Windows guests, only Linux guests, which in my experience has been Ubuntu 8.10 to 10.04 and Fedora 11 and 12. I always install the latest Guest Additions.

Despite setting both folders for full access, I cannot under any Linux guest get anything other than read-only access to the Downloads folder. The shared J:\ folder works fine. I have tried chmod and chown after mounting but nothing gets me anything but read-only access to that folder once it's been mounted.

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

Re: Problem with shared folders

Post by Perryg »

C:\Users\Entegy\Downloads in Windows 7 is not a file folder. It is a link to the folder. Something Microsoft came up with bless their hearts.
Look at the link in your file manager in Windows 7 and you will see a lock or an arrow indicating this. Even typing in the exact location does not make it work.
Not sure that you will be able to work around this but from the little amount of time I spent on it I decided that I don't need to use the personal folders to share files.
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Problem with shared folders

Post by Entegy »

Umm...? Is the *Entegy* part throwing you off? Sorry, that's my Win7 username. Typing that in exactly works for me. The relative path (what I wish VBox could use) is %Userprofile%\Downloads.

Are you saying that my downloads folder is a junction/symlink to another location?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with shared folders

Post by Perryg »

That's what they tell me. I looked all over for an answer to a few things since I installed Win 7 and no longer had total control of my OS. Search the social what ever in microsoft and you will see a lot of people that have this problem and even some work-arounds that I have not tried. The best I could figure is the user structure is controlled by MS and if you want to take control back you need to do it outside the user folders.
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Problem with shared folders

Post by Entegy »

I fail to see what this has to do with my problem...

Doing a dir on the C drive and following it to my downloads folder clearly indicated they are normal directories. Along the way, all symlinks and junctions are marked as such. The Users directory, my home directory and the download directory are normal directories.

The problem is not getting the Downloads folder to appear in my guest. I can browse it just fine. It's the fact that I'm not getting write access to it when I've told VB to allow it.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with shared folders

Post by Perryg »

Alrighty then. When you get it figured out let me know. I just told you what I was told when I went to MS to find out why it would not work.
Oh and that even though I was an administrator I was not really allowed administrator (full) power unless I shut off UAC and setup the Administrator account to be active.
Which by the way allowed all of this to work properly. Strange huh?
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Problem with shared folders

Post by Entegy »

Not really strange when you think of type of people that make up the majority of Windows users.

And just letting you know that I can't mount the Downloads folder at all on my Macbook. The guest in both current cases is Ubuntu 10.04 x64.

On both systems, I am putting this before exit 0 (and the script executable) as per your advice in another topic into /etc/rc.local to mount the shared folders:

Code: Select all

mount -t vboxsf Box /home/entegy/Desktop/Box
mount -t vboxsf Dl /home/entegy/Desktop/Dl
Both Box and Dl are created before hand are checked for case-sensitivity. On Windows 7, Box mounts fine and Dl becomes read-only. On Snow Leopard, Box mounts fine and Dl isn't mounted at all, returning the error /sbin/mount.vboxsf mounting failed with the error: Invalid argument

Once again, no symlinks involved in the file path to the download folder. So this makes two systems and two operating systems where trying to mount my current user's Downloads folders into the guest fails.
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: Problem with shared folders

Post by Sasquatch »

I made a howto for this, as you can see at the top of the forum listing here. Don't give the SF the same name as the mount point, it can cause problems like that.
There is however an issue with the GA and Ubuntu 10.04 that I am aware of. I can't mount my shared folders on my 10.04 VM either, but my 9.04 VM works just fine with the same GA. No idea about other distro's than Ubuntu.
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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with shared folders

Post by Perryg »

Win 7 32-bit host Ubuntu 10.04 32 bit guest

my line in rc.local
mount -t vboxsf -o rw,uid=1000,gid=1000 Transfer /mnt/Transfer
Permissions of the mount point
drwxrwxrwx 1 perry perry 12288 2010-05-03 11:22 Transfer

Now mount of the Downloads folder
mount -t vboxsf -o rw,uid=1000,gid=1000 Downloads /mnt/Downloads
Permissions of the Downloads folder
dr-xr-xr-x 1 perry perry 8192 2010-05-14 14:25 Downloads

The permissions of this folder since it is controlled by Windows does not change (at least for me in Linux guest)
And I never have problems with the share name and mount point name being the same. Even when I change it it is the same way.
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Problem with shared folders

Post by Entegy »

Sasquatch wrote:I made a howto for this, as you can see at the top of the forum listing here. Don't give the SF the same name as the mount point, it can cause problems like that.
There is however an issue with the GA and Ubuntu 10.04 that I am aware of. I can't mount my shared folders on my 10.04 VM either, but my 9.04 VM works just fine with the same GA. No idea about other distro's than Ubuntu.
Again, the read-only access to the shared folder was the problem. The mounting itself obviously worked because I could read the contents. I did read that how to. Changing the name didn't work. What did work was a subfolder however.
Perryg wrote:Win 7 32-bit host Ubuntu 10.04 32 bit guest

my line in rc.local
mount -t vboxsf -o rw,uid=1000,gid=1000 Transfer /mnt/Transfer
Permissions of the mount point
drwxrwxrwx 1 perry perry 12288 2010-05-03 11:22 Transfer

Now mount of the Downloads folder
mount -t vboxsf -o rw,uid=1000,gid=1000 Downloads /mnt/Downloads
Permissions of the Downloads folder
dr-xr-xr-x 1 perry perry 8192 2010-05-14 14:25 Downloads

The permissions of this folder since it is controlled by Windows does not change (at least for me in Linux guest)
And I never have problems with the share name and mount point name being the same. Even when I change it it is the same way.
Did you try to write anything to the downloads folder from the guest (Not in a subfolder)? Those permissions say you won't be able to, even if you gave VB full access to that folder.


So now I'd like to know if anyone has any idea why the personal folders can't be shared writable.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with shared folders

Post by Perryg »

You can not write to it. Windows will not let you. That is what I have been saying. The only way around this is to change the permissions of the users Downloads folder(not a good idea) or use a different folder. Unless you want to map it via network share Windows is going to restrict this folder to read only. Look at the permissions of that folder in Windows. I bet everyone does not have full access. VirtualBox nor Linux is going to be able to change the permissions.
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Problem with shared folders

Post by Entegy »

You only mentioned it now. You started out with the whole "it's a link" thing, then discovered it was permissions. What's bizarre is that the tested subfolder is inheriting permissions from its parent, yet it's writable under in a guest.
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Problem with shared folders

Post by Entegy »

Actually, I'd also like to know why this only happens on Linux guests! My MacBook is clearly not a Windows host, yet a Windows guest can access the shared Downloads folder can be accessed and written to no problem. Only under Linux do I have ever have problems. This cannot be just a permissions issue.
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: Problem with shared folders

Post by Sasquatch »

Never thought about Host file access? As Perry said, it's a permissions issue on the Host side. You may mount the shared folder with full user privileges, you still need to be able to write to it as any user on the Host side. If that can't be done, the SF might not work properly. So check that.
The reason your Mac Host can access the downloads folder of your Windows installation is because it doesn't care (read: doesn't know) about the NTFS privilege system, thus ignores it and just writes to 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.
Entegy
Posts: 160
Joined: 6. Sep 2008, 23:59
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 x64, XP SP3, Server 2008 R2, Fedora 13 x86/x64
Location: Montreal, Quebec, Canada

Re: Problem with shared folders

Post by Entegy »

Do you mean the other way around? I'm not trying to make my host access my guest's files.
Post Reply