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

相关推荐
开开心心_Every12 小时前
免费语音合成工具:66种音色随心选
人工智能·面试·java-ee·计算机外设·电脑·maven·excel
flysh052 天前
pyAutoGUI 模块主要功能介绍-(1)鼠标功能
python·计算机外设·鼠标控制
Winter_Sun灬3 天前
普通键盘在MacOS上如何使用快捷键
macos·计算机外设·键盘
瞬间记忆3 天前
如何使显示器在笔记本盖上盖子时还能正常运转
计算机外设
dujunqiu3 天前
S32K328上芯片内部RTC的使用和唤醒配置
mcu·计算机外设
嵌入式牛马在努力帮老板娶老婆4 天前
十三、STM32----LCD屏驱动
stm32·嵌入式硬件·计算机外设
MingYue_SSS4 天前
键盘上面有F3,四,R,F,V,按下没有反应,维修记录
嵌入式硬件·计算机外设·解决办法
KWTXX4 天前
单片机键盘接口程序设计(汇编语言)
单片机·计算机外设·nosql
全栈技术负责人6 天前
移动端富文本markdown中表格滚动与页面滚动的冲突处理:Touch 事件 + 鼠标滚轮精确控制方案
前端·javascript·计算机外设