Page 1 of 2

Fedora 19 Can't Access Shared Folders

Posted: 17. Nov 2013, 07:00
by Trysis
My Fedora guest can't install my shared folders with /etc/fstab. I did exactly what I did with my Ubuntu guest earlier. I added my user, sean, to the vboxsf group with usermod. Mounting the files manually works, but permanent mounting with /etc/fstab does not. Interestingly, when I turn on the VM, the folder(s) I specified in /etc/fstab are mounted, whether I created them with mkdir beforehand or not, but there is nothing in them even if I put files/folders in them on the host. This also seemed to be the case with Ubuntu, except obviously it mounted them with the folders/files in them.

The shared folders on the host are "all_guests" and "Fedora_x64_v19.1", both under "C:/Users/Sean/.VirtualBox/Shared Folders", and "repos", which I stored directly under C:. On the guest, I am mounting "repos" as "/var/www/repos", and the other 2 directly under "/home/sean".

When I put the folders in /etc/fstab, the guest goes into emergency mode. This is not the same as Ubuntu, which shows an error but still boots. This happens whether I boot into the current version of Fedora or either of the previous 2 versions I upgraded from. When I put "nofail" as one of the options, it boots fine but the shared folders don't show anything in them even if there is something in them on the host. The lines I put in /etc/fstab are:

all_guests /home/sean/all_guests vboxsf defaults 0 0
Fedora_x64_v19.1 /home/sean/Fedora_x64_v19.1 vboxsf defaults 0 0
repos /var/www/repos vboxsf defaults 0 0

These are the exact lines I put in fstab in Ubuntu, with different folders. So why does all this work in Ubuntu but not Fedora? Is there something extra we have to do in Fedora?

Host:
Windows 8.1 64-bit
6GB RAM
500GB Hard Drive (~175 used)

Guest:
Fedora v19 Schrodinger's Cat (I upgraded it a couple times, but still v19)
2GB RAM
40GB

I'm new, so if you need more info, please tell me.

Re: Fedora 19 Can't Access Shared Folders

Posted: 18. Nov 2013, 19:07
by boc
Which version of Virtual Box?

I had 4.2.18 and after mounting the share could not get a listing of the directory, it would just hang.

After updating to 4.3.2 (and updating GA too) shares worked fine for me ...

Re: Fedora 19 Can't Access Shared Folders

Posted: 18. Nov 2013, 21:29
by Trysis
Sorry, the one thing I forgot to include. I have version 4.3.2, although until a couple days ago I had version 4.2.18. I had the VM in question before then, as well as the shared folders, but I didn't try putting them in fstab until after the upgrade.

Re: Fedora 19 Can't Access Shared Folders

Posted: 18. Nov 2013, 21:43
by Perryg
Bless the Fedora peoples heart but IMHO they made a mistake removing /etc/rc.local and trying to shove usermode into fstab. The problem is fstab is run at the beginning and before the VirtualBox kernel modules are loaded. While it sometimes will work, it forces a re-read of fstab at the end of the boot cycle ( after you log in ). I personally add the /etc/rc.local back in and place the manual shares there and be done wit it. The automatic shares have always been less then optimal for me. I prefer to set my own permissions.

Re: Fedora 19 Can't Access Shared Folders

Posted: 18. Nov 2013, 22:41
by Trysis
I tried adding rc.local to /etc and following a tutorial (really a tiny comment on StackOverflow I think) to put my shared folder data in, but that didn't work either. Fstab being checked at the wrong time is a problem for Fedora only, not Ubuntu, right? As I said in my original question, Ubuntu never had these problems for me. Do you know of any way to have Fedora recheck fstab (without going into emergency mode)?

Re: Fedora 19 Can't Access Shared Folders

Posted: 18. Nov 2013, 23:14
by Perryg
Ubuntu still has rc.local. I don't use fstab for shared folders period so I can't tell you that much about fedora. I just know it produced a headache and I did it my way.

Re: Fedora 19 Can't Access Shared Folders

Posted: 18. Nov 2013, 23:52
by Trysis
I've seen rc.local files and fstab files that have the uid & gid specifically set as the user who is usually logged in, but I have also seen ones where they specify neither the uid nor gid. In terms of shared folders, does this change the owner of the folder that will be mounted from the host or the folder that is already in the Linux system for that folder to be mounted on? When and why is it necessary or useful to set these? If these permissions are not set in fstab or rc.local, who is each folder owned by?

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 00:19
by Perryg
You can see every thing by typing man mount in the guests terminal.

The best way to mount the shared folders in linux is to add the options so there will not be any chance of OS error.

Code: Select all

mount -t vboxsf -o rw,uid=1000,gid=1000 share mount point.
You can try to use the automount, but the permissions are more than likely going to be messed up. If you do use the automount feature you need to be sure to add the (guests) user to the vboxsf group.

Bottom line is I never have issues with shared folders and that has to say something. Others use fstab, or automount and they have issues.
From here it is up to you. If you think fstab or automount is for you then that is what you should try to make work. I will say that on Fedora I had nothing but issues until I just fixed Fedora. Now no issues again.

Oh and shared folders require the guest additions be installed in the guest.

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 00:48
by Trysis
I know shared folders require guest additions, and they are installed. In rc.local, if you want more than 1 shared folder, you just put each one on separate lines, right? Do you need a semicolon between each line or something? Because it's still not working and I followed what you said & what I read in those tutorials about rc.local. I created the rc.local file in /etc, created the 3 other folders, changed the owner of all of them to the user, then I added these lines. See my first post for the names & locations of the folders on both systems:

mount -t vboxsf -o rw,uid=sean,gid=sean all_guests /home/sean/all_guests
mount -t vboxsf -o rw,uid=sean,gid=sean Fedora_x64_v19.1 /home/sean/Fedora_x64_v19.1
mount -t vboxsf -o rw,uid=sean,gid=sean repos /var/www/repos

The owner of all 3 folders is the user, and the owner of rc.local is root. The folders all have permissions 777, and rc.local has permissions 644 (that's what the system gave it when I created it, maybe because it's in /etc). I even commented out the lines in fstab, just in case they were interfering with rc.local somehow, but they're still not mounting. What am I doing wrong?

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 00:57
by Perryg
Ah you didn't look at me example.

uid and gid are numbers. Type id in a terminal to see yours

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 00:59
by Trysis
I tried numbers first, then I tried letters because I saw that on some other tutorial.

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 01:03
by Perryg
Another thing that you should try.

First use one mount until you get it to work.
Next I see you using complex names with special characters. Try it with sinple names. like share, guest, Etc. Mount points the same keep it simple.

The mounts just go on a separate line and nothing after. CR or linefeed are automatic separators.

Oh and make sure the last line in the rc.local is exit 0 ( that's a zero )

Edit: Saw your post. Numbers. anything else is wrong.

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 02:01
by Perryg
I found an easier way if you would like to try. Seems they included rc.local in Fedora 19 but it is in /etc/rc.d/rc.local.
I missed that because I have a script I created when F18 blew away the old rc.local that creates the /etc/rc.local

Anyway look in /etc/rc.d and see if rc.local exists.
If so then edit the file ( it should be empty )
Add the following information ( use your information )

Code: Select all

#!/bin/sh

mount -t vboxsf -o rw,uid=1000,gid=0 Public /mnt/Public-share

exit 0
Save and exit, make the file executable, and reboot the guest.

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 02:21
by Trysis
Another tutorial I saw mentioned that. However, it said to symlink it directly to /etc (meaning link a file that doesn't really exist called /etc/rc.local to the actual file /etc/rc.d/rc.local). Is there any benefit to doing it either way (or hardlinking instead of symlinking)?
Edit: Also, /etc/rc.d/rc.local doesn't exist.

Re: Fedora 19 Can't Access Shared Folders

Posted: 19. Nov 2013, 02:30
by Perryg
No symlinks, no hard links forget that stuff.

If the file does not exist create it. It is as simple as what I posted.

I know it works, I just tested it in Fedora 19_64