I've tried run some scripts after boot via /etc/rc.local./etc/rc.local#!/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./home/startup.shexit 0/home/startup.shmount -t vboxsf test /home/testHere is the result on bootHere is the output of systemctl status rc-local.servicerc-local.service - /etc/rc.local Compatibility   Loaded: loaded (/lib/systemd/system/rc-local.service; static)   Active: failed (Result: exit-code) since Sun 2016-02-07 22:48:23 ICT; 18min ago  Process: 432 ExecStart=/etc/rc.local start (code=exited, status=1/FAILURE)Feb 07 22:48:23 debian rc.local[432]: /sbin/mount.vboxsf: mounting failed with the error: No such deviceFeb 07 22:48:23 debian systemd[1]: rc-local.service: control process exited, code=exited status=1Feb 07 22:48:23 debian systemd[1]: Failed to start /etc/rc.local Compatibility.Feb 07 22:48:23 debian systemd[1]: Unit rc-local.service entered failed state.I've tried manually running sudo bash /home/startup.sh and it works fine. I've also applied this method on Ubuntu 14.04 and no errors occurr.What is the reason behind this failure? How can I fix it?
Debian 8 - Run scripts after boot
debian;ubuntu;virtualbox
Your problem seems to be that your rc-local.service is started before vboxadd-service.service, but it should run after it. Now, rc.local is a SysV thing (where it runs at the very end of the boot process), the compatibility provided by systemd is not perfect (as you can see in your screenshot). You'd probably better off with a custom home-test.mount unit like this:[Unit]Requires=vboxadd-service.serviceAfter=vboxadd-service.service[Mount]What=testWhere=/home/testType=vboxsf[Install]WantedBy = multi-user.targetThen systemctl enable home-test.mount, remove the /home/startup.sh call from /etc/rc.local and test the new setup with a reboot.Warning: I've got zero experience with VirtualBox and very litte with mount units. But you get the idea.