Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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"
EndSection

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

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

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

ANSWER:

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
2  
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
add comment

2 Answers

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
add comment

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 xorg.org 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
show 2 more comments

Your Answer

 
discard

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.