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.04与xserver-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、重启电脑

相关推荐
shimly1234561 天前
win11 鼠标工标变白
计算机外设
小灰灰搞电子3 天前
QAccel 类讲解与代码示例:Qt 3 中的键盘加速键管理
qt·计算机外设
芝麻粒儿7 天前
Scratch少儿编程案例-鼠标控制练习
游戏·青少年编程·计算机外设·scratch·少儿编程
开开心心就好8 天前
显示器关不掉怎么办,用小工具一键息屏
算法·智能手机·pdf·计算机外设·ocr·lua·1024程序员节
Helen_Liang_七仔的AI工具箱11 天前
读英文画册总卡词?鼠标停 0.3 秒,生词自己浮出来(附阅读智能悬浮翻译器skill安装地址)
计算机外设
Hello_Pyhx14 天前
Hookshot v2.1.0:用键鼠玩《时之笛》,把操控和画面调顺手
计算机外设
Rattenking15 天前
OpenCV 轨迹栏操作和键盘响应操作
人工智能·opencv·计算机外设
jllws120 天前
键盘实现输入的思路
计算机外设
不脱发的程序猿23 天前
STM32制作单手鼠标键盘
stm32·嵌入式硬件·计算机外设·usb·qmk
AntsData24 天前
用 12K+ 条亚马逊评论信号,定位机械键盘下一版该改什么
java·大数据·计算机外设