Skip to content

Instantly share code, notes, and snippets.

@hostmaster
Last active December 20, 2015 07:39
Show Gist options
  • Save hostmaster/6094801 to your computer and use it in GitHub Desktop.
Save hostmaster/6094801 to your computer and use it in GitHub Desktop.
Show ip addresses of running VMs
#!/bin/bash
VBoxManage list runningvms | sed -n -e 's/"\(.*\)" .*/\1/p'| \
while read vm; do
ip=$(VBoxManage guestproperty enumerate "${vm}" | awk '/V4\/IP/ { gsub(",", "", $4); print $4 }')
echo "\""$vm"\" IP:"$ip
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment