当前位置: 首页>>技术问答>>正文


未插入监视器时添加假显示

, , , , ,

问题描述

我有一台没有连接外部显示器的Ubuntu 14.04服务器。我使用NoMachine来远程控制机器。当我这样做时,Unity /Gnome界面没有看到任何连接的显示器,因此在连接NoMachine时我只能使用800×600。如果我插入显示器,我可以将分辨率设置为远程计算机上NoMachine窗口的大小。

有没有办法在Ubuntu上创建”fake”监视器设备,以便我可以在Unity /Gnome中设置桌面分辨率?

最佳解决思路

找到了一种方法,无需使用虚拟插头:http://blog.mediafederation.com/andy-hawkins/ubuntu-headless-vnc-vesa-800×600-fix/

基本上安装一个虚拟驱动程序:

sudo apt-get install xserver-xorg-video-dummy

然后将其写入/usr/share/X11/xorg.conf.d/xorg.conf文件(如果不存在,则创建一个):

Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy"
EndSection

Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70
EndSection

Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1024x800"
    EndSubSection
EndSection

然后重新启动计算机。

次佳解决思路

在没有连接监视器的情况下在Ubuntu 14.04桌面上指定分辨率:

从xrandr手册页:

--fb widthxheight
   Reconfigures the screen to the specified size. All configured 
   monitors must fit within this size. When this option is not 
   provided, xrandr computes the smallest screen size that will 
   hold the set of configured outputs; this option provides a 
   way to override that behaviour.

因此在连接后使用命令:

xrandr --fb 1280x1024

第三种解决思路

这是一个硬件解决方案/workarround,可用于某些图形硬件/驱动程序。

  • 您要么购买Dummy VGA(或DVI模拟)插头,要么购买Dummy Dongle。

  • 或者在VGA输出端使用3个大约75欧姆的电阻:1→6,2→7,3→8。 +/- 10欧姆可以毫无问题地工作。有些卡仅使用一个电阻器。 (就像我的英特尔,2→7或3→8,将被检测为监视器)

参考:How to create dummy plugs for your graphics cards

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/2583.html,未经允许,请勿转载。