Skip to content

Instantly share code, notes, and snippets.

@cburyta
Last active September 15, 2015 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cburyta/73fd0d5d84b5ddf1ae6d to your computer and use it in GitHub Desktop.
Save cburyta/73fd0d5d84b5ddf1ae6d to your computer and use it in GitHub Desktop.
cli-function-vport: List VirtualBox ports used by a Vagrant driven machine.
#
# usage: use from in the directory that the .vagrant dir is, e.g...
# cd vagrant-project-root
# vagrant up
# vport
#
vport() {
pushd .vagrant/machines
for MACHINE in `find . -type d -mindepth 1 -maxdepth 1`
do
echo ""
echo "LIsting NIC card info on machine $MACHINE"
VBoxManage showvminfo $(cat $MACHINE/virtualbox/id) | grep ^NIC
done
echo ""
popd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment