Page 1 of 1

vboxmanage doesnt see running VM

Posted: 12. May 2021, 08:35
by Rupat
Hi,
i had the problem that vboxmanage didnt show the Linux VMs that are currently running.
Also the GUI didnt see them.
I could SSH into the guests and everything inside the VM was working.

When I clicked in the GUI to show me the output it did start the VM while it was already running, so i got a broken filesystem after a reboot of the guest
After that I did shutdown all guests and restartet them. now it looks ok.

What can I do in this case? I have a nightly script that powers down the VM, copies the files and restarts them.
I fear that when vboxmanage doesnt see the running VM that it copies the files of an active VM and also tries to start an already running VM.

the host is a Centos Stream and i use the vbox service to start the VMs during boot.

any ideas?

Re: vboxmanage doesnt see running VM

Posted: 12. May 2021, 16:06
by scottgus1
If you are running these VMs with autostart or through a service or a "Task Scheduler", they are probably starting in a different account than the account you log in with. The VbxSVC service used by the logged-in account cannot see VMs running under another account.

Either work out a way to run the VMs under the account you will log in with, log in on the account running the VMs, or run the VMs after logging in.

Some VM-running services, such as 3rd-party VboxVMservice, have command-line actions to stop the VMs controlled by the service so the logged-in account can then run the VMs through the main Virtualbox window. These command could be scripted into the backup routine, if your chosen autostart method has such command.

Re: vboxmanage doesnt see running VM

Posted: 17. May 2021, 08:46
by Rupat
Hello,

the service starts the VMS as the User which whom I log in and work.
I think that is defined in /etc/vbox/virtualbox.cfg:

Code: Select all

default_policy = deny
itsupport = {
allow = true
}
usually the VMS appear when I run vboxmanage list runningvms as this user.
I can manually start and stop the VMs as this user.

Re: vboxmanage doesnt see running VM

Posted: 24. Jun 2021, 11:30
by Rupat
i just had the same problem.
VM are online but

Code: Select all

vboxmanage list vms
shows now active VM.

I did ssh into each VM and shut them down, than I started each VM with vboxmanage startvm ..

Re: vboxmanage doesnt see running VM

Posted: 25. Jun 2021, 09:01
by Rupat
i think that is a bug, i was working as root on some stuff and did run a "vboxmanage list runningvms" as root, after that it didnt work anymore as the normal user

Re: vboxmanage doesnt see running VM

Posted: 25. Jun 2021, 10:32
by mpack
VMs run in user space, so you'll never see VMs started by another user, and I would expect that includes root.

Re: vboxmanage doesnt see running VM

Posted: 25. Jun 2021, 14:11
by fth0
mpack wrote:VMs run in user space, so you'll never see VMs started by another user, and I would expect that includes root.
Yes, that's true:

The VirtualBox global configuration isn't global in the common sense, but user specific and VM global. For example, it is located in the folder /home/<username>/.config/VirtualBox for the user username and /root/.config/VirtualBox for the user root. Both username and root will start their own VBoxSVC and VirtualBoxVM processes. Usually it is not recommended to run VirtualBox VMs as root.