window宿主机使用ssh访问VirtualBox的centos

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hqzxsc2006/article/details/80961706

方法1:端口转发

右键虚拟机->设置->网络,连接方式选择NAT,如下图
这里写图片描述
设置端口转发规则,如下图
这里写图片描述
xshell等工具就可以通过127.0.0.1:22访问虚拟机的centos

方法2:Host Only双网卡模式

设置中,添加另一个Adapter,连接方式选择Host-Only Adapter,界面名称选择VirtualBox Host-Only Ethernet Adapter
这里写图片描述
进入centos中运行ifconfig命令查看多了块网卡的ip,然后xshell通过此ip连接

猜你喜欢

转载自blog.csdn.net/hqzxsc2006/article/details/80961706