Skip to content

Instantly share code, notes, and snippets.

@liuyix
Last active December 23, 2015 05:59
Show Gist options
  • Select an option

  • Save liuyix/6590791 to your computer and use it in GitHub Desktop.

Select an option

Save liuyix/6590791 to your computer and use it in GitHub Desktop.

设置ssh访问VirtualBox虚拟机

  1. 设置(Host + S) --> 网络 --> 端口转发
  2. 设置内容
Host Port: 5678
Client Port: 22

3.在Host机器上:

ssh -p 5678 root@<本机地址>

无GUI启动VirtualBox的CentOS虚拟机

VBoxManage startvm CentOS5 --type headless

设置虚拟机ssh访问host

直接ssh,host地址是: 10.0.2.2 ssh your-username@10.0.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment