ACPIPowerButton Issues

Discussions related to using VirtualBox on Linux hosts.
Post Reply
heyraffaello
Posts: 3
Joined: 22. Sep 2016, 18:50
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Ubuntu 18.04, Windows Server 2012 R2, Windows 10

ACPIPowerButton Issues

Post by heyraffaello »

When using systemd on the host to start/stop the guest (any guest OS--Ubuntu, CentOS, Win10, Win Server 2012) the guest aborts and does not shut down gracefully. From the command line, running the same command shuts the machine down gracefully. Host is Ubuntu 18.04.2 running VirtualBox 5.2.18.

Code: Select all

[Unit]
Description=Autostart For XXXX
Requires=vboxdrv.service
After=vboxweb-service.service vboxdrv.service

[Service]
Type=idle
User=virtualbox
Group=vboxusers

ExecStart=/usr/bin/VBoxHeadless --startvm "XXXX"
ExecStop=/usr/bin/VBoxManage controlvm "XXXX" acpipowerbutton

[Install]
WantedBy=multi-user.target
Then running:

Code: Select all

systemctl stop XXXX
Results in "Aborted" and clearly does not shut down gracefully.

However:

Code: Select all

$ VBoxManage controlvm "XXXX" acpipowerbutton
Results in a graceful shutdown and "Powered Off."

Thoughts and prayers appreciated.
Post Reply