在 CentOS 上优化 VNC(通常是 TigerVNC / tigervnc-server),可以从网络、编码、桌面环境、系统参数几个层面来做。下面按“常用且有效”的方式整理。
启动 VNC 时指定参数(或写进配置文件):
vncserver :1 -geometry 1920x1080 -depth 24 -localhost no
更推荐(性能更好):
vncserver :1 -geometry 1280x720 -depth 16
说明:
-depth 16:颜色深度降低,明显提速编辑 ~/.vnc/config:
session=gnome
geometry=1280x720
depth=16
localhost
也可加:
SecurityTypes=vncauth,tlsvnc
CentOS 默认 GNOME 很重,VNC 会卡。
yum groupinstall "Xfce"
编辑 ~/.vnc/xstartup:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
赋予权限:
chmod +x ~/.vnc/xstartup
gsettings set org.gnome.desktop.interface enable-animations false
设置 → 窗口管理器 → 关闭动画
ssh -L 5901:localhost:5901 user@centos_ip
然后本地连接 localhost:5901
systemctl disable bluetooth
systemctl disable cups
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_max=16777216
如果 VNC 仍不满足:
✅ CentOS 7
✅ TigerVNC
✅ XFCE
✅ 1280×720 / depth 16
✅ SSH 隧道
如果你愿意,可以告诉我:
我可以直接给你一套可复制的配置方案。