Reading a Binary VMCX File in Windows 2016 Hyper-V

Learn how to view the content of a VMCX file in Windows Server 2016.

John Savill

August 15, 2015

2 Min Read
Reading a Binary VMCX File in Windows 2016 Hyper-V

Q. How can I read the content of the Windows 2016 VMCX virtual machine configuration file?

A. Windows Server 2016 Hyper-V changes the virtual machine configuration file to binary, which provides additional resiliency from corruption and dissuades people from manually trying to edit the file. If you wish to view the configuration within a VMCX file, it's not possible to just type out the file since it is now binary. The best method I have found is to create a temporary object that contains a copy of the configuration in the VMCX file. It is then possible to view all the data from within the temporary object that is a copy of the VMCX configuration. For example:

$tempVM = (Compare-VM -Copy -Path .yourvmcxfile.vmcx -GenerateNewID).VM

You can example all the key properties using:

$tempVM | select *

It is also possible to view specific collections that are part of the object such as network adapters and disks. For example:

$tempVM.NetworkAdapters
$tempVM.HardDrives
$tempVM.FibreChannelHostBusAdapters

If you type $tempVM. and press tab, PowerShell will show all the options available to you.

Below is an example of this in action.

PS C:> $tempVM = (Compare-VM -Copy -Path .DF8560F4-4A6A-49B7-8E87-3B54D4101B40.vmcx -GenerateNewID).VMPS C:> $tempVMName         State CPUUsage(%) MemoryAssigned(M) Uptime Status            ----         ----- ----------- ----------------- ------ ------            savdaldemo01 Off   0           0                        Operating normallyPS C:> $tempVM | select *VMName                              : savdaldemo01VMId                                : 904f432b-d545-4a9f-9560-8dc9145a56aeId                                  : 904f432b-d545-4a9f-9560-8dc9145a56aeName                                : savdaldemo01State                               : OffIntegrationServicesState            : OperationalStatus                   : {Ok}PrimaryOperationalStatus            : OkSecondaryOperationalStatus          : StatusDescriptions                  : {Operating normally}PrimaryStatusDescription            : Operating normallySecondaryStatusDescription          : Status                              : Operating normallyHeartbeat                           : ReplicationState                    : ReplicationHealth                   : ReplicationMode                     : CPUUsage                            : 0MemoryAssigned                      : 0MemoryDemand                        : 0MemoryStatus                        : SmartPagingFileInUse                : Uptime                              : IntegrationServicesVersion          : ResourceMeteringEnabled             : FalseAutomaticCriticalErrorAction        : PauseAutomaticCriticalErrorActionTimeout : 30ConfigurationLocation               : C:VirtualsSnapshotFileLocation                : C:VirtualsCheckpointType                      : ProductionAutomaticStartAction                : StartIfRunningAutomaticStopAction                 : SaveAutomaticStartDelay                 : 0SmartPagingFilePath                 : C:VirtualsNumaAligned                         : NumaNodesCount                      : NumaSocketCount                     : Key                                 : Microsoft.HyperV.PowerShell.VirtualMachineObjectKeyIsDeleted                           : FalseComputerName                        : SAVDALHVFXVersion                             : 6.0Notes                               : #CLUSTER-INVARIANT#:{94838b88-2846-4e3d-9caa-850fb785fe3b}Generation                          : 2Path                                : C:VirtualsCreationTime                        : 8/5/2015 12:35:11 PMIsClustered                         : FalseSizeOfSystemFiles                   : 0ParentSnapshotId                    : ParentSnapshotName                  : MemoryStartup                       : 2147483648DynamicMemoryEnabled                : FalseMemoryMinimum                       : 536870912MemoryMaximum                       : 1099511627776ProcessorCount                      : 1RemoteFxAdapter                     : NetworkAdapters                     : {Network Adapter}FibreChannelHostBusAdapters         : {}ComPort1                            : Microsoft.HyperV.PowerShell.VMComPortComPort2                            : Microsoft.HyperV.PowerShell.VMComPortFloppyDrive                         : DVDDrives                           : {}HardDrives                          : {Hard Drive on SCSI controller number 0 at location 0}VMIntegrationService                : {Time Synchronization, Heartbeat, Key-Value Pair Exchange,                                       Shutdown...}PS C:> $tempVM.NetworkAdaptersName            IsManagementOs VMName       SwitchName      MacAddress   Status IPAddresses----            -------------- ------       ----------      ----------   ------ -----------Network Adapter False          savdaldemo01 External Switch 000000000000  

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like