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

相关推荐
爱吃提升13 小时前
Python桌面自动化PyAutoGUI完整实战教程:模拟鼠标键盘、窗口操作、图形识别自动化
python·自动化·计算机外设
辞旧 lekkk17 小时前
【Qt系统相关】鼠标事件
linux·开发语言·qt·学习·计算机外设·萌新
科技那些事儿3 天前
TCL 27C2A 双模显示器上市,QD-Mini LED 全能水桶机解析
计算机外设
半夜修仙3 天前
电脑主机能正常启动,但显示器黑屏显示无信号的解决方法
计算机外设
gr95ZS6E63 天前
分享一个 JS 鼠标跟随贪吃蛇背景库
开发语言·javascript·计算机外设
解局易否结局4 天前
鸿蒙PC应用开发:窗口管理 + 鼠标键盘交互 + 文件对话框
笔记·华为·计算机外设·交互·harmonyos
触想工业平板电脑一体机6 天前
【触想智能】工业级触控一体机的现状与未来展望
计算机外设·电脑
羽翼安全7 天前
显示器泄密如何防护 拍照检测软件实测排名2026
计算机外设
Tisfy9 天前
MacOS:首次外接键盘初始化设置(Option/Command互换、左上角·~而非§±)
macos·计算机外设
qq_171538859 天前
两条赛道,同一个未来:计算机科学与技术 VS 软件工程
大数据·计算机外设·软件工程