在Ubuntu上通过VNC实现多屏显示,可以按照以下步骤操作:
安装TightVNC服务器:
sudo apt update
sudo apt install tightvncserver
启动VNC服务器:
vncserver :1
这里的 :1
表示创建一个新的VNC服务器实例,端口号为 5901
(默认)。
配置VNC服务器:
~/.vnc/xstartup
文件:nano ~/.vnc/xstartup
#!/bin/bash
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm &
chmod +x ~/.vnc/xstartup
重新启动VNC服务器:
vncserver -kill :1
vncserver :1
连接VNC客户端:
使用VNC客户端(如 RealVNC、TightVNC Viewer 等)连接到服务器的IP地址和端口号 5901
。
设置多屏显示:
安装RealVNC服务器:
sudo apt update
sudo apt install realvnc-vnc-server
配置RealVNC服务器:
/etc/vnc/config.d/common.custom
文件:sudo nano /etc/vnc/config.d/common.custom
MaxDeskSize 3840x2160
重新启动RealVNC服务器:
sudo systemctl restart vncserver-x11-serviced
连接RealVNC客户端:
使用RealVNC客户端连接到服务器的IP地址和端口号 5901
(默认)。
设置多屏显示: