0

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/sh
mount -t vboxsf -o uid=1000,gid=1000 common_drive /home/kaustuv/common_drive

Now, 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=oneshot
ExecStart=/home/kaustuv/my.sh

[Install]
WantedBy=multi-user.target

I have also executed the command -

sudo systemctl enable my.service

This 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.

1 Answer 1

0

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/modules

This forces the virtual box module to run at boot time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .