首推显卡欺骗器 如果没有显卡欺骗器的朋友就要往下看,折腾起来~
树莓派4B+装Ubuntu以后,没显示器可能无法进入系统!这时需要改系统配置文件。
树莓派Ubuntu的配置目录
config.txt中加入下面这两行,如果原文中有 hdmi_force_hotplug=1,则去掉注释让启用HDMI热插拔功能生效,重启树莓派就可以在无显示器下进入Ubuntu系统。

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

还有一种办法,让树莓派直接进入桌面。

hdmi_safe=1

(注意!!!Ubuntu21.04及以后版本首次启动选择的Xorg显示服务,重启之后就会变成默认的Wayland,让你进行远程登录的时候出现诸多问题。) 在用户登录界面的右下角齿轮按钮选择Ubuntu on Xorg
ubuntu21.04登录界面.png
但是!还不可以远程登录。。。因为Ubuntu默认的xserver不能工作在无显示器环境下,需要创建虚拟显示器,推荐安装xserver-xorg-video-dummy 。
安装命令:
sudo apt-get install xserver-xorg-video-dummy
安装结束后修改配置文件xorg.conf(如果没有创建一个),
文件路径:
/usr/share/X11/xorg.conf.d/xorg.conf
文件内容如下:

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
EndSection

Section "Monitor"
    Identifier  "Configured Monitor"    
    HorizSync 31.5-48.5
    VertRefresh 50-70
EndSection

Section "Screen"
    Identifier "Default Screen"
    Monitor "Configured Monitor"
    Device "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1024x800"
    EndSubSection
EndSection

保存重启即可使用远程桌面。

联网:

sudo nmcli dev wifi

sudo nmcli dev wifi connect "WiFi名" password "密码" ifname wlan0
Last modification:October 17th, 2022 at 06:14 pm