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

相关推荐
呉師傅10 小时前
关于惠普LaserJet1018打印机在Windows11上打印颜色偏淡的问题解决方法
运维·服务器·windows·计算机外设·电脑
DevHub11 小时前
STM32 USB HID 教程:TinyUSB 实现键盘设备,从描述符到枚举
arm开发·stm32·单片机·嵌入式硬件·mcu·计算机外设
黑科技在线15 小时前
电脑开机黑屏怎么办?显示器没反应、进不了系统解决方法
计算机外设·电脑
xcLeigh15 小时前
Unity基础:Input输入系统入门——键盘、鼠标与触摸检测
unity·计算机外设·游戏引擎
caimouse3 天前
ReactOS 窗口系统分析(23):键盘 — keyboard.c + kbdlayout.c
c语言·开发语言·计算机外设
bj_bluewei_tech4 天前
拯救者键盘部分按键失灵,换键盘无效,需要排查主板键盘控制芯片
计算机外设·电脑
qq_513728044 天前
浏览器配置 + 文件上传 + 截图
python·selenium·测试工具·计算机外设
coding4u4 天前
Mac 多桌面(Spaces)的正确用法:你的屏幕可以大三倍
macos·docker·计算机外设·文件管理·策略模式
杨丰玮4185 天前
从零手写Java飞机躲障碍游戏|Swing绘图、鼠标跟随、计时器碰撞检测实战(四)
java·游戏·计算机外设
YOLO数据集集合5 天前
火情监测新方案:无人机红外-可见光多模态火点烟雾数据集(含YOLOv11实战)
人工智能·yolo·计算机外设·无人机·无人机数据集·可见光多模态