Shared folder problem

Discussions about using Linux guests in VirtualBox.
Post Reply
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Shared folder problem

Post by Andrew s »

I have the latest version of VirtualBox with Windos 7 as host and Ubuntu as quest.

I follow the documentation to try to add a shared folder ShareDocs but instead of this folder getting into the folder I specify I get my Ubuntu folders "Andrew" and in that "Desktop". I have checked the steps in setting up the share via VM setting and in the Ubuntu terminal type:

sudo mount -t vboxsf ShareDocs /home/andrew/share

Any advice will be appreciated.


Thanks Andrew
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Shared folder problem

Post by mpack »

Not a "Windows Hosts" question. Moving topic to "Linux Guests".

Please provide a VM log file. With the VM fully shut down, right click it in GUI. Select "Show Log" and save "VBox.log" (ONLY) to a zip file. Attach the zip here.
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

I hope this is the right one.

Sorry for posting in he wrong place.

Regards Andrew
Attachments
Ubuntu (64)-2017-03-12-14-23-26.zip
(26.91 KiB) Downloaded 124 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: Shared folder problem

Post by Perryg »

Code: Select all

00:02:30.760304     Host path 'C:\Users\user\Documents\Ubuntu_share', map name 'Ubuntu_share', writable, automount=false, create_symlinks=false, missing=false
00:02:30.760311 SharedFolders host service: Adding host mapping failed with rc=VERR_ALREADY_EXISTS
00:02:30.787972 ERROR [COM]: aRC=E_FAIL (0x80004005) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={Could not create a shared folder 'Ubuntu_share' mapped to 'C:\Users\user\Documents\Ubuntu_share' (VERR_ALREADY_EXISTS)}, preserve=false aResultDetail=0
00:02:30.788269 Console: VM runtime error: fatal=false, errorID=BrokenSharedFolder message="Broken shared folder!"
Couple of things. First you have set the share to be auto-mounted and for that to work properly you need to add your user to the vboxsf group on the guest.
Second, you tried to mount a share that was already mounted, so to say and that usually will not work.
If I might suggest I would remove the auto-mount part and see if manually mounting will work. If so then we can get to how to make that permanent.

Code: Select all

sudo mount -t vboxsf -o rw,uid=<your uid>,gid=<your gid> <share name> <mount point>
Replace <..> with the proper information and the mount point must exist previous to running the statement.
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

Thanks I will try that. I am new to Linux where do I find my uid ?

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

Re: Shared folder problem

Post by Perryg »

type id in a terminal.
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

Found the ID etc and tried what you proposed.

I had some false starts so stopped the VM and started it again but the effect was the same "andrew" was in share etc. I attach the log

Regards Andrew
Attachments
Ubuntu (64)-2017-03-12-15-37-42.zip
(25.74 KiB) Downloaded 20 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: Shared folder problem

Post by Perryg »

Post the text shown from running id in the terminal
Post the exact text you are using to create this share in the guest.
Are you certain the mount point actually exists and of so what is it ( remember it is case sensitive ).
Also when you type the command do you receive any errors and if so what?

I also saw that you tried a share with Documents and the one with ShareDocs. Are you planning on having two shared folders or is this just to correct something?
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

Thanks for your help. I attach 3 jpegs which show what I did. The Share 3 show andrew now in the share folder and the result of doing an id. It aslo show a typo when I first tied it.

I also have a 32 bit Ubuntu and so I also tried it there with the same result.

Regards Andrew
Attachments
Share 2.png
Share 2.png (101.67 KiB) Viewed 12684 times
Share 1.png
Share 1.png (19.4 KiB) Viewed 12684 times
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

and the last one. Yes the Documents ShareDocs was a mistake

Thanks Andrew
Attachments
share 3.png
share 3.png (43.99 KiB) Viewed 12683 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: Shared folder problem

Post by Perryg »

What does the following do when typed in the terminal.

Code: Select all

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 share /home/andrew/share
Of course that is assuming that "/home/andrew/share" actually exists. It looks like id does from your screen shot.

Note: you can probably just copy and paste the command in the guests terminal to avoid errors.
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

Sorry but /home/andrew/share exist I posted the properties of it above. The Widows file ShareDocs also exists. I think your proposed test will fail as share is not a file on my Windows system. However, I will try it.
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

Running your test it gives /sbin/mount.vboxsf: mounting failed with the error: Protocol error.

Doing it with ShareDocs which is the windows file I am trying to gives no errors but as initially stated it now contains a folder "andrew (path /home/andrew/share) and it contains a file Desktop (path /home/andrew/share/andrew) it is empty!

Regards Andrew
Andrew s
Posts: 9
Joined: 12. Mar 2017, 16:05

Re: Shared folder problem

Post by Andrew s »

Sorry it is working! The file I created in Windows was empty. It looks like VMbox created the flie andrew and Desktop. When I added my own files I could see them.

Sorry for wasting your time.

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

Re: Shared folder problem

Post by Perryg »

OK so now to make it permanent you add that statement I gave you to the /etc/rc.local file. You must do so in an elevated editor ( as sudo ) and put the statement above the exit 0 line. Then when you reboot it will be there.

If you look at the screen shot you provided the share name is share and that is what you must use.
One other thing that may have been tripping you up is as I said Linux is case sensitive. I see that you did not adhere to that in a few of your replies.
Post Reply