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

相关推荐
bj_bluewei_tech1 天前
拯救者键盘部分按键失灵,换键盘无效,需要排查主板键盘控制芯片
计算机外设·电脑
qq_513728041 天前
浏览器配置 + 文件上传 + 截图
python·selenium·测试工具·计算机外设
杨丰玮4181 天前
从零手写Java飞机躲障碍游戏|Swing绘图、鼠标跟随、计时器碰撞检测实战(四)
java·游戏·计算机外设
YOLO数据集集合1 天前
火情监测新方案:无人机红外-可见光多模态火点烟雾数据集(含YOLOv11实战)
人工智能·yolo·计算机外设·无人机·无人机数据集·可见光多模态
杨丰玮4181 天前
从零手写Java飞机躲障碍游戏|Swing绘图、鼠标跟随、计时器碰撞检测实战(二)
java·游戏·计算机外设
码艺-Alimjan2 天前
横向滚动组件纯用 CSS,丝滑鼠标滚动不许js
javascript·css·计算机外设
Nomarsgo3 天前
柔性生产平台工业显示解决方案——基于联控 Lionconit IFD-1901 工业显示器打造高可靠人机交互终端
人工智能·科技·计算机外设·视觉检测·电脑·人机交互·制造
daols884 天前
解决 vxe-table 全键盘操作编辑单元格时,如果是中文拼音输入法时,解决首字母丢失问题
计算机外设
weixin_6685 天前
取消Windows 11 默认精简的鼠标右键文件夹菜单
windows·计算机外设
2601_963906786 天前
显示器 DDC/CI 控制工具:支持自动亮度/对比度调整等高级功能
计算机外设·软件需求