Created
January 29, 2025 15:26
-
-
Save oxagast/223d49b45eff08dd92a2faa162e49410 to your computer and use it in GitHub Desktop.
Systemd service that starts and stops VirtualBox VMs gracefully.
This file contains hidden or 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= Guest VM %I | |
After=network.target vboxdrv.service | |
Before=runlevel2.target shutdown.target | |
[Service] | |
User=marshall | |
Group=vboxusers | |
Type=forking | |
TimeoutSec=5min | |
IgnoreSIGPIPE=no | |
KillMode=process | |
GuessMainPID=no | |
RemainAfterExit=yes | |
ExecStart=/usr/bin/VBoxManage startvm %i --type headless | |
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