VNC viewer 连接 Ubuntu22
2025-08-06
Linux运维
00

https://blog.csdn.net/yanchenyu365/article/details/133038162

https://www.xnadevelop.com/linux/vnc-remotedesktop-ubuntu-22-04-blackscreen/

js
展开代码
root@xd-OptiPlex-3070:~/npc_huoshan# cat /etc/gdm3/custom.conf # GDM configuration storage # # See /usr/share/gdm/gdm.schemas for a list of available options. [daemon] # Uncomment the line below to force the login screen to use Xorg WaylandEnable=false DefaultSession=xfce4.desktop # Enabling automatic login # AutomaticLoginEnable = true # AutomaticLogin = user1 # Enabling timed login # TimedLoginEnable = true # TimedLogin = user1 # TimedLoginDelay = 10 [security] [xdmcp] [chooser] [debug] # Uncomment the line below to turn on debugging # More verbose logs # Additionally lets the X server dump core if it crashes #Enable=true
js
展开代码
sudo apt-get update sudo apt-get install xfce4 xfce4-goodies sudo apt update sudo apt install xfce4 xfce4-goodies xfconf
js
展开代码
sudo systemctl restart gdm3
js
展开代码
(base) xd@xd-OptiPlex-3070:~$ cat ~/.vnc/xstartup #!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS exec startxfce4
js
展开代码
chmod +x ~/.vnc/xstartup
js
展开代码
vncserver :1 -geometry 1920x1080 -depth 24 -localhost no
js
展开代码
vncserver -list
js
展开代码
vncserver -kill :* # 关闭所有 VNC 会话
如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:Dong

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC。本作品采用《知识共享署名-非商业性使用 4.0 国际许可协议》进行许可。您可以在非商业用途下自由转载和修改,但必须注明出处并提供原作者链接。 许可协议。转载请注明出处!