I have a virtual machine with Ubuntu Server 17.04 (Guest) on VBox (Win 10 as host). I have set shared folder and try to automount it. Now, when I run manually the command:
sudo mount -t vboxsf src /media/src
Everything works fine, I have the folder mounted and all the files visible/editable. So I have put this command into /etc/rc.local
and restart the machine. And the folder doesn't show up... I have set the service according to these instruction and still nothing. I checked service status by systemctl status rc-local.service
and got following result:
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/rc-local.service.d
└─debian.conf
Active: active (exited) since Sun 2017-09-10 18:45:10 CEST; 14min ago
Process: 1185 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
Memory: 0B
CPU: 0
CGroup: /system.slice/rc-local.service
Sep 10 18:45:08 ubuntu systemd[1]: Starting /etc/rc.local Compatibility...
Sep 10 18:45:10 ubuntu sudo[1192]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/mount -t vboxsf src /media/src
Sep 10 18:45:10 ubuntu sudo[1192]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 10 18:45:10 ubuntu systemd[1]: Started /etc/rc.local Compatibility.
So it seems everything's fine. What's more interesting I added the simple touch
instruction to test that rc/local is actually run so now the file is as follow:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
touch /home/moby/dupa.zbita.kurwa.jego.mac
sudo mount -t vboxsf src /media/src
exit 0
Now, the file is beeing created so the file runs, yet the folder is not mounted as I expect. I thought that I made a typo in mount command but when I run the /etc/rc.local
manually (obviously it is executable) the folder appears properly.
What should I do to make this work? Of course I could enable mount command to run without password from my user and add the command into ¬/.bashrc file to make it work for now (or simply run the mount by hand) but I am wondering what's wrong and how to fix it anyway...
[edit]
asked in comment:
Make-Permanent
– George Udosen Sep 10 '17 at 19:02auto-mount
(which I checked) andread-only
(which I don't want). But yes, I want that folder to be automounted somehow... – Tomasz Kapłoński Sep 11 '17 at 16:27auto-mount
that's what you want! – George Udosen Sep 11 '17 at 16:29mount -t (...)
command to get access to the directory (or maybe it's available somewhere else and I miss it?) – Tomasz Kapłoński Sep 11 '17 at 16:38