【备忘录】Ubuntu 配置虚拟显示器
使用虚拟显示器解决断开显示器连接后 Ubuntu 远控失效的问题
安装 Xorg 虚拟驱动
sudo apt install xserver-xorg-core-hwe-18.04
sudo apt install xserver-xorg-video-dummy-hwe-18.04
创建配置文件
cd /usr/share/X11/xorg.conf.d/
sudo touch xorg.conf && sudo vim xorg.conf
填写内容,重启生效
Section "Monitor" Identifier "Monitor0" HorizSync 28.0-80.0 VertRefresh 48.0-75.0 Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync 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 "1920x1080_60.00" EndSubSection EndSection
使用此方式后系统以虚拟显示器方式显示,即使连接显示器也是黑屏,如果不想使用了删除 xorg.conf 文件重启即可。