CentOS VNC优化设置
一 基础性能参数优化
vncserver :1 -geometry 1280x720 -depth 16。二 桌面环境与会话配置
~/.vnc/xstartup,确保可执行:chmod +x ~/.vnc/xstartup#!/bin/bash
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4 &
exec gnome-session &,但资源占用更高。vncserver :1 -geometry 1280x720 -depth 16,避免默认高分辨率/高色深带来的性能问题。三 网络与安全优化
ssh -L 5901:localhost:5901 user@server_ipfirewall-cmd --permanent --add-port=5901/tcp && firewall-cmd --reloadsetenforce 0。四 系统级与内核网络优化
net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_fin_timeout = 30net.ipv4.tcp_keepalive_time = 1200net.ipv4.ip_local_port_range = 1024 65535net.ipv4.tcp_max_syn_backlog = 8192net.core.somaxconn = 1024sysctl -ptop/vnstat/iftop 与 VNC 日志(~/.vnc/*.log),定位瓶颈与异常。五 快速检查清单与常见故障
vncserver :1 -geometry 1280x720 -depth 16firewall-cmd --permanent --add-port=5901/tcp && firewall-cmd --reloadssh -L 5901:localhost:5901 user@server_ip~/.vnc/xstartup 是否可执行(chmod +x),并确认启动命令(如 startxfce4 &)正确。