要解决Debian上TigerVNC的兼容性问题,可以参考以下步骤:
sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-common
vncserver -geometry 1920x1080 -localhost no :1
这里的:1
表示VNC服务器将在显示编号为1的屏幕上运行,监听端口为5901(5900 + 1)。
~/.vnc/xstartup
文件以启动桌面环境(例如Xfce):vim ~/.vnc/xstartup
确保文件内容如下:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
chmod +x ~/.vnc/xstartup
vncserver :1
vncpasswd
vncpasswd
命令可以正常使用,以管理多个远程连接的密码。为了提高安全性,可以使用SSH隧道连接到VNC服务器:
ssh -L 5901:localhost:5901 user@your_server_ip
然后使用VNC客户端连接到本地的5901端口。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>