Make VirtualBox port forwarding configurable
Hi,
It would be helpful if we can configure the port forwarding when installing a new box.
Thanks
SSH is forwarded. What other ports should be forwarded?
SSH is forwarded. What other ports should be forwarded?
Additional port should be configurable when creating a new box.
Can't this be done directly through VirtualBox? What cases would it be useful to have Machine do this too?
Can't this be done directly through VirtualBox? What cases would it be useful to have Machine do this too?
Can't this be done directly when the machine is first setup to standard the configuration process? What cases would it be useful to have an additional step when creating a "Machine"?
:+1: I'd love to see this support. It would make it easier for my dev's to setup an environment and be able to copy/paste the URLs of their local machines around so that others can see their work.
Bonus points for being able to give it a range of ports to forward. Use cases: Our devs are working on multiple website projects at once and we want to pass the URLs of the local machine around to team leaders or what have you to inspect/critique the work.
:+1:
:+1:
:+1:
This would be badass. Otherwise, I don't know how docker-machine is calling ssh, but port forwarding that way would also be fine by me.
Using a container as a local server is a use case. I want to provide my developers with the ability to create and start a machine that can serve web applications that can be hit from other machines on the network. What I DON'T want to have is instructions like "Open virtual box GUI, do these steps, click this box, and now you have port forwarding. What I DO want is to provide a command "docker-machine create -d virtualbox -p 8080:8080 default"
Yeah, so I wrote this Fish function that I tied into some other functions to prepare the vm for my project. Maybe someone will find some use for it.
function vbox_port -d 'Forwards VirtualBox port'
set name $argv[1]
set port $argv[2]
VBoxManage modifyvm drought --natpf1 "$name,tcp,127.0.0.1,$port,,$port"
end
One problem I have is that I create my VM but when I put my laptop through a suspend cycle port forwarding breaks and I'm not sure why. The only fix I've found is removing the vm and then recreating it. The downside is that I have to pull down my containers again and that's kinda' puts a halt towards development on the go.
BLUE='\033[1;34m'
GREEN='\033[0;32m'
RED='\033[0;32m'
NC='\033[0m'
VM=app-docker
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
echo -e "${BLUE}VBoxManage -v ${NC} = $("${VBOXMANAGE}" -v)"
VBoxManage modifyvm "${VM}" --natpf1 "my-web,tcp,127.0.0.1,8080,,80"
VBoxManage modifyvm "${VM}" --natpf1 "my-ssh,tcp,127.0.0.1,2200,,220"
Make it usefull: https://github.com/selvaraj-kuppusamy/port_forwading-virtualbox