Home > Mac OS X, Scripting, VMware > Pulling Guest OS information from offline VMWare Fusion VMs

Pulling Guest OS information from offline VMWare Fusion VMs

As a related task to my Boot Camp partition detection, I also wanted to see if I could get information on the OS running in VMWare Fusion VMs without the VM actually being up and running. After some poking, I saw that I could get information on running VMs by using the vmrun list command. However, there didn’t see to be a way to pull information on non-running VMs using VMWare Fusion 5’s vmrun command.

After some additional investigation, it looked like the data I wanted was stored in /Users/username_here/Library/Preferences/com.vmware.fusion.plist in the VMFavoritesListDefaults2 plist key. In that plist key, the information I wanted was stored in the guestOS dict. With that information, I was able to use grep and awk to pull just the OS information I wanted. The command I used was:

defaults read com.vmware.fusion VMFavoritesListDefaults2 | grep guestOS | awk '{print $3}' | sed 's/"//g' | sed 's/;//g'

When I did that against my own VMs, here’s the output I received.

Screen Shot 2012-12-18 at 1.37.24 PM

Note: One thing to be aware of is that OS X VMs will report their Darwin OS info.

Because this information is stored on a per-user basis, you would need to check each user account to pull the VMs associated with each account.

Categories: Mac OS X, Scripting, VMware
  1. Pearce
    June 25, 2014 at 3:59 pm

    Hi Rich,

    I attempted this with the current version of vmware 6 but it’s not working. It appears to not have the VMFavoritedList2. Do you know if there is now a different way to grab this same information

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: