Wednesday, May 27, 2015

Setting Up Port Forwarding in VirtualBox

1) If the VM is running, stop it.

2) To forward from port 3001 on the host to port 3000 on the guest, run the following command on the host.
$ VBoxManage modifyvm "Ubuntu" --natpf1 "webrick,tcp,,3001,,3000"

3) To delete the port forwarding run:

VBoxManage modifyvm "Ubuntu" --natpf1 delete "webrick"

4) Now you can go to http://localhost:3001 on your host to hit webrick running on your VM.

The page loads very slow. Is there any way to speed it up?