Skip to content

Instantly share code, notes, and snippets.

@pkutzner
Last active February 10, 2018 04:14
Show Gist options
  • Save pkutzner/4c576da300028ebc0dc4d1700536248d to your computer and use it in GitHub Desktop.
Save pkutzner/4c576da300028ebc0dc4d1700536248d to your computer and use it in GitHub Desktop.
systemd service for starting headless VirtualBox guests on boot
[Unit]
Description=VirtualBox Virtual Machine %i Service
Requires=systemd-modules-load.service
After=systemd-modules-load.service vboxdrv.service
[Service]
User=vbox
Group=vboxusers
ExecStart=/usr/bin/VBoxHeadless -s %i
ExecStop=/usr/bin/VBoxManage controlvm %i acpipowerbutton
KillMode=process
KillSignal=SIGWINCH
TimeoutStopSec=40
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment