Skip to content

Instantly share code, notes, and snippets.

@KaanErgun
Created July 16, 2024 11:05
Show Gist options
  • Save KaanErgun/4761187a7c1d24d7b445f23eb6f1f359 to your computer and use it in GitHub Desktop.
Save KaanErgun/4761187a7c1d24d7b445f23eb6f1f359 to your computer and use it in GitHub Desktop.
Virtual screen setup for server machines
#!/bin/bash
# Update package list
sudo apt update
# Install Xorg Dummy Video Driver
sudo apt install -y xserver-xorg-video-dummy
# Create xorg.conf file with necessary configuration
sudo bash -c 'cat <<EOL > /etc/X11/xorg.conf
Section "Device"
Identifier "Configured Video Device"
Driver "dummy"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 31.5-48.5
VertRefresh 50-70
# Default resolution: 1920x1080
Modeline "1920x1080" 172.80 1920 2048 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080"
EndSubSection
EndSection
EOL'
# Restart the display manager
sudo systemctl restart display-manager
echo "Virtual screen setup is complete. You can now connect using AnyDesk."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment