Port Forwarding To a VirtualBox VM
Posting this little tidbit for myself. Turns out VirtualBox has a lot of interesting NAT options:
To forward a port from a host machine to a VM, all you need to do is find VBoxManager (.exe at the end for windows) and type:
VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,,22"
And now you have forwarded port 2222 of your host machine to 22 of your VM.
Would love to know how to delete these rules though.
EDIT: just found it, awesome: VBoxManage Command Reference
--natpf<1-N> delete <name>