Posted by admin on

Fedora 24

This is quite different, in particular the System V init files don’t work any more and so I need to implement a systemd solution to mount the virtual box shared folders. I think these need to run after the vboxaddclient service. Some documentation suggests that LSB compliant scripts will work. I am about to stop and give it a rest; I am definitely of the view that this was a problem not worth solving.
This where I am, having experimented with my script, I return to using a .mount file

B$ cat import-common.mount
Description=Mounts common on /import/common
After=vboxadd-service tmp.mount


· import-common.mount - Mounts common on /import/common
   Loaded: loaded (/etc/systemd/system/import-common.mount; enabled;
   Active: inactive(dead)
    Where: /import/common
     What: common

Dead Alleys

So I make a .mount file, the first one fails because I didn’t know that one needs to replace the folder delimiter character i.e. “/” in the unit file name with a “-“. This is hidden in the manual pages.
Now where are the logs? Hidden behind f*ing binaries, there is a program called journalctl but systemctl status <service name or unit file name> both report the service or mount state.
I experimented with rewriting this as a service using my standard script. I discover that Fedora’s lsb functions file is in a different location to Ubuntu but the script is not a daemon and undertook both the mount and unmount operation.  I have found the vboxadd* service unit files, they are in /lib/systemd/system, they have example code to issue start and stop commands.
I have tried to implement redhat-lsb using yum/dnf. This has different function names to the debian version I have been using.

        mount -t vboxsf -o rw,uid=1000 $1 /import/$1
	case $? in
	0) log_success_msg mounting shared folder $1 ;;
	*) log_failure_msg mounting shared folder $1 ;;

Here are some links


Mike Davies writes,

…think what you need to do is create a systemd unit file named after the filesystem you want to mount. You have to make the unit filename match the mount point. I think you can pass options to control unit file ordered using the [Requires, Before & After directives

He also recommends,


It maybe right to use a service unit, but I can’t see it myself. It looks like the thing runs start and stop.
And this thread,


about how to do an rc.local degenerates into a lovely row about the rights and wrongs of systemd.


Image Credit: Berndt Rostad @flickr CC 2012 BY, he says “Fedora is not only a type of hat and a Linux distribution (which I happen to use) but also a bar and kitchen in Ledererstrasse 3 in Munich. Hooray.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.