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

相关推荐
wan5555cn2 天前
Windows 11系统鼠标键盘被禁用问题的全面解决方案
windows·笔记·深度学习·计算机外设
无敌最俊朗@5 天前
Qt 按钮点击事件全链路解析:从系统驱动到槽函数
开发语言·qt·计算机外设
ulimate_6 天前
树莓派:微雪显示器7寸触摸屏使用
计算机外设
Saniffer_SH8 天前
【高清视频】CXL 2.0 over Fibre演示和答疑 - 将内存拉到服务器10米之外
运维·服务器·网络·人工智能·驱动开发·计算机外设·硬件工程
pc大老9 天前
iPhone 用户如何通过鼠标提升操作体验?
计算机外设·iphone·鼠标·鼠标连接iphone
理想是做个英雄10 天前
基于AC6351D2做无线键盘
计算机外设·杰理ble,mcu以及蓝牙音频
科技观察11 天前
刘诗雯现身TCL品牌活动,雷鸟34Q9显示器同台竞技
计算机外设
理想是做个英雄11 天前
基于AC6366C做AI语音鼠标
人工智能·计算机外设·杰理ble,mcu以及音频蓝牙
小样还想跑12 天前
UniApp键盘监听全攻略
vue.js·uni-app·计算机外设