Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu 12.04 and I want to boot directly and headless in the terminal (no GUI). After that I want to startx to start a program in xterm.

When I boot 'headed', everything is working like supposed to, but: - When I boot headless, startx is not working (no screens found)

I already tried to change xorg.conf to below, but it didn't not work:

Section "Device"
    Identifier     "VNC Device"
    Driver         "vesa"

Section "Screen"
    Identifier     "VNC Screen"
    Device         "VNC Device"
    Monitor        "VNC Monitor"
    SubSection     "Display"
        Modes "1280x1024"

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

How can I boot headless and still be able to run startx?


Adding the BusID to the Devices section in the xorg.conf above, fixed the problem for me.

BusID "PCI:1:00:1"
share|improve this question
Do you just want to boot into the console? Why is xterm necessary? what program are you trying to run? – izx Jun 28 '12 at 6:26

In your Xorg.conf try using the dummy driver instead of vesa. After running startx you should then execute export DISPLAY=:0 (:0 for the first X display), then you can run xterm, which you will not see of course.

I assume you want to connect via vnc, or something similar afterwards.

share|improve this answer

Maybe you mean to gain shell access to the headless server? Install openssh-server on it and use ssh to connect to that from another computer. THEN, from your workstation, you can ssh -X serverhostname to ssh with X into that headless server. Once on the command line, you can run xterm & and then a new window will pop up on YOUR local X session from that remote machine. So you do still install xterm (or any other gui program) on the server but you do not install any pseudo packages like ubuntu-desktop. I often install firefox, nautilus, and xfce-panel (and many utilities) on a server then I will run that panel on my local desktop and can monitor the server this way.

share|improve this answer
Thank you for your reply, but I think that is not what I want(not sure). I need to start X on the server to be able to start webcam capture and image processing. I got everything already working on Ubuntu 10.10 with the xorg.conf from my post. But in Ubuntu 12.04 it does not work. Any other ideas would be welcome! – NeViXa Jun 28 '12 at 7:26
You do not need X to capture webcam; X is solely to render graphical output to a monitor. Further, if there is not an attached monitor, I doubt that X would run in ubuntu 10.10 (but anything is possible!) – Chris K Jun 28 '12 at 7:32
We need X to run our own image processing program. I got 20 headless Ubuntu 10.10 servers running here that boot in the console. With exact same as in my post. Then on my command they startx with a .xinitrc that starts metacity, vino-server and xterm and an xterm containing my program. On occasion we do want to see what is actually happening on the server and with our program. Thats why we do need graphical output. – NeViXa Jun 28 '12 at 7:37
Wow, that's certainly interesting. I used headless servers with apache/php to manipulate images. Coming from the outside, it sounds like instead of patching 12.04 to work like 10.10 did, maybe redesign the software to not require X? Then your "patch" is to continue running 10.10 until a more proper solution? Does 12.04 with Unity even run metacity? (seriously, trying to help, not be a pest WRT X running) – Chris K Jun 28 '12 at 7:41
The systems works exactly like it supposed to if there is a monitor connected. So, yes, metacity runs on Ubuntu 12.04. But without monitor connected, it does not work (on 12.04). – NeViXa Jun 28 '12 at 7:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.