Skip to content

Instantly share code, notes, and snippets.

@silvae86
Created December 11, 2017 17:09
Show Gist options
  • Save silvae86/0a87d4711f957b966fc4d1c88555322f to your computer and use it in GitHub Desktop.
Save silvae86/0a87d4711f957b966fc4d1c88555322f to your computer and use it in GitHub Desktop.
Start VMs Automatically in Ubuntu 16.04 Server
sudo vim /etc/systemd/system/vboxvmservice@.service
Requires=systemd-modules-load.service
After=systemd-modules-load.service

[Install]
[Unit]
Description=VBox Virtual Machine %I Service
Requires=systemd-modules-load.service
After=systemd-modules-load.service

[Service]
User=joaorocha
Group=vboxusers
ExecStart=/usr/bin/VBoxHeadless -s %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