vboxmanage list runningvm empty

Discussions related to using VirtualBox on Linux hosts.
Post Reply
vgvb
Posts: 4
Joined: 17. Sep 2018, 04:38

vboxmanage list runningvm empty

Post by vgvb »

Hello,

I am using vagrant to provision VMs. I have a script which monitors the running vms so this script queries

Code: Select all

vboxmanage list runningvm
very often. After some time - today around 8 hours, vboxmanage list runningvm returns an empty list. This is not the first time this has happened. After starting a new VM after this point, that new VM shows with the state running but the others are still considered to be powered off when in reality they are not. Only information I was able to find was these 2 bug reports (I cannot post links to the forum). I have also searched the forum but I cannot for the life of me figure this out. I am not switching the users, or using sudo, or anything like that when launching VMs.

virtualbox [dot] org/ticket/12250
virtualbox [dot] org/ticket/9223

I am running VB 5.2.12 r122591 (Qt5.6.1) on Ubuntu 16.04. Installed using websiteforstudents [dot] com/install-virtualbox-latest-on-ubuntu-16-04-lts-17-04-17-10/ several months back. With vagrant, I am using this extension:

Code: Select all

vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]                                                                                                                                                                                               
vb.customize ["modifyvm", :id, "--uartmode1", "disconnected"]


From what I can tell, VBoxSVC is somehow related and that there was some connection loss between VBoxSVC? How could this theoretically happen? Also noticed that around the time this has happened, there now appears to be another

Code: Select all

/usr/lib/virtualbox/VBoxSVC --auto-shutdown


So there is a point where 2 of these processes are running.

Any help is appreciated
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vboxmanage list runningvm empty

Post by socratis »

Can you go Vagrant-less? Vagrant is a program that relies on VirtualBox but modifies its configuration files in unknown ways to us. It is not supported on these VirtualBox user forums, they have their own Vagrant support channels. If you are having this problem with a standalone version of VirtualBox, then we can continue this discussion.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
vgvb
Posts: 4
Joined: 17. Sep 2018, 04:38

Re: vboxmanage list runningvm empty

Post by vgvb »

Ok, I will check and see if I can narrow this issue down to whether vagrant is somehow the culprit or not
vgvb
Posts: 4
Joined: 17. Sep 2018, 04:38

Re: vboxmanage list runningvm empty

Post by vgvb »

While I haven't yet reproduced, I have been calling vboxmanage from multiple threads (terminals) at the same time. AFAIK, vboxmanage is not thread safe. I think that was cause of my issue.

https://www.virtualbox.org/pipermail/vb ... 11278.html
https://www.virtualbox.org/ticket/17029
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: vboxmanage list runningvm empty

Post by socratis »

I'm not sure that multiple terminals is the same as multiple threads, but I know too little, enough to be dangerous! ;)

And BTW, why multiple parallel accesses?

When you say you haven't reproduced it, is it maybe because you're running Vagrant-less?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
vgvb
Posts: 4
Joined: 17. Sep 2018, 04:38

Re: vboxmanage list runningvm empty

Post by vgvb »

No, still spawning machines using vagrant. I have one script running in parallel which is getting some information about the VMs. - it is invoking vboxmanage every second. All the while VMs are being brought up or down. But now I make sure there are no concurrent vbox API calls.

Thread-safe, process safe. There's some locking involved as described in the two links. I still don't know if that was the issue but I don't think vagrant is the cause.
Post Reply