Add Boot2Docker Port Forward on Localhost

To have you boot2docker running container service accessible on your “localhost” or host computer, following command can be use. The command line specifically modify the boot2docker virtual machine, to add the port forward configuration to the NAT interface.

VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port8000,tcp,0.0.0.0,8000,,8000"

The IP address of 0.0.0.0 is mean to listen on all IP of you host computer, you can also replace it with IP ‘127.0.0,0’ to make sure its only available on local loop-back adapter.

The tcp-port8000 is only a name assigned to identify the port-forward configuration and you can use others name as well such as port8000-to-8000-tcp