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
I found a way to be able to keep using connected displays
The follow scripts will check on startup if there is a display connected, if not, it will enable the dummy display.
/etc/systemd/system/vnc-diplay.service
/usr/local/bin/vnc-display.sh
and make it executable with
chmod +x /usr/local/bin/vnc-display.sh
sudo systemctl enable vnc-display.service
This script only checks for displays connected with a displayport, you can change the xrandr grep command to check for different connections.