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

相关推荐
sensor_WU2 天前
【Delphi】实现在多显示器时指定程序运行在某个显示器上
计算机外设·多显示器
碎碎思2 天前
打破延迟极限的 FPGA 机械键盘
fpga开发·计算机外设
Despacito0o4 天前
瀚文机械键盘固件开发详解:HWKeyboard.cpp文件解析与应用
数据库·mongodb·计算机外设
步达硬件4 天前
【原理解析】为什么显示器Fliker dB值越大,闪烁程度越轻?
计算机外设·显示器
感叹号的豆浆4 天前
使用qt 定义全局钩子 捕获系统的键盘事件
qt·计算机外设
Despacito0o4 天前
瀚文(HelloWord)智能键盘项目深度剖析:从0到1的全流程解读
计算机外设
开开心心就好5 天前
高效视频倍速播放插件推荐
python·学习·游戏·pdf·计算机外设·电脑·音视频
Despacito0o6 天前
APM32主控键盘全功能开发实战教程:软件部分
驱动开发·计算机外设
Java&Develop7 天前
Windows如何定制键盘按键
计算机外设
LAM LAB8 天前
【键盘说明书备份】ENERGYFORT
计算机外设