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

相关推荐
励志不掉头发的内向程序员14 小时前
【从零写一个CAD 04】中键拖动平移:抓住一个点,让它一直待在鼠标底下
开发语言·c++·qt·学习·系统架构·计算机外设
你挚爱的强哥1 天前
【sgKeyboard】自定义组件:虚拟键盘
前端·javascript·计算机外设
溪语流沙3 天前
【每天一个CSS | Day08】整排按钮被鼠标吸走的磁吸导航
前端·css·计算机外设
bj_bluewei_tech3 天前
拯救者键盘部分按键失灵,不是键盘本身的问题
计算机外设·电脑·笔记本电脑
石一峰6993 天前
Linux INPUT 与 I2C 子系统关联
linux·运维·计算机外设
lemoncat84 天前
双飞燕FG10鼠标摔落无响应|拆解修复|非广
计算机外设
梅梅96610 天前
一款mipi转lvds的lcd调试(LT8912B)
单片机·计算机外设·电脑·显示器·pd芯片
归零鸟18 天前
笔记本内屏黑屏,系统却说 “显示器一切正常“:一次 Intel PSR2 导致的 eDP 排查实录
计算机外设·电脑
Htr_18 天前
Cortex 使用指南:开源 API 知识层
前端·数据库·人工智能·重构·计算机外设
Htr_20 天前
Loqua 使用指南:让思维不再因键盘而减速
计算机外设