vboxmanage doesnt see running VM

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Rupat
Posts: 13
Joined: 15. Dec 2020, 10:53

vboxmanage doesnt see running VM

Post 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?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: vboxmanage doesnt see running VM

Post 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.
Rupat
Posts: 13
Joined: 15. Dec 2020, 10:53

Re: vboxmanage doesnt see running VM

Post 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.
Rupat
Posts: 13
Joined: 15. Dec 2020, 10:53

Re: vboxmanage doesnt see running VM

Post 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 ..
Rupat
Posts: 13
Joined: 15. Dec 2020, 10:53

Re: vboxmanage doesnt see running VM

Post 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
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: vboxmanage doesnt see running VM

Post by mpack »

VMs run in user space, so you'll never see VMs started by another user, and I would expect that includes root.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: vboxmanage doesnt see running VM

Post 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.
Post Reply