无头 x11vnc - 更高分辨率

无头 x11vnc - 更高分辨率

我正在尝试让我的 Ubuntu 机器以比默认 1024x768 更高的分辨率运行。正如您从日志中看到的,我正在使用集成的英特尔视频驱动程序。

我尝试添加带有虚拟显示器的 xorg.conf,但仍然得到默认分辨率。

我还尝试在 x11vnc.service 中指定几何形状。

然后我添加了一个自定义虚拟监视器配置,如下所示。

/usr/share/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier             "Monitor0"
    Option                 "Enable"  "true"
    Option                 "DPMS"    "false"
    DisplaySize            400   300
EndSection

Section "Device"
    Identifier             "Device0"
    Driver                 "intel"
EndSection

Section "Screen"
    Identifier             "Screen0"
    Device                 "Device0"
    Monitor                "Monitor0"
    DefaultDepth            24
    SubSection             "Display"
        Depth               24
        Modes              "1920x1080" "1600x1200" "1280x768"
    EndSubSection
EndSection

文件:/var/log/Xorg.0.log

[     3.564] (II) Module glx: vendor="X.Org Foundation"
[     3.564]    compiled for 1.18.4, module version = 1.0.0
[     3.564]    ABI class: X.Org Server Extension, version 9.0
[     3.564] (==) AIGLX enabled
[     3.564] (II) LoadModule: "intel"
[     3.565] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
[     3.567] (II) Module intel: vendor="X.Org Foundation"
[     3.567]    compiled for 1.18.4, module version = 2.99.917
[     3.567]    Module class: X.Org Video Driver
[     3.567]    ABI class: X.Org Video Driver, version 20.0
[     3.567] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
        i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
        915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
        Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
        GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[     3.567] (II) intel: Driver for Intel(R) HD Graphics: 2000-6000
[     3.567] (II) intel: Driver for Intel(R) Iris(TM) Graphics: 5100, 6100
[     3.567] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics: 5200, 6200, P6300
[     3.570] (II) intel(0): Using Kernel Mode Setting driver: i915_bpo, version 1.6.0 20160425
[     3.570] (II) intel(0): SNA compiled: xserver-xorg-video-intel 2:2.99.917+git20160325-1ubuntu1.2 (Timo Aaltonen <[email protected]>)
[     3.570] (II) intel(0): SNA compiled for use with valgrind
[     3.571] (--) intel(0): gen9 engineering sample
[     3.571] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2; using a maximum of 2 threads
[     3.571] (**) intel(0): Depth 24, (--) framebuffer bpp 32
[     3.571] (==) intel(0): RGB weight 888
[     3.571] (==) intel(0): Default visual is TrueColor
[     3.572] (II) intel(0): Output HDMI1 using monitor section Monitor0
[     3.572] (**) intel(0): Option "Enable" "true"
[     3.572] (II) intel(0): Enabled output HDMI1
[     3.572] (II) intel(0): Output HDMI2 has no monitor section
[     3.572] (II) intel(0): Enabled output HDMI2
[     3.572] (II) intel(0): Output DP1 has no monitor section
[     3.572] (II) intel(0): Enabled output DP1
[     3.572] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
[     3.572] (II) intel(0): Output VIRTUAL1 has no monitor section
[     3.572] (II) intel(0): Enabled output VIRTUAL1
[     3.572] (==) intel(0): TearFree disabled
[     3.572] (**) intel(0): Display dimensions: (400, 300) mm
[     3.572] (**) intel(0): DPI set to (65, 65)
[     3.572] (II) Loading sub module "dri2"
[     3.572] (II) LoadModule: "dri2"
[     3.572] (II) Module "dri2" already built-in
[     3.572] (II) Loading sub module "present"
[     3.572] (II) LoadModule: "present"
[     3.572] (II) Module "present" already built-in
[     3.572] (==) Depth 24 pixmap format is 32 bpp
[     3.575] (II) intel(0): SNA initialized with Kabylake (gen9) backend
[     3.575] (==) intel(0): Backing store enabled
[     3.575] (==) intel(0): Silken mouse enabled
[     3.575] (II) intel(0): HW Cursor enabled
[     3.575] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[     3.576] (==) intel(0): Display hotplug detection enabled
[     3.576] (II) intel(0): [DRI2] Setup complete
[     3.576] (II) intel(0): [DRI2]   DRI driver: i965

^G Get Help       ^O Write Out      ^W Where Is       ^K Cut Text       ^J Justify        ^C Cur Pos        ^Y Prev Page      M-\ First Line    M-W WhereIs Next  ^^ Mark Text      M-} Indent Text   M-U Undo          ^B Back
^X Exit           ^R Read File      ^\ Replace        ^U Uncut Text     ^T To Spell       ^_ Go To Line     ^V Next Page      M-/ Last Line     M-] To Bracket    M-^ Copy Text     M-{ Unindent Text M-E Redo          ^F Forwards

/lib/systemd/system/x11vnc.service:

[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service

[Service]
ExecStart=/usr/bin/x11vnc -xkb -norc -forever -shared -display :0 -xrandr -auth guess -rfbauth /etc/x11vnc.pass -localhost -o /var/log/x11vnc.log
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=2

[Install]
WantedBy=multi-user.target

答案1

我一直在使用这种方法:

FD_GEOM=1920x500 FD_SESS=xfce x11vnc -create

如果找不到现有的显示,则使用环境变量 FD_GEOM 和 FD_SESS。 “-create”将寻找一个,否则创建一个虚拟的。

有一个很好的部分man x11vnc关于创建可以进一步帮助您的显示:

您可以将环境变量FD_GEOM(或X11VNC_CREATE_GEOM)设置为WxHWxHxD来设置所创建显示的宽度和高度以及(可选)颜色深度。您还可以设置FD_SESS为会话(窗口管理器的简称:kdegnometwmfailsafe等)。FD_OPTS包含传递到 X 服务器的额外选项。您还可以设置FD_PROG为会话/窗口管理器程序的完整路径。

答案2

使用带有 LXDE 和 LXDM 的 Ubuntu 14(64 位)计算机,我能够在用户登录之前启动 x11vnc,无需连接键盘或显示器。

通过使用 xrandr 设置帧缓冲区,vnc 具有帧缓冲区的屏幕分辨率。

/etc/lxdm/LoginReady添加了两行:

xrandr --fb 1580x950
/usr/bin/x11vnc -nevershared -noxdamage -forever -localhost -nopw -threads -bg -auth /var/run/lightdm/root/:0 -display :0 -rfbport 5900 -o /var/log/x11vnc.log &

这可能会给您一个起点。

相关内容