Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old September 28th, 2006   #1
srf21c
A Carafe of Ubuntu
 
Join Date: Sep 2006
Location: Southwestern US
Beans: 94
Ubuntu 6.10 Edgy
Send a message via Yahoo to srf21c
HOWTO: Enable and control the gnome VNC vino-server from the command line

CAVEAT: A user must already be logged into the desktop on the target machine for this to work

Here is a cool trick for remotely enabling the gnome vino VNC server (assuming that it's already been installed and configured) on a box that you only have SSH access to.

Log into the target system using SSH, and run the following command:
Code:
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
You can also monkey with the vino server options by editing this file

/home/<userhomedir>/.gconf/desktop/gnome/remote_access/%gconf.xml

Let's say you want to disable the "Ask you for confirmation" setting, or change the password.

Easiest way to do it:

1) On your own Ubuntu box; Go to System => Preferences => Remote Desktop. and configure the Remote Desktop Preferences to your liking, then click close.

2) Navigate to ~/.gconf/desktop/gnome/remote_access/ in your home directory, open up the %gconf.xml file, and copy the contents.

3) Establish an SSH connection to the remote box, change directory to /home/<userhomedir>/.gconf/desktop/gnome/remote_access/ directory, and backup the existing %gconf.xml file.
Code:
mv %gconf.xml %gconf.xml.bak
4) Create a new %gconf.xml file,
Code:
vi %gconf.xml
then paste in the contents for your own %gconf.xml file that you copied in step number 2.

5) Stop and start the vino server from the command line
Code:
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled false
gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
6) Connect to the target system using your vnc client. When I'm on my Ubuntu workstation, I prefer to connect securely via SSH with the following command
Code:
vncviewer -via username@somehost.com targetboxhostname:0

Last edited by srf21c; November 9th, 2006 at 12:39 PM.. Reason: add "enable" to title for better search visibility
srf21c is offline   Reply With Quote
Old October 1st, 2006   #2
motin
Skinny Soy Caramel Ubuntu
 
Join Date: Mar 2006
Location: Stockholm, Sweden
Beans: 683
Ubuntu Studio Karmic Koala (testing)
Re: HOWTO: Control the gnome VNC vino-server from the command line

Very interesting. Although I am in the same situation I cannot really use your guide, since I am using Putty from Windows... Can you maybe add some comments on how to achieve the same stuff in my situation? In case you know of course...
motin is offline   Reply With Quote
Old October 2nd, 2006   #3
srf21c
A Carafe of Ubuntu
 
Join Date: Sep 2006
Location: Southwestern US
Beans: 94
Ubuntu 6.10 Edgy
Send a message via Yahoo to srf21c
Re: HOWTO: Control the gnome VNC vino-server from the command line

You are perfectable capable of setting each value in the /home/<userhomedir>/.gconf/desktop/gnome/remote_access/%gconf.xml file manually using the gconftool-2 command.

I was unable to dig up any documentation on proper syntax of the %gconf.xml file so I did not feel qualified on delving into this method in more detail on my original post.

If you examine an existing %gconf.xml file, and compare that to the gconftool-2 command syntax that I have already posted, you should be able to figure out how to set the other parameters.
srf21c is offline   Reply With Quote
Old October 8th, 2006   #4
motin
Skinny Soy Caramel Ubuntu
 
Join Date: Mar 2006
Location: Stockholm, Sweden
Beans: 683
Ubuntu Studio Karmic Koala (testing)
Re: HOWTO: Control the gnome VNC vino-server from the command line

I have come so far that the vino server asks me for a password. A password that I cannot remember at all.

The problem is that I cannot change it via CLI. It is not written in plain text in ~/.gconf/desktop/gnome/remote_access/%gconf.xml, so changing it to "qwerty" in the file doesn't help.

Also, the command:
Code:
gconftool-2 -s -t string /desktop/gnome/remote_access/vnc_password qwerty
Just does the same thing as changing the file manually - ie doesn't help.

Do you or someone else now in what hash-type the vino passwords are written in?
motin is offline   Reply With Quote
Old October 8th, 2006   #5
motin
Skinny Soy Caramel Ubuntu
 
Join Date: Mar 2006
Location: Stockholm, Sweden
Beans: 683
Ubuntu Studio Karmic Koala (testing)
Re: HOWTO: Control the gnome VNC vino-server from the command line

I started a new thread on the matter (generating the password): http://ubuntuforums.org/showthread.php?p=1592817
motin is offline   Reply With Quote
Old October 9th, 2006   #6
srf21c
A Carafe of Ubuntu
 
Join Date: Sep 2006
Location: Southwestern US
Beans: 94
Ubuntu 6.10 Edgy
Send a message via Yahoo to srf21c
Re: HOWTO: Control the gnome VNC vino-server from the command line

Don't know what the vino server hash-type is, but here's the string I get after setting the vino password to "qwerty"

<entry name="vnc_password" mtime="1160442984" type="string">
<stringvalue>cXdlcnR5</stringvalue>
</entry>

Last edited by srf21c; October 11th, 2006 at 02:53 AM..
srf21c is offline   Reply With Quote
Old October 9th, 2006   #7
jdong
Ultimate Coffee Grinder
 
jdong's Avatar
 
Join Date: Oct 2004
Location: Cambridge. MA
Beans: 5,063
Ubuntu 8.10 Intrepid Ibex
Re: HOWTO: Control the gnome VNC vino-server from the command line

Have you tried an htpasswd hash in there?
jdong is offline   Reply With Quote
Old March 21st, 2007   #8
frafu
Quad Shot of Ubuntu
 
Join Date: Jun 2006
Beans: 481
Edubuntu 6.10 Edgy
Re: HOWTO: Control the gnome VNC vino-server from the command line

To open the "Login Window" preferences, you have to type into the terminal after opening your ssh -Y connection:

Code:
sudo gdmsetup
To open the "Remote Desktop" preferences, you have to type into the terminal:

Code:
sudo vino-preferences
But, the changes made in the forwarded preferences seem not to be effective in the session created by the auto-login at startup.
frafu is offline   Reply With Quote
Old June 17th, 2007   #9
frafu
Quad Shot of Ubuntu
 
Join Date: Jun 2006
Beans: 481
Edubuntu 6.10 Edgy
Re: HOWTO: Control the gnome VNC vino-server from the command line

Do you have an X server running on your local machine? If so, try to connect through sh with the following command:

Code:
 
ssh -Y loginname@remotecomputerip
Because of the -Y option, the gui of the application started on your remote computer should be displayed on your local machine if there is a X server running on your local machine.

Particularly, you should be able to start the synaptic Package Manager and reinstall vino. Afterwards, you should start "vino-preferences" from the shell which should display the gui of the preferences on your local machine. There you should be able to enable vino (=vnc server of the remote machine)

Have a nice day.
frafu is offline   Reply With Quote
Old June 17th, 2007   #10
theQmaster
A Carafe of Ubuntu
 
Join Date: Jul 2005
Beans: 107
Re: HOWTO: Control the gnome VNC vino-server from the command line

I my windows' putty I typed the command by I get
ssh: connect to host localhost port 22: Connection refused



Quote:
Originally Posted by frafu View Post
Do you have an X server running on your local machine? If so, try to connect through sh with the following command:

Code:
 
ssh -Y loginname@remotecomputerip
Because of the -Y option, the gui of the application started on your remote computer should be displayed on your local machine if there is a X server running on your local machine.

Particularly, you should be able to start the synaptic Package Manager and reinstall vino. Afterwards, you should start "vino-preferences" from the shell which should display the gui of the preferences on your local machine. There you should be able to enable vino (=vnc server of the remote machine)

Have a nice day.
theQmaster is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:40 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry