有时候我们会使用一些 headless的服务器,在这些服务器上,如果我们运行了一个vnc桌面,通常情况下它们会保持最低分辨率也就是800*600,同时也无法直接修改它的分辨率。这并不利于操作,因此我们需要为系统添加一个虚拟驱动用以修改分辨率。
首先以debian9为例,我们安装以下驱动:
apt-get install xserver-xorg-video-dummy
然后黏贴以下的xorg桌面配置。由于现在的xserver一般可以自动识别显示器,因此通常情况下不会生成xorg.conf,而我们通过手动设置配置文件就可以达到控制xserver显示驱动并且设定分辨率的效果。我们编辑/etc/X11/xorg.conf如下:
Section "Device" Identifier "Configured Video Device"
Driver "dummy"
VideoRam 256000
EndSection
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 5.0 - 1000.0
VertRefresh 5.0 - 200.0
ModeLine "1920x1080" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +Hsync +Vsync
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080"
EndSubSection
EndSection
重启后,即可使得VNC桌面分辨率达到1920*1080,大大增加了vnc桌面的可操作性