Recently I have been trying to mount my shared folder in Virtualbox, during boot time. I have browsed all over the internet, and asked everywhere. If anyone wants to have some references, i tried all these:
- VirtualBox: Linux Guest shared folder
- Access Virtual Box Shared Folder on Linux Guest – How TO
- VirtualBox Shared folder problems on Fedora guest
- Mount failed (unknown file system) in virtualbox in ubuntu 14.04 and Windows 7 as host after installing GuestAdditions
- fstab mount with VirtualBox shared folders
- How to mount a VirtualBox shared folder at startup?
- How to setup Virtualbox guest additions on Fedora 20
- How do I automatically mount my shared folder?
- Why can’t my Fedora VM access this shared folder?
- Virtualbox Shared Folder Fstab Automount on boot Ubuntu 10.04 and/or 12.04
I have posted these, hoping that will help someone else and that he won’t need to resort to my weird solution. Because i learnt the hardway, that fstab, fedora and virtualbox, are something that do not intend to work together. At least not in a way that i found.
My host OS is Fedora 20 and its
uname -a is :
Linux localhost.localdomain 3.17.7-200.fc20.x86_64 #1 SMP Wed Dec 17 03:35:33 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
My Virtualbox version is:
sudo yum info VirtualBox-4.3.x86_64
Loaded plugins: langpacks, refresh-packagekit
Name : VirtualBox-4.3
Arch : x86_64
Version : 4.3.20_96996_fedora18
Release : 1
Size : 145 M
Repo : installed
From repo : virtualbox
Summary : Oracle VM VirtualBox
URL : http://www.virtualbox.org/
License : GPLv2
My Guest Os is Fedora 21 and its
uname -a is:
Linux localhost.localdomain 3.17.7-300.fc21.x86_64 #1 SMP Wed Dec 17 03:08:44 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
The solution i found, is not one that i actually recommend, but if for some reason, you really want to mount your shared folder, during the guest boot, this seems to work for me. We will create an rc.local file, with our mount command, which will run during boot time and will mount the vboxsf filesystem. Although Fedora says that it moved from SysV and init.d to systemd, those wishing to execute additional programs at boot could insert commands into
Moving on… We create this file:
sudo vi /etc/rc.d/rc.local
and inside it, we write what we usually use to manually mount the Virtualbox shared folder. What works for me is:
mount -t vboxsf -o rw,uid=48,gid=48 site /var/www/html/
Pay special attention at including the line: “#!/bin/bash” at the new file. We should then make the file executable, like this:
chmod 755 /etc/rc.d/rc.local
and reboot the Guest OS.
This should work fine, and the shared folder will be mounted before your default user logs in. Once again, this does not seem as a sane solution from my part, but it does the job for now. Hope i helped you.