Ubuntu20.04 配置虚拟显示器和切回物理显示器

1、安装软件,用中软安装虚拟显示器软件

复制代码
sudo apt-get install xserver-xorg-core-hwe-18.04
sudo apt-get install xserver-xorg-video-dummy

2、添加配置文件

进入 /usr/share/X11/xorg.conf.d/ 文件夹下创建xorg.conf文件

复制代码
# 创建xorg.conf文件
touch xorg.conf
# 编辑xorg.conf文件
sudo nano xorg.conf

添加以下内容到xorg.conf文件中

复制代码
Section "Device"
  Identifier "Device0"
  Driver "dummy"
  VideoRam 256000
EndSection
Section "Monitor"
  Identifier "Monitor0"
  HorizSync 28.0-80.0
  VertRefresh 48.0-75.0
  Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Screen"
  DefaultDepth 24
  Identifier "Screen0"
  Device "Device0"
  Monitor "Monitor0"
  SubSection "Display"
    Depth 24
    Modes "1920x1080_60.00"
  EndSubSection
EndSection

3、重启电脑后就可不接物理显示器也能正常远程

4、如果需要切换会使用物理显示器,需要卸载xserver-xorg-core-hwe-18.04xserver-xorg-video-dummy 包。

复制代码
sudo apt-get --purge remove xserver-xorg-core-hwe-18.04
sudo apt-get --purge remove xserver-xorg-video-dummy

5、删除xorg.conf文件

复制代码
sudo rm /usr/share/X11/xorg.conf.d/xorg.conf

6、重启电脑

相关推荐
就叫飞六吧19 小时前
鼠标滚轮检测py脚本
计算机外设
HoneyMoose2 天前
体验一下科大讯飞的语音输入键盘
计算机外设
KL132881526932 天前
显示器除了卓威还有泰坦,耳机除了飓风还有VSG
游戏·计算机外设·耳机
ACP广源盛139246256733 天前
GSV2231G@ACP#产品参数规格解析与应用分享
嵌入式硬件·计算机外设·音视频
Jwest20214 天前
工业显示器在淬火机床中的应用
计算机外设
TESmart碲视4 天前
2025年 顶级8K DP KVM切换器双PC双显示器解决方案
计算机外设
KL132881526934 天前
【无标题】
游戏·计算机外设·耳机
ACP广源盛139246256734 天前
GSV2125D@ACP#GSV6125#HDMI 2.0 转 DisplayPort 1.4 转换器(带嵌入式 MCU)
嵌入式硬件·计算机外设·音视频
上大科技蔡生5 天前
IU5925+CS2102 / CS2102 / IU5512:超级电容无线鼠标电源芯片方案
计算机外设·电脑·dcdc·超级电容·ldo·充电ic·无线鼠标电源方案
ACP广源盛139246256735 天前
GSV2202D@ACP#DisplayPort 1.4 到 HDMI 2.0 转换器(带嵌入式 MCU)
单片机·嵌入式硬件·计算机外设·音视频