第一次使用VNC连接的时候是可以的,
后来重启了一下,再连接的时候就是黑屏了(或者是灰屏),反正就是能连上,但是什么内容也显示不出来.
网上查了原因,有个博主说需要添加虚拟显示器,我觉得比较靠谱,于是试了一下,果然可以.
原连接:https://blog.csdn.net/qq_42589613/article/details/140877550
下面说一下我的操作过程,
首先需要用SSH连接到树莓派,然后安装xserver-xorg-video-dummy命令是:sudo apt-get install xserver-xorg-video-dummy
输入完命令后直接回车,它会自动安装好,由于我已经安装了,这里就不运行了.
然后就是创建 xorg.conf 文件.命令是:sudo nano /etc/X11/xorg.conf
它会自动新建一个xorg.conf文件并打开.然后我们把下面的代码粘贴到文件里.
Section "Device"
Identifier "Configured Video Device"
Driver "dummy"
VideoRam 256000
EndSection
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 5.0 - 1000.0
VertRefresh 5.0 - 200.0
ModeLine "1920x1080" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +Hsync +Vsync
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080" "1440x900" "1280x800" "1024x768"
EndSubSection
EndSection
接着按ctrl+s保存,按ctrl+x退出.
然后重启,重启命令:sudo reboot
重启后连接就有画面了
这篇文章就到这里了,如果对您有帮助,请点赞支持,非常感谢!