CentOS 下 VNC 卡顿通常和网络延迟、桌面环境、VNC 配置、系统资源等有关。可以按下面几个方向逐项优化,效果通常很明显。
如果条件允许,优先不用 VNC,而是用:
# 安装 X2Go Server
yum install epel-release -y
yum install x2goserver x2goserver-xsession -y
客户端:
https://wiki.x2go.org/doku.php/download:start
推荐顺序:
CentOS 常见:
yum install tigervnc-server
❌ GNOME、KDE
✅ XFCE / MATE
yum groupinstall "Xfce" -y
vim ~/.vnc/xstartup
示例(XFCE):
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
chmod +x ~/.vnc/xstartup
在 ~/.vnc/config 或启动参数中设置:
geometry=1280x720
depth=16
或启动命令:
vncserver :1 -geometry 1280x720 -depth 16
✅ 推荐参数:
XFCE 中:
ssh -L 5901:localhost:5901 user@centos_ip
然后 VNC 连接 localhost:1
VNC 默认加密较重,可尝试:
vncserver -SecurityTypes None
⚠️ 仅限内网使用
top
htop
free -h
systemctl disable bluetooth
systemctl disable cups
vim /etc/tigervnc/vncserver-config-defaults
示例:
geometry=1280x720
depth=16
localhost
SecurityTypes=VncAuth
MaxIdleTime=0
| 场景 | 推荐 |
|---|---|
| 图形界面 | X2Go |
| 纯命令行 | SSH |
| 远程桌面 | noVNC + WebSocket |
| 云服务器 | Apache Guacamole |
✅ 换 XFCE
✅ 分辨率 1280×720
✅ 色深 16
✅ 关闭桌面特效
✅ 使用 TigerVNC
如果你愿意,可以告诉我:
我可以给你一套完全针对你环境的优化配置。