Mount shared folder on specific location upon boot

Discussions about using Linux guests in VirtualBox.

Mount shared folder on specific location upon boot

Postby omiazad » 2. Dec 2017, 09:41

Hi,
My host machine is Ubuntu and I have a shared folder from the host, which is working fine from both Windows and Linux guests. In Windows when I specify a drive/folder, it remembers that and every time I start the OS, I get things as it is on the same location.

The problem in Linux.

When I start my OS, I do get the shared folder on
Code: Select all   Expand viewCollapse view
/media/sf_OS_Shared/
location. But my apps do not know how to use that location. That is why I run this
Code: Select all   Expand viewCollapse view
mount -t vboxsf -o uid=1000,gid=1000 OS_Shared /home/sen2agri/Desktop/OS_Shared/
command to make that shared folder available at
Code: Select all   Expand viewCollapse view
/home/sen2agri/Desktop/OS_Shared/
location.

Now every time I start eh computer, I need to do that manually. Do you have any suggestion how I can automate this? Like I do not have to run that code manually?
omiazad
 
Posts: 1
Joined: 2. Dec 2017, 09:25

Re: Mount shared folder on specific location upon boot

Postby Perryg » 2. Dec 2017, 14:43

Use the /etc/rc.local. Add your mount statement to the file and reboot. Additionally you should not use the auto-mount feature of VirtualBox, just the standard mount and permanent when using this.
Perryg
Site Moderator
 
Posts: 34262
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 21 guests