I am relatively new to Debian 8.5. I have a script which basically mounts the common folder for VBox to a static folder. I have guest additions installed.my.sh#!/bin/shmount -t vboxsf -o uid=1000,gid=1000 common_drive /home/kaustuv/common_driveNow, the script works if I execute it normally. But it doesn't work when I run it as a service of systemd. I created the following service:/etc/systemd/system/my.service[Unit]Description=My Personal Script[Service]Type=oneshotExecStart=/home/kaustuv/my.sh[Install]WantedBy=multi-user.targetI have also executed the command -sudo systemctl enable my.serviceThis service works with some random other command at startup but not for the mount command.Any idea what I am doing wrong here? Help is deeply appreciated.Note: sudo modprobe vboxvfs returns modprobe: FATAL: Module vboxvfs not found. Not sure if this means something.
Systemd not running vbox mount command
systemd;virtualbox
After meddling with this problem for a few days I finally found a solution. The problem occured because at the time the service ran, the virtual box module was not available. The solution is to run the following command -sudo echo vboxsf >> /etc/modulesThis forces the virtual box module to run at boot time. 