I'm having an issue - I'm on Ubuntu Server 20.04 and I'd like to start a VM via systemd service. If the server is booted and everything is loaded I can manually start the systemd service with
Code: Select all
sudo systemctl start vbox@UbuntuD.serviceCode: Select all
Jul 11 11:37:56 lezz systemd[1]: Starting vbox@UbuntuD.service...
Jul 11 11:37:59 lezz VBoxManage[1085]: VBoxManage: error: The virtual machine 'UbuntuD' has terminated unexpectedly during startup with exit code 1 (0x1)
Jul 11 11:37:59 lezz VBoxManage[1085]: VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MachineWrap, interface IMachine
Jul 11 11:37:59 lezz VBoxManage[1085]: Waiting for VM "UbuntuD" to power on...
Jul 11 11:37:59 lezz systemd[1]: vbox@UbuntuD.service: Control process exited, code=exited, status=1/FAILURE
Jul 11 11:37:59 lezz systemd[1]: vbox@UbuntuD.service: Failed with result 'exit-code'.
Jul 11 11:37:59 lezz systemd[1]: Failed to start vbox@UbuntuD.service.
Jul 11 11:38:42 lezz systemd[1]: /etc/systemd/system/vbox@.service:1: Assignment outside of section. Ignoring.Code: Select all
Description=the %I
Before=runlevel2.target shutdown.target
After=systemd-modules-load.service network.target virtualbox.service vboxdrv.service
[Service]
User=vbox
Group=vboxusers
Type=forking
Restart=no
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
Thank you for your support