View Single Post
Old 1st May 2010, 02:10
dfed dfed is offline
Junior Member
Join Date: Apr 2010
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post

Ok. One line to output VM name and os:

for x in `VBoxManage list vms | grep '"' | cut -d'"' -f2 2>/dev/null`; do VBoxManage showvminfo "${x}" | egrep -e "Name:" -e "Guest OS:" |cut -b 10-64 |tr -d '\n'| awk '{print $1" "$2" "$3" "$4" "$5" "$6}'; done
which outputs like this:

redhatest Red Hat (64 bit) 
windowstest Windows XP (64 bit) 
opensolaristest OpenSolaris (64 bit)  
anothertest Windows 7 (64 bit) 
archtest Arch Linux (64 bit) 
bsdtest FreeBSD (64 bit)  
warptest OS/2 Warp 4.5
Working on the portion to determine which is running and append that file with that.
Reply With Quote