下面从性能、显示体验、安全、系统资源四个维度,系统讲一下在 Debian 上优化 TigerVNC 的方法。你可以按需取用。
sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common
不建议用很老的
vnc4server,TigerVNC 在编码和稳定性上更好。
避免使用 GNOME 完整版,推荐:
安装 XFCE:
sudo apt install xfce4 xfce4-goodies
~/.vnc/xstartup 示例(XFCE):
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4
赋予权限:
chmod +x ~/.vnc/xstartup
vncserver :1 \
-geometry 1920x1080 \
-depth 24 \
-localhost no \
-SecurityTypes VncAuth \
-fg
| 参数 | 建议 |
|---|---|
-depth |
24(画质/性能平衡) |
-geometry |
与客户端一致 |
-RandomFilter |
可减少噪点 |
-DeferUpdate |
提升流畅度 |
在 TigerVNC Viewer 中:
服务端开启 Tight:
vncserver :1 -Geometry 1920x1080 -depth 24
TigerVNC 对 Tight + ZRLE 支持很好
ssh -L 5901:localhost:5901 user@server
Viewer 连接:
localhost:5901
systemctl disable bluetooth
systemctl disable cups
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
vncpasswd
/etc/systemd/system/vncserver@.service 示例(可帮你写完整版)
如果你愿意,我可以:
你现在是哪种使用场景?