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 have a server and my laptop. I want to be able to start vnc server on the server and then connect from my laptop. Both are running ubuntu 11.10 64 bit desktop

On my server, i installed tightvncserver. I set it up with a password, no view only password. I ssh to the box and typed

vncserver :42

Now on my laptop, I installed gtkvncviewer and ran it. It popped up a box. I entered the picard:42 (the name of the server in my /etc/hosts file) and the password. I tried with and without the user. It always disconnects immediately.

Can anyone point out what I'm doing wrong? Is it because I'm not running a GUI session currently on picard? If so, how can I start the Xwindows session remotely to connect with vncserver?

share|improve this question
    
i've added some hints how to proceed - does it work now? –  tohuwawohu Apr 11 '12 at 9:08
add comment

1 Answer

Which is the default runlevel? AFAIK this is configured in /etc/init/rc-sysinit.conf. Setting DEFAULT_RUNLEVEL to 2 should make the server start the X environment. Alternatively, you could use ssh to start a complete gnome session on the server, displaying it on the client, using ssh -X remote-user@server gnome-session. But this will require some bandwith, so it may be better to start the desired application directly.

EDIT: here's the x11vnc command line to start the vnc server and let the remote user log into a gnome session:

sudo x11vnc -safer -localhost -once -nopw -auth /var/lib/gdm/:0.Xauth -display :0

(From the Ubuntu Communitiy docs on VNC)

share|improve this answer
    
Yes, 2 is the default run level and it is starting X Windows on the box. But I'm not sure why VNC is not working. –  Thom Apr 10 '12 at 14:34
    
hmm - some points: if you've installed x11vnc, i would expect x11vnc -safer -display :0 as command to start the server. Then: Did you try to increase debug output using the -v option (x11vnc -v -display :0)? Finally: If the -voption doesn't give any errors, you can re-check if the server is running using sudo netstat -atpn. This will give you a list of services running and listening for connections. –  tohuwawohu Apr 10 '12 at 16:04
add comment

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.