Ubuntu – How to set external monitor as default

external-monitorxorg

I have connected an external monitor to my laptop through HDMI. Currently either my Desktop is getting extended to the external monitor (with native resolution) or low resolution on both when I choose "Same Image in both".

How can I ensure that the external monitor is used by default and the laptop monitor just blanks.

I generated the xorg.conf file by doing:

X -configure

The following is the content of xorg.conf.new file generated in my user folder. Should I copy this anywhere? Should I edit the contents?

Section "ServerLayout"
    Identifier      "X.org Configured"
    Screen          0 "Screen0" 0 0     
    InputDevice     "Mouse0" "CorePointer"
    InputDevice     "Keyboard0" "CoreKeyboard" 
EndSection

Section "Files"
    ModulePath      "/usr/lib/xorg/modules"
    FontPath        "/usr/share/fonts/X11/misc"
    FontPath    "/usr/share/fonts/X11/cyrillic"
    FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/Type1"
    FontPath    "/usr/share/fonts/X11/100dpi"
    FontPath    "/usr/share/fonts/X11/75dpi"
    FontPath    "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
    FontPath        "built-ins" 
EndSection

Section "Module"
    Load    "glx"
    Load    "dri2"
    Load    "record"
    Load    "extmod"
    Load    "dbe"
    Load    "dri" 
EndSection

Section "InputDevice"
    Identifier  "Keyboard0"
    Driver          "kbd"
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver          "mouse"
    Option      "Protocol" "auto"
    Option          "Device" "/dev/input/mice"
    Option      "ZAxisMapping" "4 5 6 7" 
EndSection

Section "Monitor"
    Identifier      "Monitor0"
    VendorName      "Monitor Vendor"
    ModelName       "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<fHz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "NoAccel"               # [<bool>]
        #Option     "SWcursor"              # [<bool>]
        #Option     "ColorKey"              # <i>
        #Option     "CacheLines"            # <i>
        #Option     "Dac6Bit"               # [<bool>]
        #Option     "DRI"                   # [<bool>]
        #Option     "NoDDC"                 # [<bool>]
        #Option     "ShowCache"             # [<bool>]
        #Option     "XvMCSurfaces"          # <i>
        #Option     "PageFlip"              # [<bool>]  Identifier  "Card0"
    Driver      "intel"     BusID      
"PCI:0:2:0" EndSection

Section "Screen"
    Identifier  "Screen0"
    Device      "Card0"
    Monitor     "Monitor0"
    SubSection "Display"
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
 EndSection

Best Answer

I see you have intel driver. You shouldn't need xorg.conf anymore at all.

Just plug in the external display, go to monitor settings and configure the displays the way you want:

enter image description here

Then click "Make Default". After this Ubuntu should automatically detect whenever you connect your external monitor and automatically change display settings.