Menu

Create virtual screen for ubuntu server or Set resolution on headless server

1. Insert a dummy video driver: sudo apt-get install xserver-xorg-video-dummy
nếu cài gói trên không làm việc thì cài thêm gói này: sudo apt-get install -y x11vnc
2. Since there's no default xorg.conf file that I could find anywhere, AND there are several locations where you can supposedly put it (/etc/X11, /usr/share/X11, ~) I created one and placed it in /etc/X11:

Add or replace xorg.conf with below content
sudo vim /usr/share/X11/xorg.conf.d/xorg.conf

Modeline "1280x800" 24.15 1280 1312 1400 1432 800 819 822 841

ModeLine "1280x1024" 108.00 1280 1328 1440 1688 1024 1025 1028 1066 +HSync +VSync

ModeLine "1366x768" 85.9 1366 1438 1626 1798 768 769 772 795 +hsync +vsync

Tham khao ModeLine: https://www.mythtv.org/wiki/Modeline_Database



Code:
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

For 1360x768


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 "1360x768"
    EndSubSection
EndSection
Then restart the computer.
For 1024x768

The content of xorg.conf should be like that:

Code:
Section "Device"
Identifier "VNC Device"
Driver "vesa"
EndSection

Section "Screen"
Identifier "VNC Screen"
Device "VNC Device"
Monitor "VNC Monitor"
SubSection "Display"
Modes "1024x768"
EndSubSection
EndSection

Section "Monitor"
Identifier "VNC Monitor"
HorizSync 30-70
VertRefresh 50-75
EndSection



Không có nhận xét nào :

Đăng nhận xét