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

相关推荐
三佛科技-187366133973 天前
分享机械键盘MCU解决方案
单片机·嵌入式硬件·计算机外设
TESmart碲视3 天前
Mac 真正多显示器支持:TESmart USB-C KVM(搭载 DisplayLink 技术)如何实现
macos·计算机外设·电脑
error:(3 天前
蓝牙鼠标频繁卡顿?一招解决 Win10/11 的 USB 省电机制干扰问题
计算机外设
桃杬4 天前
lvgl修改输入设备驱动使其支持鼠标右键、双击、滑轮...
计算机外设
绀目澄清4 天前
unity UGUI 鼠标画线
unity·计算机外设·游戏引擎
沙尘暴炒饭4 天前
前端vue使用canvas封装图片标注功能,鼠标画矩形框,标注文字 包含下载标注之后的图片
前端·vue.js·计算机外设
sukalot5 天前
window显示驱动开发—头戴式和专用显示器
计算机外设
Gz、7 天前
京东京造K2 蓝牙/有线双模键盘键盘快捷键
计算机外设
清风6666667 天前
基于STM32单片机的无线鼠标设计
stm32·单片机·计算机外设·毕业设计·课程设计
feifeigo1237 天前
如何使用CrowPanel ESP32-S3高级HMI显示器来创建一个语音交互聊天机器人
机器人·计算机外设