Ubuntu Server - VNC issue - Will not connect unless im logged in

Soldato
Joined
1 Dec 2004
Posts
23,047
Location
S.Wales
Hi,

Iv managed to get VNC working fine over LAN/WAN, however it will only connect if i log into the box manually (not through command line etc) but physically turn on the monitor and login to ubuntu

Is there anyway to stop this from happening so I can login even from a cold boot in the morning as i usually turn it on when I goto work, but usually its not attached to a monitor.

Thanks
 
you can start it through /etc/rc.local
Code:
su - username -c '/usr/bin/vncserver -depth 16 -geometry 1152x864 :1' &

change username to your login name.
 
I had an RDP server running on debian once, it was always running and would create a new login for the client, rather then provide control of the UI devices.
 
Any other tips on getting VNC server running straight off a boot without logging into Ubuntu, havnt had a chance to get on this but im going to try what was mentioned in deadite's post above.

I need someway of either getting VNC server running straight from a cold boot (as at the moment VNC will only run if you log into the Ubuntu box from the ubuntu login) or some way of initiating VNC server from a remote machine using putty.

Thanks, will let you know how I get on.
 
You'll need to either create an init script for this (like the ones already in /etc/init.d) or you can add your command to the end of /etc/rc.local.
 
so the following code

Code:
su - username -c '/usr/bin/vncserver -depth 16 -geometry 1152x864 :1' &
replacing username with my username

place somewhere in the /etc/rc.local file? where about in that file?
 
so the following code

Code:
su - username -c '/usr/bin/vncserver -depth 16 -geometry 1152x864 :1' &
replacing username with my username

place somewhere in the /etc/rc.local file? where about in that file?

I haven't got the foggiest if switching user in a script will work! I would however have thought that you would either want it running as root (which it will do by default if it's in rc.local), or more preferably a service account.

When you installed the vnc server - did you do it from your distros repos? If so - have you checked to see if an init script was created for you - as this would be the preferred method (you can just add that script to the boot sequence)
 
I haven't got the foggiest if switching user in a script will work! I would however have thought that you would either want it running as root (which it will do by default if it's in rc.local), or more preferably a service account.

When you installed the vnc server - did you do it from your distros repos? If so - have you checked to see if an init script was created for you - as this would be the preferred method (you can just add that script to the boot sequence)


I installed VNC server not from the root account but from one of the accounts I created when I installed Ubuntu (darren).

could you point me in the right direction to this init scrip and how do I add it to boot sequence?
 
try "sudo apt-get install tightvnc", then "sudo /etc/init.d/vncserver"

(if tightvnc isn't there - "apt-cache search vnc | grep server" should give you a list of vnc servers you can install)

If that's successful - you can add it to your bootup sequence a tool like like rc-update or chkconfig.
 
try "sudo apt-get install tightvnc", then "sudo /etc/init.d/vncserver"

(if tightvnc isn't there - "apt-cache search vnc | grep server" should give you a list of vnc servers you can install)

If that's successful - you can add it to your bootup sequence a tool like like rc-update or chkconfig.

Im sorry but im still not understanding,

I already have VNCServer installed, why do I need to install tightvnc?? with regards to the bootup sequence, where is this and how do I edit this to include VNC.
 
The default Gnome VNC server (Vino) doesn't support loading before login :)
TightVNC does, hence why you want to install it.


Wandering slightly OT here, but I've noticed that the TightVNC server will only do clipboard transfer to the terminal clipbuffer, not the main Gnome clipboard. I've shoved Parcellite on there to syncronise the two, but have I missed something?

-Leezer-
 
Ok, tightvnc installed and all working, all I need to do is to add tightvnc to boot sequence, iv had a look on google but cant find what I need :(
 
Back
Top Bottom