优化 Ubuntu 下的 VNC 体验,核心在于选择合适的 VNC 服务器、调整桌面环境以及优化网络与编码参数。以下是详细的优化方案:
| VNC Server | 说明 | 推荐场景 |
|---|---|---|
| TigerVNC | 性能好、支持 GPU、现代协议 | ✅ 首选 |
| x11vnc | 直接接管真实 X11 会话 | 已有桌面 |
| RealVNC | 商业方案,体验好 | 企业/付费 |
❌ 不推荐:
vnc4servervino(延迟高)sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common
| 桌面 | 特点 |
|---|---|
| XFCE | ✅ 最推荐 |
| MATE | 稳定 |
| LXQt | 极轻量 |
❌ 不推荐:
sudo apt install xfce4 xfce4-goodies
vncserver -xstartup
编辑 ~/.vnc/xstartup:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
赋予执行权限:
chmod +x ~/.vnc/xstartup
启动 VNC 时:
vncserver -geometry 1920x1080 -depth 24 -localhost no
或更低资源:
vncserver -depth 16
ssh -L 5901:localhost:5901 user@your_server_ip
然后连接:
localhost:5901
| 客户端 | 平台 | 推荐 |
|---|---|---|
| RealVNC Viewer | Win/Mac/Linux | ✅ |
| TigerVNC Viewer | Linux | ✅ |
| Remmina | Linux | ✅ |
xfwm4 --replace --compositor=off &
或永久关闭:
xfconf-query -c xfwm4 -p /general/use_compositing -s false
sudo systemctl disable bluetooth
sudo systemctl disable cups
适合:
sudo apt install virtualgl
vncserver -MaxFPS 30
vncserver -geometry 1920x1080 -depth 24 -MaxFPS 30 -localhost no
桌面:XFCE
客户端:TigerVNC Viewer
网络:SSH 隧道
✅ 原因:
✅ 解决:
-depth 16如果你愿意,可以告诉我:
我可以给你一套完全定制的 VNC 最优方案。