Skip to content

Instantly share code, notes, and snippets.

@lvarayut
Last active November 12, 2015 03:50
Show Gist options
  • Save lvarayut/0c721481edf224ace214 to your computer and use it in GitHub Desktop.
Save lvarayut/0c721481edf224ace214 to your computer and use it in GitHub Desktop.
SSH to a VirtualBox guest

On Mac (Host)

VBoxManage modifyvm <VM-Name> --natpf1 "ssh,tcp,,3022,,22"

On Ubuntu (Guest)

sudo apt-get install openssh-server

Finally SSH to the VM

ssh -p 3022 <username>@127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment