Created
June 17, 2022 14:00
-
-
Save nightsparc/58eb2f6fa7f68d996b2066926f8dcc20 to your computer and use it in GitHub Desktop.
Start Virtualbox VM via systemd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See https://www.pragmaticlinux.com/2020/10/start-a-virtualbox-vm-on-boot-with-systemd/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
[Unit] | |
Description=VirtualBox VM %I | |
After=network.target vboxdrv.service | |
Before=runlevel2.target shutdown.target | |
[Service] | |
## Add user/group in case the service should be run by the root daemon | |
#User=USER | |
#Group=vboxusers | |
Type=forking | |
Restart=no | |
TimeoutSec=5min | |
IgnoreSIGPIPE=no | |
KillMode=process | |
GuessMainPID=no | |
RemainAfterExit=yes | |
ExecStart=/usr/bin/VBoxManage startvm %i --type headless | |
#ExecStart=/usr/bin/VBoxManage startvm %i | |
ExecStop=/usr/bin/VBoxManage controlvm %i acpipowerbutton | |
[Install] | |
WantedBy=multi-user.target | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment