You are not logged in.

#1 2008-11-16 10:59:23

Venator85
Member
From: Italy
Registered: 2007-10-18
Posts: 62

Starting a VNC session to a PC with no X running

Hi, I have a headless PC which I use as a gateway/server for my network, which is basically always on. I have XFCE installed but no GDM (or similar). It may happen that I have to start a VNC session with that PC but since it is not running X most of the times, and physically get to the PC, login and give 'startx' is a little complicated, I'd want to know if it is possible to somehow start X remotely.
Note that I don't like solutions like XDMCP, since I need to use XFCE so rarely that it would be a waste of resources to constantly keep X and GDM running.
I have SSH access to the machine, so the ideal solution would be to login via SSH, somehow "do startx" and then connect with VNC.
Any hints?
Thanks wink

EDIT: I forgot to mention that I only need one user (me big_smile) at a time to be connected via VNC to the remote PC.

Last edited by Venator85 (2008-11-16 11:03:08)

Offline

#2 2008-11-16 12:19:07

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Starting a VNC session to a PC with no X running

You don't need to start X - just start the vnc server.

FWIW I run my headless boxes via SSH exclusively. You should look at the kind of things you do remotely, and see if you would be comfortable doing them that way instead.

Offline

#3 2008-11-16 13:41:21

mcover
Member
From: Germany
Registered: 2007-01-25
Posts: 134

Re: Starting a VNC session to a PC with no X running

It works if you use Xvnc. You need to install tightvnc for that. Use vncserver to start it (just a wrapper around Xvnc). Best if you setup port forwarding:

ssh -L 5901:localhost:5901 user@host            (to connect  use vncviewer localhost::5901)

then when you are logged in:

vncserver

If port is not 5901 (5900 + screen-no), use -rfbport to specify.

vncserver -kill :1   (1 being screen number, if you're not running X it might as well be 0)

to kill server. have a look at .vnc/xstartup after you started server for first time. You might want to disable some stuff or add your own stuff like startxfce4.

Offline

#4 2008-11-16 17:05:12

Venator85
Member
From: Italy
Registered: 2007-10-18
Posts: 62

Re: Starting a VNC session to a PC with no X running

It worked! Perfect! cool
Many thanks big_smile

Offline

Board footer

Powered by FluxBB