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

相关推荐
SmartRadio1 天前
ESP32-S3多设备KVM远程控制系统-虚拟USB有线键鼠+游戏宏(压枪/自瞄)+云玩一体化实现方案
网络·游戏·计算机外设·esp32
芯岭技术郦1 天前
芯岭技术性价比极高的2.4G无线键盘鼠标解决方案芯片
计算机外设
SmartRadio1 天前
ESP32-S3实现远程虚拟的USB有线鼠标键盘
计算机外设·esp32·远程·虚拟键盘·虚拟鼠标
呉師傅2 天前
东芝3525AC彩色复印机CC219测试页打印方法【实际操作】
运维·网络·windows·计算机外设·电脑
弓.长.2 天前
基础入门 React Native 鸿蒙跨平台开发:KeyboardAvoidingView 键盘避让视图
react native·计算机外设·harmonyos
Luminbox紫创测控2 天前
车载抬头显示器HUD阳光倒灌的检测
计算机外设
正方形的轮子2 天前
testmouse.com 一款免费的在线鼠标测试工具
测试工具·计算机外设
TESmart碲视2 天前
Mac多显示器支持:TESmart USB-C KVM(搭载DisplayLink技术)全面解析
macos·计算机外设·音视频·外设·kvm切换器·tesmart
LDR0063 天前
显示器 Type-C 口有哪些妙用呢?
计算机外设
sanqima4 天前
设置鼠标的灵敏度
计算机外设·鼠标灵敏度