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

#3 2020-04-13 19:43:09

VS
Member
Registered: 2020-04-13
Posts: 1

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

Hello, HumMan.

Well, I've tried your workaround for multiple vms launching throug service with vbox. Didn't help, thought now when I check vboxvmservice@Xubuntu1910 status wit systemctl it shows 90% completion.

vboxvmservice@Xubuntu1910.service - VBox Virtual Machine Xubuntu1910 Service
     Loaded: loaded (/etc/systemd/system/vboxvmservice@.service; enabled; vendor preset: disabled)
     Active: failed (Result: signal) since Mon 2020-04-13 22:27:43 MSK; 8min ago
    Process: 491 ExecStart=/usr/bin/VBoxHeadless -s Xubuntu1910 (code=killed, signal=SEGV)
    Process: 733 ExecStop=/usr/bin/VBoxManage controlvm Xubuntu1910 savestate (code=exited, status=1/FAILURE)
   Main PID: 491 (code=killed, signal=SEGV)

Apr 13 22:27:43 OS systemd[1]: vboxvmservice@Xubuntu1910.service: Main process exited, code=killed, status=11/SEGV
Apr 13 22:27:43 OS VBoxManage[733]: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
Apr 13 22:27:43 OS VBoxManage[733]: Progress state: NS_ERROR_ABORT
Apr 13 22:27:43 OS VBoxManage[733]: VBoxManage: error: Failed to save machine state
Apr 13 22:27:43 OS VBoxManage[733]: VBoxManage: error: The object is not ready
Apr 13 22:27:43 OS VBoxManage[733]: VBoxManage: error: Details: code E_ACCESSDENIED (0x80070005), component SessionMachine, interface IMachine
Apr 13 22:27:43 OS VBoxManage[733]: VBoxManage: error: Context: "RTEXITCODE handleControlVM(HandlerArg*)" at line 664 of file VBoxManageControlVM.cpp
Apr 13 22:27:43 OS systemd[1]: vboxvmservice@Xubuntu1910.service: Control process exited, code=exited, status=1/FAILURE
Apr 13 22:27:43 OS systemd[1]: vboxvmservice@Xubuntu1910.service: Failed with result 'signal'.
Apr 13 22:27:43 OS systemd[1]: Stopped VBox Virtual Machine Xubuntu1910 Service.

It almost cracked my head already to dig solution of this problem up...

If this woul be helpfull.

Offline

#4 2020-04-13 19:50:21

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

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

VS, please start a new thread. This one is 8 years old and a lot has changed in that time.
https://wiki.archlinux.org/index.php/Co … bumping%22

Closing.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB