sudo apt-get install xserver-xorg-video-dummy
Create / Edit xorg.conf file Rename file if already exists for backup
sudo vi /usr/share/X11/xorg.conf.d/xorg.conf
Add the following content to the file Set the resolution to what you like (whatever resolution the screen is that is used to connect remotely is probably is a good idea)
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 "1920x1080"
EndSubSection
EndSection
Save the file Reboot and Test
This script looks for a file that doesn't exist. I just searched my entire Ubuntu LTS 22.04 system for
dummy.conf
and it doesn't exist anywhere. Maybe things changed since this was originally written? Any idea how to make this script work not in 2024? Thanks!And just to clarify: Yes, I've followed all of the instruction above and can currently connect to my headless Linux box over VNC without having a monitor plugged in. But I still need to be able to connect a real monitor on occasion.
FOLLOW UP QUESTION: In the script above, are you sure you don't mean
/usr/share/X11/xorg.conf.d/xorg.conf
instead of/etc/X11/xorg.conf.d/dummy.conf
?