Fine the windows Build in a VM

jalcorn
Contributor II

Can anyone think of a good way to find the build of windows running in a VM? Been looking around and I'm not sure if its possible.

7 REPLIES 7

thomH
New Contributor III

Command+R and type winver - works for me in Fusion.

jalcorn
Contributor II

Anyway to automate with Jamf? @mm2270 magic powers?

jalcorn
Contributor II

we were able to ping them with a windows script.

Cornoir
Contributor II

For Parallels I created a EA that reads the VM version, here is the script which might help you out:

!/bin/bash

Extended Attribute to report the Windows Virtual Machines from Parallels Desktop

Created by Karthikeyan Marappan on 12/17/2013

Copyright 2012 __Apollogrp__. All rights reserved.

##############################################################################

The below module loops through the Users Documents

echo "<result>"
mdfind -name .pvm > /tmp/vmlist
cat /tmp/vmlist | while read i; do
if [ -f "/$i/VmInfo.pvi" ]; then
vmosversion=$(cat "/$i/VmInfo.pvi" | grep -i realosversion | awk '{print substr($1,16,8)}') 2> /dev/null
if [ "$vmosversion" == "unknown<" ]; then
echo >/dev/null
else echo "$vmosversion -"
fi
else
echo >/dev/null
fi
done
rm -r /tmp/vmlist
echo "</result>"

data type = string
input type = script

jalcorn
Contributor II

awesome, thanks @Cornoir I'll give this a go

jalcorn
Contributor II

@Cornoir So i tried that script and it seems to cut off the rest of the info. Any thoughts?

c5a1aa1ec4334cab89e96d0ccd1034de

Cornoir
Contributor II

In the script this line is truncating the info:

vmosversion=$(cat "/$i/VmInfo.pvi" | grep -i realosversion | awk '{print substr($1,16,8)}') 2> /dev/null

I suggest running the script from the terminal with the sh -x prefix to see what is getting cut off and then edit the following section to display what you need (and then post the fix here for all):

print substr($1,16,8)