Saturday, April 20, 2024

Windows系统使用Putty连接VirtualBox的Ubuntu虚拟机

一、VirtualBox的Ubuntu虚拟机设置

1、“网络”-“连接方式:网络地址转换(NAT)”。

2、然后点“高级”-“端口转发”-“添加新的端口转发规则”。

协议(Protocol):TCP
主机IP(Host IP):127.0.0.1
主机端口(Host Port):2222
子系统IP(Guest IP):10.0.2.15
子系统端口(Guest Port):22

二、启动VirtualBox的Ubuntu虚拟机并安装安装SSH Server

启动VirtualBox的Ubuntu虚拟机,登录后安装SSH Server:

sudo apt-get install openssh-server

查看ssh服务是否开启:

sudo ps -e |grep ssh

查看Ubuntu虚拟机的IP地址:

ifconfig -a

三、使用Putty连接VirtualBox的Ubuntu虚拟机

在Windows中运行Putty,Host Name(or IP address)处输入127.0.0.1,Port处输入2222,Connection type(连接类型)为SSH即可正常连接。

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.