You are not logged in.

#1 2013-05-03 22:05:08

HumMan
Member
Registered: 2013-04-30
Posts: 2

VirtualBox, systemd and multiple VM services = problems at shutdown

Hello, i want to get multiple virtualbox machines start at boot and save at shutdown, i tried this wiki https://wiki.archlinux.org/index.php/Sy … l_machines and create service for starting virtual machines. With one machine it works great, but if i have more than one virtual machine then appear strange things at shutdown - some machines successful save but others in abort state.
Experimentally i found than if machines autostart at system boot then one random machine will have two processes in CGroup: VBoxXPCOMIPCD and VBoxSVC. And if we stop this machine all others will be killed.

At this moment i create additional service vboxsvc.service

[Unit]
Description=VBox service
Requires=systemd-modules-load.service
After=systemd-modules-load.service
Before=vboxvmservice@.service
[Service]
User=vbox_system
Group=vboxusers
ExecStart=/usr/lib/virtualbox/VBoxSVC --auto-shutdown
KillMode=process
[Install]
WantedBy=multi-user.target

The original service vboxvmservice@.service (but with KillMode=process)

[Unit]
Description=VBox Virtual Machine %i Service
Requires=vboxsvc.service
After=vboxsvc.service
[Service]
User=vbox_system
Group=vboxusers
ExecStart=/usr/bin/VBoxHeadless -s %i --vrde off
ExecStop=/usr/bin/VBoxManage controlvm %i savestate
KillMode=process
[Install]
WantedBy=multi-user.target

The solution above can solve problem, but i tested it not so well.
Does anyone come across this problem?

Last edited by HumMan (2013-05-03 22:24:35)

Offline

#2 2013-05-04 09:01:12

HumMan
Member
Registered: 2013-04-30
Posts: 2

Re: VirtualBox, systemd and multiple VM services = problems at shutdown

Some update - for vboxsvc.service maybe need to use KillMode=none

vboxsvc.service

[Unit]
Description=VBox service
Requires=systemd-modules-load.service
After=systemd-modules-load.service
Before=vboxvmservice@.service
[Service]
User=vbox_system
Group=vboxusers
ExecStart=/usr/lib/virtualbox/VBoxSVC --auto-shutdown
KillMode=none
[Install]
WantedBy=multi-user.target

Offline

Board footer

Powered by FluxBB