Problem with shared folders

Discussions about using Linux guests in VirtualBox.
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 »

No, we don't mean that. We mean that you have two places where write privileges are set: on the Host with NTFS security and on the Guest with the mount command and UID parameter option.
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 »

I think I've misrepresented my systems since you mentioned the whole Mac-writing-to-NTFS thing

My first system: A custom built PC running Windows 7 x64. I have an Ubuntu 10.04 guest on this system that gets read-only access and an XP guest that gets write access to the host's Download folder.

My second system: A MacBook Pro that runs Snow Leopard with 64-bit kernel extensions on. For testing, I installed an XP guest and an Ubuntu guest on this system. In no way is the MBP trying to access the first system's Windows installation. The XP guest once again gets full access to this system's user's Downloads folder. The Ubuntu guest can't even mount that share.

This is why I don't think it's just a host permissions issue. I'm getting a failure on two different folders on two different systems with two different permissions structures.
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 »

And what is the full command you use to mount the shared folders in Linux and what is the output of it (if you don't get any output, meaning the mount succeeded, post the output of the mount command with the SF line)?
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 »

mount -t vboxsf Dl /home/entegy/Desktop/Dl

I'm naming the shared folder the same thing on both systems.

On my Windows PC, the mount succeeds, but in read-only.
On my MacBook: I get the following error: /sbin/mount.vboxsf mounting failed with the error: Invalid argument.

The Dl folder is created in advance. Also remember that early in this topic I tried your advice to not name the folder the same thing as the shared folder and it didn't solve anything.
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 »

Ok, too bad about the name not working, but try lower case name only, and a bit longer perhaps. Take the names I used in my howto.

As for the read-only part, that's discussed in my howto too, use "-o uid=1000,gid=1000", or whatever UID/GID your VM user has.
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 »

How would you find uid and gid?
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 »

type id in terminal
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 »

Alright, I modified my commands in rc.local with this:

Code: Select all

mount -t vboxsf -o rw,uid=1000,gid=1000 Box /home/entegy/Desktop/Box
mount -t vboxsf -o rw,uid=1000,gid=1000 hostdownload /home/entegy/Desktop/Dl
No luck still. On Windows host, the hostdownload folder remains read-only. Haven't tried on MacBook yet (it's dead and I forgot the AC adaptor at a friend's...)
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 have to understand what you are trying to do with sharing your "Windows home directory like Downloads" is not going to happen without changing the security that has been imposed on that folder by Windows.

Windows has locked that folder down and you will need to change the permissions on it to make it happen.
VirtualBox shared folders are not at the security level that it needs to be to do that. Look up sharing your Windows 7 home folders on the net and you will find out how to make it happen (although I would strongly suggest that you don't).

For Windows 7 you would need to add the folder to a library and change the permissions by taking ownership (that's right you don't own it) and then change the permissions to allow everyone since VBox uses the generic account to access the share (no login or password). Or you can setup a network share and mount it that way since you can send your login and password. Still not safe and opens a security risk since the login and password are sent in normal text. You will still need to change the permissions as well. Keep in mind that with the addition of UAC Windows expects things to be the way it was set so you probably will have features that don't work properly and your configuration settings may not be able to be stored/saved. That is what I found out when I tried to take ownership of those folders in my tests and had to reload the OS to get the permissions back to where they needed to be to get Windows 7 to work properly.

Anyway you look at this it is a Windows problem and one that you will need to take up with them. Search the MS social network, there are plenty of people that are trying to do this and the suggestions are all over the place. Most don't work and make the OS unusable.

Can't help you with the MAC, but there are a few here that can. From what I know the mount should work if applied properly. You should open a new ticket in the MAC as host section if you still have problems on the MAC.

PS Happy Birthday
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 think I'll just use a subfolder, since that works. Thanks for everything and thanks for the birthday wish. :)
aaronc
Posts: 1
Joined: 12. Jan 2011, 13:37
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Linux, Solaris

Re: Problem with shared folders

Post by aaronc »

I had a problem with this for such a long time, i found the problem was that i had installed some updates that included a new kernel which made my version of vbox additions incompatible with the guest OS, i just reinstalled vbox additions and it worked fine!!
Post Reply