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

Sharing drives or folders

Post by deathtical »

I have a Win7 host and an Ubuntu 10.10 32bit guest. I have added some drives to my list of shared drives in VB for my Ubuntu guest but even after rebooting I can't see them in Ubuntu. I have already installed the VB guest additions but am still not seeing the shared drive. Any ideas? Do I need to mount them or something? Thanks.


FWI: I can see these drives just fine from my Win XP guest. Thanks.
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 »

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 »

None of those commands worked. Any other options?
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Sharing drives or folders

Post by stefan.becker »

"does not work" is no error message.

So help is not possible.

Yes, there is an option. Post facts instead of "does not work".

What is the input, what is the output. Exact approch, exact messages word by word.
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 »

Howto: Use Shared Folders on Linux Guests? You do have the Guest Additions installed and working, 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.
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 »

@ Sasquatch

Yes I do. Had to in order to get my VB display settings to go above 800x600.

@ Stefan

No need to be a :| . If I had received an error message then I would have included it. I am a 14+ year (not to be read as years old) IT veteran. People like you are the reason less tech savvy people get intimidated and don't try to learn more about computers. Instead of just asking for more details you have to try to belittle someone to make yourself feel better.

The steps provided in the guide did not provided the expected result. The closest thing I got to an error was that the command had to be run as root. My Linux is a bit rusty but I did run the command as root but nothing happened (For Stefan: the drive did not map and no error was produced). I then modified the fstab to include the suggested line (For Stefan: yes, I used the correct syntax and format) but when I rebooted it said that mapping during boot failed.

I have since set the fstab back to it's original state so I don't have to look at the error message when my VB boots.

Maybe this will help Image

I get the same thing with "mount -t vboxsf [-o OPTIONS] F_DRIVE F:". As I said, my Linux is a bit rusty. The last time I worked with it regularly was about 7 years ago. Any help would be appreciated, however, if you aren't here to provided anything constructive go troll another post. Thanks.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Re: Sharing drives or folders

Post by stefan.becker »

Best way is:

Use VBOX 4.0 with the Automount Feature.

Its described in the User Manual.

http://www.virtualbox.org/manual/ch04.h ... mount_auto

And dont forget to logoff/logon or restart after adding user to group as described.
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 »

Well if you don't want to use automount (it does not always work for some reason)
The mount should not have special characters in the name and can not have spaces.
Say you gave the share a name of share and created a mount point of /mnt/share you would use the following to mount the share

Code: Select all

mount -t vboxsf -o rw,uid=1000,gid-1000 share /mnt/share
The mount point must exist and you more than likely need to create it. mkdir /mnt/share
The options are set to read/write and your user and group ID with the (-o rw,uid=<your ID>,gid=<your ID>) Type id in the terminal to see what your id is.
Drives are a little more tricky. The name can not be F: as it will not work. F:\ seems to for the most part but you really should try to use names instead of drive letters (storage1, storage2 or data1, data2).
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 »

OK. Will try it when I get home from work. Thanks.
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 All,
I appreciate this thread as I have exactly the same issues.

I am using VBox 3.2.10 with Win7 host and Ubuntu10.10 guest (Guest Additions correctly installled). I can see the .vbox folder strucutre in Win7, however when I click on the network symbol in my Ubuntu10.10, I can see "Windows Network", and if I click on that I get from Ubuntu10.10 the following error message: "Unable to mount location, Failed to retrieve share list from server. [OK]".

If I am trying to follow that link: http://www.virtualbox.org/manual/ch04.h ... redfolders,
I got stuck at the point, where you have to enter the follwing command:
"VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test" "
As I do not know how to get the VM name...

I have also tried manual mount but could not get it to work.

If I do "sudo mount -t vboxsf -o rw,uid=1000,gid-1000 share /mnt/share"
I am getting: "/sbin/mount.vboxsf: mounting failed with the error: Protocol error", where "/mnt/share", is a folder in my home direcory.

From Windows, I want to share the following location with Ubuntu: C:\Users\Andreas\Documents"

If I pursue the Automount feature that comes with VBox 4.0, as suggested by Stefan, will I need to reinstall my guests as I update the VBox?

Any help is greatly appreciated as I am also confused by the many options...
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 »

First you select what it is you want to share within the VirtualBox program and in the settings of the guest.
Click on shared folders. From there you select what you want to share and give it a name. Plain and not special characters. Lets call it share.
Then start the guest and open a terminal and do what I suggested above.
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 »

Here is my first problem. I did define the folders and the drive that I want to share in the VBox settings for Ubuntu. (see file attached). But I dont understand why I should rename anything... I do not want to rename anything... I want to keep it as it is... (!)
Thanks! Andreas
Attachments
vbox_def_SharedFolders.jpg
vbox_def_SharedFolders.jpg (22.22 KiB) Viewed 12276 times
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 »

OK you can have it your way.
How would you like to accomplish this?

Please post the exact commands you are using to mount the share, and the location of the mount points and how they were created.
You are familiar with Linux and Linux commands right?
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 »

Are you implying that if I want it my way it is not going to work?

And no - I do not know how I would like to accomplish this, that is why I am posting in this forum. I would consider myself as a beginner in linux.

Thats is why I will have to rely on your help!
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 »

Nothing implied, so loose the attitude. My question was how do you want accomplish this?
Do you want to go the manual way or do you want to go the auto-mount way. So far you have not said.

Steps to create a manual share:
  • (1) Install the guest additions (in the guest)
    (2) create the share in the guest setting (you have done this)
    (3) start the guest
    (4) create a mount point
    (5) mount the share using the proper statement and to the folder that you created to mount the share in.
So let's go with your C_DRIVE (name you gave the share of the full drive C:)

(4) create the mount point (assuming that you want the mount point to say C_DRIVE and want to create the mount point in /mnt)
In a terminal:

Code: Select all

sudo mkdir /mnt/C_DRIVE
(5) mount the share (Where uid and gid are your id. change them to what it really is).

Code: Select all

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 C_DRIVE /mnt/C_DRIVE
If you do everything correct you will end up with a shared folder in /mnt/C_DRIVE and it should have the contents of the full C: drive, but sometimes Linux gets really upset with the special character _ that you are wanting to use.

Now if you want to go the auto-mount way all you need to do is start the guest and edit the share (under the device tab at the top) set it to auto-mount. Reboot the guest and your share should be in /media/sf_<what ever the share name is>, assuming that here again Linux does not get upset with the special character _ .
Lastly your user name must be in the vboxsf group (in the Linux guest) if you want to use auto-mount.
Post Reply