vboxmanage doesnt see running VM

Discussions related to using VirtualBox on Linux hosts.

vboxmanage doesnt see running VM

Postby Rupat » 12. May 2021, 08:35

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

Re: vboxmanage doesnt see running VM

Postby scottgus1 » 12. May 2021, 16:06

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

Re: vboxmanage doesnt see running VM

Postby Rupat » 17. May 2021, 08:46

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   Expand viewCollapse view
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

Postby Rupat » 24. Jun 2021, 11:30

i just had the same problem.
VM are online but
Code: Select all   Expand viewCollapse view
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

Postby Rupat » 25. Jun 2021, 09:01

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

Re: vboxmanage doesnt see running VM

Postby mpack » 25. Jun 2021, 10:32

VMs run in user space, so you'll never see VMs started by another user, and I would expect that includes root.
mpack
Site Moderator
 
Posts: 34219
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: vboxmanage doesnt see running VM

Postby fth0 » 25. Jun 2021, 14:11

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.
fth0
Volunteer
 
Posts: 2136
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 12 guests