前提:
1.下载安装NxShell
2.VMWare上安装配置好Ubuntu22.0
连接步骤:
1.设置虚拟机网络连接模式为NAT
2.运行虚拟机,检查虚拟机有没有连上网络
可以通过Ubuntu上默认安装的Firefox浏览器查看有无网络
或者打开终端ping www.github.com查看
3.关闭Ubuntu防火墙
步骤:
1.su切换到root用户
2.ufw status 查看firewall状态active为打开inactive为关闭
3.如果没关闭使用ufw disable关闭
4.查看虚拟机IP
终端通过ifconfig查看
ens33节点下的inet即为虚拟器ip
jianglai@jianglai-virtual-machine:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.126.128 netmask 255.255.255.0 broadcast 192.168.126.255
inet6 fe80::f996:b316:51d9:fcb2 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:fc:bd:a6 txqueuelen 1000 (Ethernet)
RX packets 944 bytes 166557 (166.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 549 bytes 68576 (68.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 188 bytes 18211 (18.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 188 bytes 18211 (18.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
jianglai@jianglai-virtual-machine:~$ ^C
5.本地通过cmd ping命令测试虚拟机IP可否连接
6.Nxshell连接虚拟机
主机中输入虚拟机IP地址 端口号默认为22
认证方式选择密码 用户名输入当前虚拟机运行的用户名密码(终端中通过who命令查询当前用户)
保存并连接