Results 1 to 6 of 6

Thread: enable remote desktop by command line in 10.4 lucid

  1. #1
    Join Date
    Aug 2009
    Beans
    81

    enable remote desktop by command line in 10.4 lucid

    Hi

    how to enable remote desktop by command line in 10.4 lucid?
    The command
    sudo gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
    doesn't work, because when I open /system/pref/remote desktop, it is still not activated.

    Any idea?

    Thanks

  2. #2
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: enable remote desktop by command line in 10.4 lucid

    Firstly, running gconftool-2 as sudo is definately wrong. If something's not working right away, don't just put sudo in-front and think it'll magically work.

    Secondly, gconftool-2 needs to know how to contact dbus. This is unfortunately cumbersome. The first thing you need to know, is which display the X server is running at. If you have only logged in with one user, the display number is usually 0, so if we assume that:

    Code:
    # display number, assuming 0
    display=0
    
    # get the machine-id
    read -r machineid < /var/lib/dbus/machine-id
    
    # source the right file under .dbus to set the needed variables
    . "$HOME/.dbus/session-bus/$machineid-$display"
    
    # export the variables sourced from that file
    export DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID DBUS_SESSION_BUS_WINDOWID
    
    # Run gconftool-2
    gconftool-2 -s -t bool /desktop/gnome/remote_access/enabled true
    EDIT: The above is if you ssh in (or similar) to your box. If you are running it locally, the above should not be needed as the needed variables will be inherited; you only need to remove the sudo.
    Last edited by geirha; June 26th, 2010 at 02:44 PM.

  3. #3
    Join Date
    Aug 2009
    Beans
    81

    Re: enable remote desktop by command line in 10.4 lucid

    Thanks a lot geirha

    I am using it locally (as a newbie as you could guess) so it works without sudo.
    thanks

  4. #4
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: enable remote desktop by command line in 10.4 lucid

    Just be aware that VNC is easily cracked. Be sure you secure the connection.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  5. #5
    Join Date
    Aug 2009
    Beans
    81

    Re: enable remote desktop by command line in 10.4 lucid

    yes I go through an ssh tunnel
    thanks anyway

  6. #6
    Join Date
    Aug 2009
    Beans
    81

    Re: enable remote desktop by command line in 10.4 lucid

    an other thing:
    with command line,
    how to deactivate the confirmation "you must confirm each access to this machine" and activate "allow other users to control your desktop" ?

    edit: ok I just figured it out:
    gconftool-2 -s -t bool /desktop/gnome/remote_access/prompt_enabled false
    gconftool-2 -s -t bool /desktop/gnome/remote_access/view_only false
    Last edited by louisJ; June 28th, 2010 at 03:16 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •