Skip to content

Instantly share code, notes, and snippets.

@legumbre
Created October 3, 2011 22:59
Show Gist options
  • Save legumbre/1260490 to your computer and use it in GitHub Desktop.
Save legumbre/1260490 to your computer and use it in GitHub Desktop.
VirtualBox port forwarding example
# VirtualBox port forwarding example (localhost:2222 -> vm:22)
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
# or e1000 if that's the virtual nic we're using
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/HostPort" 2222
VBoxManage setextradata $VMNAME "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/GuestPort" 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment