Created
May 26, 2015 08:49
-
-
Save av-ast/3b1b4d4fdc7011f30215 to your computer and use it in GitHub Desktop.
Forward VM ports to localhost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -eq 0 ]; then | |
echo "USAGE: ./forward_ports.sh 1234 5678" | |
exit 1 | |
fi | |
for port; do | |
echo "Forwarded port $port" | |
VBoxManage controlvm boot2docker-vm natpf1 "tcp-port$port,tcp,127.0.0.1,$port,,$port" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment