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

相关推荐
科创致远2 天前
第一代 e+SOP 盒子配显示器实测:物美价廉的产线可视化方案
大数据·网络·人工智能·信息可视化·计算机外设·制造·精益工程
硅基手札3 天前
SPI技术系列 08 · SPI 控制器寄存器与 IP 架构
驱动开发·stm32·单片机·嵌入式硬件·mcu·架构·计算机外设
hflmwl85 天前
wizmouse鼠标增强工具中文版下载
计算机外设·wizmouse鼠标增强工具·wizmouse中文版下载·wizmouse下载·wizmouse中文版·wizmouse·wizmouse工具
誰能久伴不乏5 天前
卸载博图 TIA Portal 后,我的键盘全灭了一次
计算机外设·电脑
开开心心就好7 天前
手机虚拟化学实验室,混合燃烧都能模拟
jupyter·智能手机·ffmpeg·计算机外设·电脑·音视频·visual studio
开开心心就好7 天前
手机电池健康怎么查?看容量温度循环次数
spring·智能手机·ffmpeg·计算机外设·电脑·maven·音视频
开开心心_Every8 天前
文件查重软件批量删除重复文件释放空间
java·开发语言·c#·计算机外设·ocr·excel·perl
雪碧透心凉_9 天前
PythonWin32API窗口与鼠标操作
开发语言·python·计算机外设
遇见小修修9 天前
电脑无法正常启动原因分析 零基础排查教程
计算机外设·电脑
硅基手札9 天前
【I2C 技术系列 11】I2C Linux 驱动框架
linux·驱动开发·stm32·单片机·嵌入式硬件·mcu·计算机外设