Virtualization Technology News and Information
Gathering virtual machine guest OS information in Microsoft Virtual Server

Ben Armstrong, the Virtual PC Guy, writes a simple script to display information about the guest OS of a running virtual machine.

Option Explicit

dim vs, vm

Set vs = CreateObject("VirtualServer.Application")

set vm = vs.FindVirtualMachine("a virtual machine")

'Display information about the GuestOS
wscript.echo "Guest OS Information:"
wscript.echo "====================="
wscript.echo "OSName                : " & vm.GuestOS.OSName
wscript.echo "AdditionsVersion      : " & vm.GuestOS.AdditionsVersion
wscript.echo "CanShutdown           : " & vm.GuestOS.CanShutdown 
wscript.echo "IsHeartbeating        : " & vm.GuestOS.IsHeartbeating
wscript.echo "HeartbeatPercentage   : " & vm.GuestOS.HeartbeatPercentage
wscript.echo "IsHostTimeSyncEnabled : " & vm.GuestOS.IsHostTimeSyncEnabled

Ben writes, "As you can see it displays the guest OS name (e.g. Windows XP), the version of Virtual Machine Additions that is installed, whether the guest operating system can be shut down remotely, if a heartbeat is being reported (and if so how many heartbeats have been received) and finally if host time synchronization is enabled.

All of this information can only be accessed if the virtual machine is currently running, and has Virtual Machine Additions installed.  If you try to run the script on a virtual machine that is not running, or does not have Virtual Machine Additions installed, you will receive an exception error."

Read the original or leave Ben a comment, here.

Published Friday, January 19, 2007 6:59 AM by David Marshall
Filed under:
There are no comments for this post.
To post a comment, you must be a registered user. Registration is free and easy! Sign up now!
<January 2007>