Raspberry Pi 4b installs ubuntu server, it cannot boot without the screen, or the resolution is wrong.
Solution:
In /boot/firmware/config.txt, add a few lines:
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=82 # 1080p60Hz
hdmi_ignore_edid=0xa5000080 #skip screen check
disable_overscan=1 #ban keeping black edge
If you need other resolutions, please modify hdmi_mode and check the specific number online.
ps: The Raspberry Pi does not automatically connect to wifi when it is powered on. It does not matter whether you plug in the screen and enter the password. To set the wifi automatic connection, please modify the /etc/netplan/50xxxxxx.yaml file and add the wifi you want to connect to