使用虛擬桌面
安裝基礎元件
sudo apt-get install xserver-xorg-core-hwe-18.04
sudo apt-get install xserver-xorg-video-dummy-hwe-18.04 --fix-missing
修改配置檔案,以建立一個虛擬桌面
vim /usr/share/X11/xorg.conf.d/xorg.conf
寫入以下內容
Section "Monitor"
Identifier "Monitor0"
HorizSync 5.0 - 1000.0
VertRefresh 5.0 - 200.0
# https://arachnoid.com/modelines/
# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "2560x1600" 47.12 2560 2592 2768 2800 1600 1639 1642 1681
Modeline "2560x1440" 42.12 2560 2592 2752 2784 1440 1475 1478 1513
Modeline "1920x1080" 23.53 1920 1952 2040 2072 1080 1106 1108 1135
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 256000
EndSection
Section "Screen"
DefaultDepth 24
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "2560x1600" "2560x1440" "1920x1080"
EndSubSection
EndSection
重啟,即可生效,此時,物理螢幕輸出為黑屏 若要恢復有線螢幕輸出,則刪除該檔案,重啟
調整為任意解析度
xrandr --fb 1280x960