Running Ubuntu Without A Monitor Attached – X Fails

Recently I just setup another set of servers for my website hosting business.  In doing so, these new servers did not have the standard nVidia video card installed – but had an ATI HD Radeon and the other had an Intel graphics card.

When attempting to get them to boot without an attached monitor, the X server would not – giving errors saying ‘no screens found’.  Both the intel and the radeon drivers kept saying “No outputs definitely connected, trying again…”.

I restarted the servers several times trying things.  I re-ran “X -configure” to capture all of the details – but everytime the ubuntu servers restarted, it simply would not enable the screens when no monitors were connected.

I spent at least a full day browsing the Ubuntu forums trying to find a solution for this issue.  The thing is – I do not have any screens connected to the servers in the data centers – nor do I need them.  What I do need is the ability for the X server to still load so a cron script will start x11vnc and allow me to remotely connect in and access them.

Many posts later, I was stumped.  But, there were a number of pointers that I took from several posts.

The main thing is – if you are not using a monitor and just need a standard 1024×768 screen resolution, my solution seems to work well in Ubuntu 10.04.  I’m sure it also works in Ubuntu 11.04 and probably Ubuntu 12.04 as well.  In the coming weeks, I’ll be upgrading to the newer release to get up to date.

OK, without further introduction information, here is how I did it.

The first part was to down the EDID file from the monitor.  This was no easy task.  I kept reading over and over how I needed to run nvidia-settings and hit “Acquire EDID” to get a copy of the EDID BIN file.  But, I don’t have an nVidia graphics card, so this wouldn’t work!  Therefore, I managed to find a program – “get-edid”.  I then used the command below to obtain a copy of my monitor’s EDID file and save it:

get-edid > edid.bin

This then made the EDID file on my computer.  If you’d like, and you just simply need a 1024×768 VNC connection with 32-bit depth, my EDID file will work fine for you.  You may download my monitor’s EDID file here.

After this was done, I then copied the EDID file to the /etc/X11 directory.

Next step was to get the X configuration:

X -configure

This will then make a file in your home directory – xorg.conf.new.  Open that file and carefully pay attention to the “BusID” that is in the “Device” section.  This piece you definitely will need when creating your /etc/X11/xorg.conf file (if you choose to just copy my file below).

Next step – was to NOT use the radeon or intel driver.  If you just need to make a remote VNC connection to a computer without a monitor connected, you shouldn’t need any performance tweaks or other proprietary functionality.  So, I then copied the xorg.conf.new over to /etc/X11/xorg.conf and made a few modifications.

#1 – I added some information for a monitor (the monitor I made the EDID file for).  This highlights those changes under the “Monitor” section.

Identifier   “VGA-0”
VendorName   “ACR”
ModelName    “Acer S202HL”
HorizSync    30.0 – 80.0
VertRefresh  50.0 – 76.0
Option      “DPMS”

As you can see, I hadded HorizSync and VertRefresh.  The other settings were in there by default.

#2 – Under the Device section, I changed the driver from either “intel” or “radeon” to the generic “vesa” driver and added a CustomEDID option:

Option   “CustomEDID”    “VGA-0:/etc/X11/edid.bin”
Identifier  “Card0”
Driver      “vesa”

Please note the VGA-0 there – which is the name of the monitor listed above.  Ensure these all match up.

#3 – I modified the “Screen” section just slightly:

Monitor    “VGA-0”

Again, this matches up with the Monitor and Device sections.  Finally, I saved it, rebooted the machines, and BOTH of them worked!  Neither of them have a monitor connected, and now the X server starts up and shows a GUI without a problem.

So, for reference, here is my complete xorg.conf file.  You can certainly choose to use this if you are just wanting a 1024×768 VNC remote connection with a depth of 24 bits.

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  “dri”
        Load  “dbe”
        Load  “record”
        Load  “extmod”
        Load  “dri2”
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”
        #DisplaySize      440   250     # mm
        Identifier   “VGA-0”
        VendorName   “ACR”
        ModelName    “Acer S202HL”
        HorizSync    30.0 – 80.0
        VertRefresh  50.0 – 76.0
        Option      “DPMS”
EndSection

Section “Device”
       Option   “CustomEDID”    “VGA-0:/etc/X11/edid.bin”
       Identifier  “Card0”
       Driver      “vesa”
       VendorName  “ATI Technologies Inc”
       BoardName   “Unknown Board”
       BusID       “PCI:1:5:0”
EndSection

Section “Screen”
        Identifier “Screen0”
        Device     “Card0”
        Monitor    “VGA-0”
        Defaultdepth 24
        SubSection “Display”
                Viewport   0 0
                Modes “1024×768”
                Depth     1
        EndSubSection
        SubSection “Display”
                Viewport   0 0
                Modes “1024×768”
                Depth     4
        EndSubSection
        SubSection “Display”
                Viewport   0 0
                Modes “1024×768”
                Depth     8
        EndSubSection
        SubSection “Display”
                Viewport   0 0
                Modes “1024×768”
                Depth     15
        EndSubSection
        SubSection “Display”
                Viewport   0 0
                Modes “1024×768”
                Depth     16
        EndSubSection
        SubSection “Display”
                Viewport   0 0
                Modes “1024×768”
                Virtual 1024 768
                Depth     24
        EndSubSection
EndSection

I hope this post comes in useful for others looking to simply be able to remotely connect to a computer using VNC without having a monitor attached!