Headless X Server Linux


Recommended Posts

I want to run a x server on a headless linux box without monitor or graphics card and then use vnc to access the x server. problem is I can't seem to find a way to get x server up and running without a graphics card. Any ideas?

Link to comment
Share on other sites

If you want to use it for administration and other purposes, I suggest you familiarize yourself with FreeNX.

freenx.berlios.de

You can acquire the client to use with FreeNX for Windows and Linux from:

www.nomachine.com

This way you can 'skip' the headless issues (There are some with different applications).

Link to comment
Share on other sites

Or you could setup X with a framebuffer, doesn't show anything, but allows it to run, then you can SSH in, do X forwarding, and see a normal X11 session.

Link to comment
Share on other sites

Since when is it possible to see a "normal X session" over SSH via X forwarding? You don't need a framebuffer to do that. Just install X on the server, enable X forwarding, and then SSH over. You'll be able to run X applications, such as firefox, not an X session (such as GDM).

Link to comment
Share on other sites

Ok I think I understand what needs to be done but the problem is I can't get the X server to run in the first place so forwarding and all that is secondary. Each time I try runnin the X server with startx it exits with the following error

Fatal server error:

xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)

Any help?

Link to comment
Share on other sites

What are you trying to do *exactly*? If all you want to do is run a single application then do what I said in my previous post. You don't have to startx first. What hardware are you running that doesn't need a video card to boot?

Link to comment
Share on other sites

Since when is it possible to see a "normal X session" over SSH via X forwarding? You don't need a framebuffer to do that. Just install X on the server, enable X forwarding, and then SSH over. You'll be able to run X applications, such as firefox, not an X session (such as GDM).

No, it's not possible to see a "normal X session" via X forwarding, but VNC can be used to do this. I've done this many times. You need x11vnc and you forward the VNC connection over SSH, quite easy.

To the OP, this is very easy. You need Xvfb (X virtual framebuffer). This server creates a framebuffer in memory to which it renders. Here are the steps.

1. Launch the X server using the following command on the server:

Xvfb :1 -screen 0 800x600x16 -ac

This will create a X server with a 800x600 screen on display :1 and disable access controls. You should probably launch this in the background.

2. Once the server is up, run an application which connects to display :1 The first app you'll probably want to run is a WM. Maybe you'll want to run blackbox with the following command:

DISPLAY=:1 blackbox

3. From your client computer, create an SSH connection to the server, tunneling port 5900 (VNC server 0) and run the application x11vnc. The following command can be used from a terminal (bash, csh, etc):

ssh -l username -L 5900:localhost:5900 localhost 'x11vnc -localhost -display :1'

4. From your client computer, use a VNC viewer and connect to localhost.

Ok, maybe not so easy, and a bit confusing. But once you done it several time, it makes perfect sense and you realise it's VERY easy.

Link to comment
Share on other sites

  • 2 years later...

Hello all!

I needed to do exactly what described in the previous post but, as soon as I run the command:

Xvfb :1 -screen 0 800x600x16 -ac

I receive the following error, which I really have no clue on how to solve (also googled a lot, but not able to find any solution):

# Xvfb :1 -screen 0 800x600x16 -ac

(EE) config/hal: NewInputDeviceRequest failed

(EE) config/hal: NewInputDeviceRequest failed

(EE) config/hal: NewInputDeviceRequest failed

(EE) config/hal: NewInputDeviceRequest failed

(EE) config/hal: NewInputDeviceRequest failed

Any hints?

Many thanks!

No, it's not possible to see a "normal X session" via X forwarding, but VNC can be used to do this. I've done this many times. You need x11vnc and you forward the VNC connection over SSH, quite easy.

To the OP, this is very easy. You need Xvfb (X virtual framebuffer). This server creates a framebuffer in memory to which it renders. Here are the steps.

1. Launch the X server using the following command on the server:

This will create a X server with a 800x600 screen on display :1 and disable access controls. You should probably launch this in the background.

2. Once the server is up, run an application which connects to display :1 The first app you'll probably want to run is a WM. Maybe you'll want to run blackbox with the following command:

3. From your client computer, create an SSH connection to the server, tunneling port 5900 (VNC server 0) and run the application x11vnc. The following command can be used from a terminal (bash, csh, etc):

4. From your client computer, use a VNC viewer and connect to localhost.

Ok, maybe not so easy, and a bit confusing. But once you done it several time, it makes perfect sense and you realise it's VERY easy.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.