[Lubuntu 13.10] x11vnc and UltraVNC

Discussion in 'Linux Networking' started by balubeto, Mar 22, 2014.

  1. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    Hi


    In Windows 7 SP1 64-bit, I use UltraVNC viewer 1.1.9.6 64-bit with the SecureVNCPlugin64.dsm plugin.

    Now, I have a computer with Lubuntu 13.10 32 bit that it has installed the x11vnc server.

    How can I configure the VNC server so that I can remotely control this Linux machine completely, including its Desktop Manager LightDM?

    Thanks

    Bye
  2. arochester

    arochester Well-Known Member

    Messages:
    817
    Likes Received:
    261
    Trophy Points:
    63
  3. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
  4. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    Hi
    From Linux, I wrote from the terminal:
    and then I created in the /etc/init directory the x11vnc.conf file and I wrote:
    but when I restarted the computer, I tried to connect with UltraVNC without the SecureVNCPlugin64.dsm plugin but the x11vnc server does not respond and it does not even create the log file. Where am I wrong?
    Thanks
    Bye
  5. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    Running this command from the terminal with the sudo command because there is the -o option, I get:
    So, how do I fix this?
    Thanks
    Bye
  6. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    Leaving the /etc/init/x11vnc.conf file and restarting the computer, I notice that the /var/run/lightdm/root/:0 file is created, but when I run the command sudo netstat -anp | grep 5900 or sudo netstat -nlp | grep vnc or sudo ps -ef | grep [x]11vnc , nothing is displayed.
    So, I run from the terminal the command sudo /usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -rfbport 5900 -bg -o /var/log/x11vnc.log, the file /var/run/lightdm/root/:0 is created but the other commands always give the same result.
    So, I rebooted the computer and gave the command sudo /usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -display :0 but the same log file is displayed.
    How come?
    Thanks
    Bye
  7. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    Also, I tried to do this method:
    I activated the xauth_path directive in the /etc/lxdm/default.conf (pointing to the /etc/alternatives/lxdm.conf), I run the command sudo x11vnc -storepasswd <Password> /etc/x11vnc.pass to create a password for access remotely to x11vnc and I created the /etc/lxdm/LoginReady like this:
    Then I made it executable by writing sudo chmod u+x /etc/lxdm/LoginReady and I restarted the computer.
    Unfortunately I still can not connect from remote because when I try to do it, UltraVNC viewer can not find the Server.
    Also, I noticed that the log file is not created and the process x11vnc is not active.
    So, how should I do to fix this?
    Thanks
    Bye
    PS: I noticed that even if I run the command sudo x11vnc -auth /tmp/.Xauth1000 -forever -rfbauth /etc/x11vnc.pass -rfbport 5900 -o /var/log/x11vnc.log does not work but the log file is created but it is always the same.
  8. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    I noticed that with the command:
    Code:
    sudo x11vnc -o /var/log/x11vnc.log -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared -forever -nowf -norc -notruecolor -bg -xkb
    
    I can, with UltraVNC, to make remote control of the current session of Lubuntu 13.10. So to be able to control even LightDM, how should I do to get the file that the auth option of x11vnc want? Where should I put this command?
    Thanks
    Bye
  9. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    I tried to edit the file /etc/lightdm/lightdm.conf in this way:

    Code:
    [SeatDefaults]
    greeter-session=lightdm-gtk-greeter
    user-session=Lubuntu
    display-setup-script=/usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -rfbauth /etc/x11vnc.pass -xkb -noxrecord -noxfixes -noxdamage -forever -bg -rfbport 5900
    
    and it works.

    Now, there is the problem of mapping of characters and I already tried to replace the xkb option with the noxkb option but the problem remains:

    The Windows computer is mapped to the English-United States (EN) keyboard and the computer with Lubuntu has the Italian-Italian (IT) mapping. Now, doing the remote control from the Windows computer to the Linux computer and setting the keyboard mapping of this latter computer to the English (US) keyboard layout, I see that some characters =, -, +, ..., typed by Windows computer, are reproduced on the Linux machine with the characters ), /,] ... . How come? I also checked directly,, connecting a keyboard to the Linux computer, and I noticed that this problem does not exist even if I change the keyboard layout.

    So, how do I solve this mapping problem caused by the remote control?

    Thanks

    Bye
  10. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    I created this script:

    Code:
    #! /bin/sh
    #
    ### BEGIN INIT INFO
    # Provides: x11vnc
    # Required-Start: $syslog $local_fs
    # Required-Stop: $syslog $local_fs
    # Should-Start: LightDM
    # Default-Start: 2
    # Default-Stop: 1
    # Short-Description: x11 vnc
    # Description: x11vnc
    ### END INIT INFO
    DAEMON=/usr/bin/x11vnc
    NAME=x11vnc
    DESC="X11 vnc"
    test -x $DAEMON || exit 0
    DAEMON_OPTS="-auth /var/run/lightdm/root/:0 -rfbauth /etc/x11vnc.pass -nomodtweak -shared -forever -o /var/log/x11vnc.log -bg"
    set -e
    case "$1" in
      start)
      echo -n "Starting $DESC: "
      start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
      --exec $DAEMON -- $DAEMON_OPTS &
      echo "$NAME."
      ;;
      stop)
      echo -n "Stopping $DESC: "
      start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$NAME.pid \
      --exec $DAEMON
      echo "$NAME."
      ;;
      restart)
      echo -n "Restarting $DESC: "
      start-stop-daemon --stop --quiet --pidfile \
      /var/run/$NAME.pid --exec $DAEMON
      sleep 1
      start-stop-daemon --start --quiet --pidfile \
      /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
      echo "$NAME."
      ;;
      status)
      if [ -s /var/run/$NAME.pid ]; then
      RUNNING=$(cat /var/run/$NAME.pid)
      if [ -d /proc/$RUNNING ]; then
      if [ $(readlink /proc/$RUNNING/exe) = $DAEMON ]; then
      echo "$NAME is running."
      exit 0
      fi
      fi
      # No such PID, or executables don't match
      echo "$NAME is not running, but pidfile existed."
      rm /var/run/$NAME.pid
      exit 1
      else
      rm -f /var/run/$NAME.pid
      echo "$NAME not running."
      exit 1
      fi
      ;;
      *)
      N=/etc/init.d/$NAME
      echo "Usage: $N {start|stop|restart|force-reload}" >&2
      exit 1
      ;;
    esac
    exit 0
    
    and I saved in /etc/init.d/x11vnc and, apparently, it works and I can also control the LightDM.

    Now, how do I fix the problems with the remote keyboard? Now, I realized that, when a VNC client is connected, the repeat function on the keyboard of the host (and the client on the host) is automatically deactivated and it is restored when VNC clients are disconnected.

    For example, under normal conditions, when I hold down a key on the host, its input is repeated until I it release; while, when a VNC client is connected, this repeat function the key does not more work.

    How come?

    Thanks

    Bye
  11. balubeto

    balubeto Member

    Messages:
    51
    Likes Received:
    4
    Trophy Points:
    8
    Using this script:
    Code:
    #! /bin/sh
    #
    ### BEGIN INIT INFO
    # Provides: x11vnc
    # Required-Start: $syslog $local_fs
    # Required-Stop: $syslog $local_fs
    # Should-Start: LightDM
    # Default-Start: 2
    # Default-Stop: 1
    # Short-Description: x11 vnc
    # Description: x11vnc
    ### END INIT INFO
    DAEMON=/usr/bin/x11vnc
    NAME=x11vnc
    DESC="X11 vnc"
    test -x $DAEMON || exit 0
    DAEMON_OPTS="-auth /var/run/lightdm/root/:0 -rfbauth /etc/x11vnc.pass -noxkb -modtweak -capslock -repeat -flashcmap -shared -forever -o /var/log/x11vnc.log -bg"
    set -e
     case "$1" in
      start)
      echo -n "Starting $DESC: "
      export XKL_XMODMAP_DISABLE=1
      start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
      --exec $DAEMON -- $DAEMON_OPTS &
      echo "$NAME."
      ;;
      stop)
      export XKL_XMODMAP_DISABLE=0
      echo -n "Stopping $DESC: "
      start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/$NAME.pid \
      --exec $DAEMON
      echo "$NAME."
      ;;
      restart)
      export XKL_XMODMAP_DISABLE=1
      echo -n "Restarting $DESC: "
      start-stop-daemon --stop --quiet --pidfile \
      /var/run/$NAME.pid --exec $DAEMON
      sleep 1
      start-stop-daemon --start --quiet --pidfile \
      /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
      echo "$NAME."
      ;;
      status)
      if [ -s /var/run/$NAME.pid ]; then
      RUNNING=$(cat /var/run/$NAME.pid)
      if [ -d /proc/$RUNNING ]; then
      if [ $(readlink /proc/$RUNNING/exe) = $DAEMON ]; then
      echo "$NAME is running."
      exit 0
      fi
      fi
      # No such PID, or executables don't match
      echo "$NAME is not running, but pidfile existed."
      rm /var/run/$NAME.pid
      exit 1
      else
      rm -f /var/run/$NAME.pid
      echo "$NAME not running."
      exit 1
      fi
      ;;
      *)
      N=/etc/init.d/$NAME
      echo "Usage: $N {start|stop|restart|force-reload}" >&2
      exit 1
      ;;
     esac
    exit 0
    
    I can, remotely, to have a U.S keyboard layout (Linux notation) except the > symbol. That is, when I press a Shift+> symbol, a <[/ i] symbol appears. In other words, remotely, I have two symbols <[/ i]. How come? How do I solve it?

    I remind you that the keyboard layout of Windows is English-United States (EN); while that of the Linux keyboard is Italian-Italian.

    Thanks

    Bye
    DevynCJohnson likes this.

Share This Page