vnc viewer连不上虚拟机问题解决

本文介绍了解决VNC连接问题的三个步骤:确认IP及路由配置、临时关闭防火墙及SELinux。通过这些操作,可以解决无法从Windows机器通过VNC Viewer连接到虚拟机的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在windows机器使用vncviewer进行测试连接虚拟机,在vncviewer连接种输入ip:5922,发现连不上去,netstat 查看没有ESTABLISHED的连接建立:

[root@localhost gao]# netstat -natp | grep qemu
tcp        0      0 0.0.0.0:5922            0.0.0.0:*               LISTEN      6850/qemu-system-x8 
tcp6       0      0 :::5922                 :::*                    LISTEN      6850/qemu-system-x8 

整理下需要3个步骤:
1、确保IP、ROUTE配置正确,能ping通vnc server所在的服务器;

2、临时关闭防火墙:

[root@localhost ~]# iptables -L -v //查看iptables 策略
[root@localhost ~]# iptables -F //删除iptables 策略

3、临时关闭selinux:

[root@localhost ~]# getenforce //查看selinux状态
[root@localhost ~]# setenforce 0 //关闭selinux

执行上面的操作基本就可以远程连接了,如下:

[root@localhost ~]# netstat -natp | grep qemu
tcp        0      0 0.0.0.0:5911            0.0.0.0:*               LISTEN      7504/qemu-system-x8 
tcp        0      0 192.169.1.197:5911      192.169.0.24:60683      ESTABLISHED 7504/qemu-system-x8 
tcp6       0      0 :::5911                 :::*                    LISTEN      7504/qemu-system-x8 

附:vnc server的安装

[root@localhost ~]# yum search vnc
[root@localhost ~]# yum -y install tigervnc-server
[root@localhost ~]# yum install vnc-server vnc*
[root@localhost ~]# service vncserver restart

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值