Fix for DWService Headless
If HDMI is plugged in at boot, the monitor works, and you can remote in.
If HDMI is unplugged at boot, the dummy display driver takes over, and you can remote in.
If the monitor is plugged in or unplugged after boot, you can use the shell connection to run vnc-display.sh to re-check for HDMI and configure the X-server accordingly.
- Step 1
apt install xserver-xorg-video-dummy
nano /etc/X11/xorg.conf.d/10-headless.conf
10-headless.conf's content:
Section "Monitor"
Identifier "VirtualMonitor"
HorizSync 30.0-62.0
VertRefresh 50.0-70.0
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
EndSection
Section "Device"
Identifier "VirtualCard"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
Identifier "VirtualScreen"
Device "VirtualCard"
Monitor "VirtualMonitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080"
EndSubSection
EndSection
- Step 2:
nano /etc/systemd/system/vnc-display.service
vnc-display.service's content:
[Unit] Description=Configure VNC dummy screen After=systemd-user-sessions.service [Service] ExecStart=/usr/local/bin/vnc-display.sh [Install] WantedBy=multi-user.target
nano /usr/local/bin/vnc-display.sh
vnc-display.sh's content:
#!/bin/bash
# Check connected displays
HDMI_STATUS=`cat /sys/class/drm/card1-HDMI-A-1/status`
if [ $HDMI_STATUS = "connected" ]
then
# If yes, disable the dummy driver configuration by renaming the file
sudo mv /etc/X11/xorg.conf.d/10-headless.conf /etc/X11/xorg.conf.d/10-headless.conf.bak
else
# If no, enable the dummy driver configuration by restoring the file
sudo mv /etc/X11/xorg.conf.d/10-headless.conf.bak /etc/X11/xorg.conf.d/10-headless.conf
sudo X :0 -config /etc/X11/xorg.conf.d/10-headless.conf &
fi
systemctl restart gdm3
systemctl daemon-reload
sudo chmod +x /usr/local/bin/vnc-display.sh
systemctl enable vnc-display.service
No comments to display
No comments to display