0.0 下载安装包
VNC-Server-6.11.0-Linux-x64.deb
通过网盘分享的文件:VNC-Server-6.11.0-Linux-x64.deb
链接: https://pan.baidu.com/s/1NuQr3SwnYIJfL9-he7_waw 提取码: b7wa
VNC-Viewer-7.0.1-Windows.exe
通过网盘分享的文件:VNC-Viewer-7.0.1-Windows.exe
链接: https://pan.baidu.com/s/1pmUqv0yux1TpMoPn1GJDQQ 提取码: 9ht4
1.0 安装 RealVNC 6.11.0
安装命令:
sudo dpkg -i VNC-Server-6.11.0-Linux-x64.deb激活命令:
sudo vnclicense -add 3TH6P-DV5AE-BLHY6-PNENS-B3AQA或者
sudo vnclicense -add URF4A-YZRVW-PEDAE-BLNK3-Y5DMA2.0 配置RealVNC Service Mode + GNOME(注意:这里是Service Mode,不是Virtual Mode)
2.1 启动 RealVNC Service Mode
sudo systemctl enable vncserver-x11-serviced sudo systemctl start vncserver-x11-serviced检查是否启动:
systemctl status vncserver-x11-serviced正常显示为:
Active: active (running)继续检查:
ps -ef | grep vnc正常显示为:
/usr/bin/vncserver-x11-serviced /usr/bin/vncserver-x11-core -service /usr/bin/vncagent service 0不要出现
Xvnc-core :12.2 解决 GNOME 崩溃问题
Service Mode启动后出现:A problem has occurred and the system can't recover 等,可能原因是:Ubuntu 24.04 默认 Wayland,而RealVNC Service Mode 不适合 Wayland。
这时候进行如下修改:
sudo vim /etc/gdm3/custom.conf设置:
[daemon] WaylandEnable=false2.3 设置GNOME自动登录
因为服务器远程控制一般无人值守,需要自动进入桌面。这时需要打开custom.conf:
sudo vim /etc/gdm3/custom.conf修改为:
[daemon] WaylandEnable=false AutomaticLoginEnable=true AutomaticLogin=lee重启电脑:
sudo reboot进行检查:
loginctl list-sessions正常结果:
seat0 tty2 active继续检查:
ps -ef | grep gnome-shell正常结果:
xxxx /usr/bin/gnome-shell3.0 Service Mode 下 vncviewer 黑屏(无任何提示)的问题解决
如果发现 GNOME正常、Xorg正常、VNC server 正常,但VNCviwer仍然黑屏。
进行如下检查:
sudo -u lee DISPLAY=:0 xrandr如果发现:
Screen 0: current 640x480 HDMI-0 disconnected DP-0 disconnected ...说明服务器没有:HDMI显示器 和 DP显示器 等。Xorg没有有效输出。
这时可以安装:安装 Dummy Display
sudo apt install xserver-xorg-video-dummy -y创建:
sudo vim /etc/X11/xorg.conf内容如下:
Section "Device" Identifier "DummyGPU" Driver "dummy" VideoRam 256000 EndSection Section "Monitor" Identifier "DummyMonitor" HorizSync 30-80 VertRefresh 60 EndSection Section "Screen" Identifier "DummyScreen" Device "DummyGPU" Monitor "DummyMonitor" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1920x1080" EndSubSection EndSection这时候可以再次重启电脑啦
sudo reboot