Determine "VM state" with vboxmanage

This is for discussing general topics about how to use VirtualBox.
Post Reply
Emma2
Posts: 51
Joined: 16. Feb 2021, 11:59

Determine "VM state" with vboxmanage

Post by Emma2 »

In the GUI, I can see whether a VM has been changed from the current snapshot in that it reads "Aktueller Zustand (verändert)". i.e. "Current State (changed)".
I cannot find anything similar using vboxmanage, neither the snapshot command nor showvminfo seem to give me that information, or do they?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Determine "VM state" with vboxmanage

Post by scottgus1 »

It appears there is an indication of the "Current State modidifed", not in 'vboxmanage showvminfo', but in the VM's .vbox file.

'vboxmanage showvminfo' shows the VM's snapshot structure and which snapshot is active, as shown with one of my test VMs:
Snapshots:

   Name: Snapshot 1 (UUID: 5f9732fa-8716-40b6-8115-2afedb02ab91)
      Name: Snapshot 2 (UUID: 97b24a5a-f1a4-4c52-ab74-122368e358d2)
         Name: Snapshot 4 (UUID: b1fb069f-d2f7-439a-a76f-8635af360b30) *
      Name: Snapshot 3 (UUID: 9ae01d4e-9a6d-451e-9410-7f05ad16be52)
The asterisk shows the active snapshot, and the indenting shows the structure. The asterisk does not change if "Current State" goes to "Current State (modified)", and no other indicators are placed.

The .vbox file contains this line in the <Machine> key:
<Machine uuid= ... snapshotFolder="Snapshots" currentStateModified="false" lastStateChange=... >
So you'll have to read the .vbox file. It appears this bolded underlined text disappears when the current state is modified, it does not read "true". Note that the .vbox file gets overwritten by the VboxSVC service every so often, at least when the VM is started. The VM's "state" line in 'vboxmanage showvminfo' will show when the VM is running, and the Current State will be "modified" when the VM is running.
Emma2
Posts: 51
Joined: 16. Feb 2021, 11:59

Re: Determine "VM state" with vboxmanage

Post by Emma2 »

Ok, thanks, noted.
But I would reckon this should be in showvminfo, or shouldn't it?
Is it possible to suggest this as a feature to the team?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Determine "VM state" with vboxmanage

Post by scottgus1 »

It seems it would be a good match for showvminfo. You can post an enhancement on the Bugtracker if you wish.

However, don't hold up your project waiting for the idea to take hold. The devs are rather busy with bugs.
Post Reply