VBoxManage: Is it possible to get snapshot creation date & time

This is for discussing general topics about how to use VirtualBox.
Post Reply
-JK-
Posts: 14
Joined: 3. Dec 2017, 02:23
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Mostly Ubuntu

VBoxManage: Is it possible to get snapshot creation date & time

Post by -JK- »

VBoxManage question:

Is it possible to get the snapshot creation date and time by using VBoxManage command line?
I tried

Code: Select all

VBoxManage showvminfo VM-name --machinereadable --details
and

Code: Select all

VBoxManage snapshot VM-name --details
These only list snapshot name and UUID:

Code: Select all

SnapshotName="20201104 U20 server installed"
SnapshotUUID="4a326345-f92c-4e18-8320-0a7232071547"
SnapshotName-1="20201104 U20 mate desktop installed, no GA"
SnapshotUUID-1="a487c27c-63db-49f2-b3c1-585a1326bf9d"
I also tried

Code: Select all

VBoxManage showmediuminfo
with valid snapshot UUID but if fails. Probably command is not meant to be used with individual snapshots?

Code: Select all

VBoxManage showmediuminfo 4a326345-f92c-4e18-8320-0a7232071547
VBoxManage: error: The given path '4a326345-f92c-4e18-8320-0a7232071547' is not fully qualified
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 187 of file VBoxManageDisk.cpp
However, VirtualBox stores this creation date & time information, because it is visible on the VirtualBox GUI, see "taken" column of the attachement. So how to get that information with VBoxManage? Thank you for your support!
Attachments
Snapshot-list.png
Snapshot-list.png (39.93 KiB) Viewed 2561 times
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: Is it possible to get snapshot creation date & time

Post by mpack »

I don't know how to get snapshot time using VBoxManage, but the "timeStamp" attribute is stored in the "<Snapshot" element in the .vbox file (xml). You could also simply check the creation timestamp on the snapshot VDI file.
-JK-
Posts: 14
Joined: 3. Dec 2017, 02:23
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Mostly Ubuntu

Re: VBoxManage: Is it possible to get snapshot creation date & time

Post by -JK- »

mpack wrote:I don't know how to get snapshot time using VBoxManage, but the "timeStamp" attribute is stored in the "<Snapshot" element in the .vbox file (xml). You could also simply check the creation timestamp on the snapshot VDI file.
Thank you for this idea!

This will do very well as an initial solution:

Code: Select all

cat VM_name.vbox | grep Snapshot|grep timeStamp
Post Reply