View Full Version : [ubuntu] Enable Remote Desktop from command line

December 19th, 2008, 05:56 AM
I have a server running Ubuntu Server 8.10. I'm installing the Ubuntu desktop and would like to connect to the desktop remotely. I don't have a monitor or keyboard attached to the server. Is there a way of turning on Remote Desktop Sharing on this server using only the command line?

December 19th, 2008, 06:33 AM

export DISPLAY=:0.0

December 19th, 2008, 11:13 AM
if you want remote desktop you will be obliged to log in automatically onto the server first.

invoke-rc.d gdm restart

activate remote desktop
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true

disable prompt to authorize the connection
gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false

encode your password in base64 using a file and assign it
echo password > file
base64 file
gconftool-2 -s -t string /desktop/gnome/remote_access/vnc_password result-of-passwd-encoding

select the authentication method
gconftool-2 -s -t list --list-type=string /desktop/gnome/remote_access/authentication_methods \[vnc\]

You should be able to connect to the remote desktop.

If you don't want to activate autologin then you should install vncserver.