Possible Duplicate:
Automatically start VNC server on startup

I have a Linux server at home, and by default no-one is logged in to that box.

I'd like to establish a remote desktop connection to it with VNC but this fails, unless I log in first physically.

It's strange to me that VNC Viewer doesn't even ask for credentials, it just displays a "connection refused" error message.

What's the best way to do this? I'm running Ubuntu 10.04 on the server.

link|improve this question

75% accept rate
1  
Oops, I was WRONG about the following being a duplicate! -- possible duplicate of Automatically start VNC server on startup – Arjan Sep 5 '10 at 11:25
@Arjan @Diago this is not a duplicate. The other question is about the VNC server ONLY. This question also covers other remote desktop solution. Voting to reopen. – BloodPhilia Sep 5 '10 at 18:49
@Blood FYI. Dual notifications in comments don't work. Furthermore, I fail to see how this covers other solutions, also there is a duplicate of that already as well. – Diago Sep 5 '10 at 19:40
@Diago, unlike BloodPhilia I disagree about this question being about other remote desktop things as well. It is all about VNC, if you'd ask me. HOWEVER, if I understand correctly, then maybe a running VNC server on Linux still does not allow one to use it unless someone actually logged in on the box itself? If I'm wrong there, then we were right about this being a duplicate, but just in case I was wrong: voting to reopen. – Arjan Sep 5 '10 at 19:56
Wabbit: can you confirm that the VNC server is actually running before someone logs in? – Arjan Sep 5 '10 at 19:57
show 2 more comments
feedback

closed as exact duplicate by Arjan, Diago Sep 5 '10 at 16:39

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

3 Answers

up vote 2 down vote accepted

I believe that vnc is not the same as windows remote desktop - it is for screen sharing so if you are not logged in the vnc service won't be running.

The solutions would be to set your home server to log in automatically or run an xserver on your remote computer and connect using ssh/putty. I used to use cygwin and always connected to my ubuntu box with ssh -X but just tried out xming and am impressed. After a full install if you run xlaunch, set to run fullscreen, and run gnome-session remotely connecting with putty - it is just like remote desktop and seems quicker than vnc on my lan.

link|improve this answer
I've enabled automatic log in on the Linux box, but it doesn't work when no monitor is plugged in (otherwise it would do just fine). Now I'm going to experiment with finding a way to install and configure an xserver. Thanks for the tips! – Wabbitseason Sep 4 '10 at 10:42
That is strange - when you say it doesn't work do you get an error? Is it still logging into X? – Adam Butler Sep 4 '10 at 11:06
According to my recent research when Ubuntu cannot see an attached monitor at boot time, it just won't start the X environment. – Wabbitseason Sep 4 '10 at 11:09
I'm sure it must be possible do you have a monitor configured? What error do you get in the X log file? A quick google found this post readactor.com/tutorials/… maybe ssh -X might be easier - personally I use the cygwin xserver, I find it a little slow, don't know what better free options there are. – Adam Butler Sep 5 '10 at 9:24
xming works perfect. – BloodPhilia Sep 5 '10 at 12:50
feedback

VNC and remote desktop operate on different principles. The basic operating model for remote desktop is that it gives you access to the remote machine's actual, physical display; it doesn't give you a remote connection to the machine independently of what the local user is doing. The basic operating model for VNC is that it provides a virtual display that you can connect to remotely; VNC operates independently of what a local user may be doing.

If you want to run graphical applications on your Linux machine and have them display on your local machine, VNC is not the first tool that comes to mind. The unix way of doing this is to use ssh -X to connect to the remote machine; then remote X applications are displayed on the local X display. This does require that you have an X server locally; for Windows, this requires yet another program to be installed and set up.

If you want to be able to start a graphical application on the Linux machine, and connect to it from anywhere in the world, run a VNC server (vncserver command). This creates a virtual display that you can connect to from anywhere (barring firewalls). Run a VNC client to see what is displayed on that virtual display.

If you want to have direct access to the X server that is displaying on the Linux machine's monitor, check out x2vnc.

link|improve this answer
feedback

If you installed VNC as a regular program for the local user to run, it would be expected to get a "connection refused" since that VNC server isn't running when the user hasn't logged on and started the server.

IIRC there is an option to install VNC as a Windows service. I haven't used VNC in a long time, but I assume that would make it possible for the VNC server to run without a user being logged in.

link|improve this answer
I'm looking for a way to connect to the Linux box from other computers. I don't think that it would be necessary to install a Windows service to do that. – Wabbitseason Sep 4 '10 at 10:39
Sorry. I completely misread the post :P – GummiV Sep 4 '10 at 10:55
feedback

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