#!/bin/bash

#
# Show the exposed network / NAT port forwarding configuration
# for all running VMs.
#

MACHINES=$(vboxmanage list vms | cut -f 2 -d \")

echo "Networking setup looks like:"
echo ""

while read -r machine; do
    echo "vboxmanage showvminfo \"${machine}\""
    vboxmanage showvminfo "${machine}" | grep "^NIC" | grep -v "disabled"
    vboxmanage showvminfo "${machine}" | grep "^VRDE:"

    echo ""
done <<< "${MACHINES}"

#!/bin/bash

#
# Show the exposed network / NAT port forwarding configuration
# for all running VMs.
#

MACHINES=$(vboxmanage list runningvms | cut -f 2 -d \")

echo "Networking setup looks like:"
echo ""

while read -r machine; do
    echo "vboxmanage showvminfo \"${machine}\""
    vboxmanage showvminfo "${machine}" | grep "^NIC" | grep -v "disabled"

    echo ""
done <<< "${MACHINES}"

--- 
+++ 
@@ -5,7 +5,7 @@
 # for all running VMs.
 #
 
-MACHINES=$(vboxmanage list vms | cut -f 2 -d \")
+MACHINES=$(vboxmanage list runningvms | cut -f 2 -d \")
 
 echo "Networking setup looks like:"
 echo ""
@@ -13,7 +13,6 @@
 while read -r machine; do
     echo "vboxmanage showvminfo \"${machine}\""
     vboxmanage showvminfo "${machine}" | grep "^NIC" | grep -v "disabled"
-    vboxmanage showvminfo "${machine}" | grep "^VRDE:"
 
     echo ""
 done <<< "${MACHINES}"
Add VRDE info to output.
