FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

错误显示:

FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect 

解决方法:

使用指令ip addr,在虚拟机检查网关是否配置。如果ens33的inet有ip地址,则说明网关有进行配置。

FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

 点击win+r,执行cmd,在出现的窗口中ping 虚拟机的地址FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

 发现连接超时,说明虚拟机和计算机网络存在连接问题。查看虚拟机配置。

FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

虚拟机的ip和子网IP并没有在同一个网段。需要修改虚拟机IP

执行 cd /etc/sysconfig/network-scripts   和  vi ifcfg-ens33 指令,编辑ifcfg-ens33文件,将IPADDR设置为类似192.168.200.xxx的端口。

FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

 之后执行service network restart指令刷新网络

FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

 重新在cmd和FinalShell中测试连接效果,FinalShell连接请需要将连接的虚拟机IP修改。

FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

 FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

 FinalShell连接Linux虚拟机报错java.net.ConnectException: Connection timed out: connect

 连接成功,问题解决!!

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/65456f91d0.html