Skip to content

Instantly share code, notes, and snippets.

@mangoliou
Last active May 18, 2023 01:42
Show Gist options
  • Save mangoliou/27c6c5867a95932f21ae59ad7152aa33 to your computer and use it in GitHub Desktop.
Save mangoliou/27c6c5867a95932f21ae59ad7152aa33 to your computer and use it in GitHub Desktop.
# apt-get install
sudo apt-get update
# For ubuntu 14.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-trusty
# For ubuntu 16.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-willy
# Copy the xorg.conf to `/etc/X11/xorg.conf`.
wget -P /etc/X11 https://gist.githubusercontent.com/mangoliou/ba126832f2fb8f86cc5b956355346038/raw/b6ad063711226fdd6413189ad905943750d64fd8/xorg.conf
# Restart Ubuntu. The resolution will be 1920x1080.
# Export XAUTHORITY
export XAUTHORITY=/home/admin/.Xauthority
# Or
export XAUTHORITY=/var/run/lightdm/root/:0
# Query the reoslution.
xrandr -d :0 -q
# Change resolution in terminal.
xrandr -d :0 --output default --mode 1280x960
# The resolution will be 1280x960 without resarting Ubuntu.
@grug84
Copy link

grug84 commented Oct 8, 2018

For ubuntu 16.04

sudo apt-get install -y xserver-xorg-video-dummy-lts-wily
It should be with one l

@Honghe
Copy link

Honghe commented Dec 19, 2018

How to deal with the original xorg.conf generated by Nvidia?

cat /etc/X11/xorg.conf

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 410.78

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment