Sharing drives or folders

Discussions about using Linux guests in VirtualBox.
deathtical
Posts: 11
Joined: 15. Jan 2011, 12:25
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: XP SP3

Re: Sharing drives or folders

Post by deathtical »

Still having issues...
Image

Am starting to remember why I stopped using linux at home. I already work on and fix computers all day at work. Just want something simple at home. Not giving up yet though. Thanks.
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Sharing drives or folders

Post by fixedwheel »

what is the exact name you give to the share in the guests VBox settings?
pennywhistle
Posts: 4
Joined: 15. Dec 2008, 12:33

Re: Sharing drives or folders

Post by pennywhistle »

Hi,

I'm having the same trouble and would like to follow Perryg's instructions, which look really clear, but I don't know how to find out what my uid and gid are or how to get my user name in the vboxsf group. Sorry if this seems really dumb


Penny
fixedwheel
Volunteer
Posts: 1699
Joined: 13. Sep 2008, 02:18

Re: Sharing drives or folders

Post by fixedwheel »

Hi,
pennywhistle wrote:find out what my uid and gid are or how to get my user name in the vboxsf group.
information is in the /etc/passwd and /etc/group files - and the first user usually gets uid 1000 gid 1000 but may be uid 500 gid 500 in some distributions

to connect user "foobar" to vboxsf group do as root:
usermod -G vboxsf foobar
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: Sharing drives or folders

Post by Sasquatch »

deathtical wrote:Still having issues...
Image

Am starting to remember why I stopped using linux at home. I already work on and fix computers all day at work. Just want something simple at home. Not giving up yet though. Thanks.
Then change the name of the shared folder defined in the VM settings, use lower case only just to be sure. So let's change F_DRIVE to fdrive. The command will be as follows:

Code: Select all

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 fdrive /mnt/F_DRIVE
For the other users, please check my howto as well. It has a few pointers in finding your ID for example. If there is anything unclear, please say so, so I can change 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.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

Dear Perryg,

thanks very much for your great help. Sharing folders with the manual mount function worked.

It did not work however with the automount function... where can I set the "automount-option" in the "Device" menue? I could not see it... is that available? Please see the file attached.

Another question:
Is it possible to move the folder that I am sharing "C:\User\Andreas\Documents" (from Win 7 host) from the file directory "mnt" on the guest (LINUX Ubuntu 10.10) system to the "Home" folder (home\andreas\Documents)?

Thanks very much. Best regards, Andreas
Attachments
automnt.jpg
automnt.jpg (39.14 KiB) Viewed 7878 times
Last edited by anfho on 1. Feb 2011, 03:47, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Auto-mount was introduced in VirtualBox 4.0.0. If you are still using 3.2.12 then you will not have it.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

wow. thanks for the quick response. I was editing my post while you responded. could you please check the question I have asked above? Thanks -Andreas
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Code: Select all

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 <share name> /home/andreas/Documents
use your uid and gid if different.
Notice that the / instead of the \ is used in Linux. Linux is also case sensitive so be careful.

If you want this to be a permanent mount when you get it to the way you like it, put the mount statement in your /etc/rc.local file and it will mount it every time you reboot.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

Dear Perryg,
thanks for your help above, but I have noticed that if I restart my guest, each time I have to manually mount the folders that I would like to share with the host... Is there a way to have them automatically mounted each time I start the guest?

Also: I recently updated to VBox 4.0.4, which allows the auto-mount function. I have checket "Auto-mount" and "Make Permanent" In the settings for the Device --> Shared Folders --> Double click on shared folders--> Edit Share Tab.

However, still no success, when rebooting the guest: I have to mount it again.

I have looked in /media/sf_documents, which would be the mount-point for the auto-mount function as you mentionend in your previous message and "documents" is my shared folder.

You also mentioned that my "username must be in the vboxsf group (in the Linux guest)" if I would want to use auto-mount....

I did not now what that meant...
I appreciate your help on that.

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

Re: Sharing drives or folders

Post by Perryg »

See Chapter 4.3.2 Automatic mounting in your VirtualBox users manual.
Basically if you want the new feature to work (in the Linux guest) you open the user manager and go to groups and add your user name.
A guest reboot is mandatory.
Cyberian
Posts: 49
Joined: 17. Dec 2008, 10:21
Primary OS: MS Windows XP
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Fedora

Re: Sharing drives or folders

Post by Cyberian »

or you follow chapter 4.3.1 Manual mounting
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

Hi,
I was able to get the auto-mount to work but only temporarily. I added my username unter groups/vboxsf and then it worked.

HOWEVER:
Since I wanted to change the MountDir, I installed the guest properties Manager (Sec. 4.6 in the Manual, sarting from p.66)

Since the guest properties manager was not preinstalled, I had to install it (UBUNTU):

Code: Select all

sudo apt-get install virtualbox-ose
,
such that the commands VBoxManage and VBoxControl would work. However, some of the installation faild and now I am not even able to mount manually anymore:

Code: Select all

$ sudo mount -t vboxsf -o rw,uid=1000,gid=1000 Documents /mnt/documents
/sbin/mount.vboxsf: mounting failed with the error: No such device
Please help. Thx.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Sharing drives or folders

Post by Perryg »

Undo what you did. You can not run the VirtualBox OSE program inside of the guest. It messes up the release version from VirtualBox.
VBoxManage and VBoxControl are run from the host and since you are using Windows you must be in the directory that has these files or add the directory that has them to the Windows environment variable.
anfho
Posts: 52
Joined: 24. Jan 2011, 21:04
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu 16.04

Re: Sharing drives or folders

Post by anfho »

Undo by reinstall VBox4 ?
Post Reply