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、重启电脑

相关推荐
云心雨禅1 天前
修改Windows鼠标滚轮方向
windows·计算机外设
song150265372981 天前
HUD抬头显示器-杂散光测试设备 太阳光模拟器
计算机外设
AlenTech4 天前
笔记本键盘的启用和禁用
计算机外设·电脑
Hi_kenyon5 天前
Vscode的常用快捷键(摆脱鼠标计划)
ide·vscode·计算机外设
lijiabin4175 天前
selenium自动化鼠标和键盘操作
selenium·自动化·计算机外设
呉師傅6 天前
佳能iR-ADV C5560复印机如何扫描文件到电脑
运维·网络·windows·计算机外设·电脑
.m8 天前
电脑主板亮红灯,开机显示器无显示的原因
windows·计算机外设
雾林小妖12 天前
win10连接鼠标自动关闭触摸板/win10关闭触摸板(笔记本)
计算机外设
大魔王(已黑化)12 天前
OpenCV 入门知识:图片展示、摄像头捕获、控制鼠标及其 Trackbar(滑动条)生成!
人工智能·opencv·计算机外设
TESmart碲视14 天前
一台显示器上如何快速切换两台电脑主机?
单片机·计算机外设·电脑·显示器·智能硬件