VNC server on kali pi

Overview Forums Sticky Finger’s Kali-Pi VNC server on kali pi

Tagged: 

Viewing 12 reply threads
  • Author
    Posts
    • #13151
      sunavetsennoloc
      Participant

      Hi all,

      Can some provide a step by step tutorial for vncserver connection. I used sticky finger kali-pi preinstalled image on raspberry pi 3 model b and try to connect my tablet (rooted) as display for vncserver from kali pi but keep geeting error X display already in use. I’ve followed instrution to copy xstartup from github, running vncserver as service and vncserver through ssh but none of those are worked for me.

      Pls help since i’m newbie and apologize for my baf english.

    • #13152
      Re4son
      Keymaster

      Hi sunavetsennoloc,

      Can you walk me through step by step how you’re trying to connect?

      Many thanks,
      Re4son

    • #13153
      sunavetsennoloc
      Participant

      Hi Re4son,

      First of all I admire so much for what you’ve done so far creating the kali pi. Basically i followed your guidance on Configure vncserver section at https://whitedome.com.au/re4son/kali-pi/ and vncserver over ssh https://whitedome.com.au/re4son/topic/vnc/ but when I start the vncserver, cannot connect it from my android tablet vncviewer and when I check the vncserver log there are a bunch of errors appeared (I’m currently away and will post later the errors log) which the first error said that display already used.

      Also for vncserver over ssh when I put $localhost = no, there is notification that “$localhost = no” appear before number 1 (if I’m not forget). Will post all the details tonight. Actually on which line I’ve to put $localhost = no, at begining or end of vnc.conf?

    • #13155
      sunavetsennoloc
      Participant

      Here is the error log:
      root@kali-pi:~# vncserver

      New ‘kali-pi:1 (root)’ desktop at :1 on machine kali-pi

      Starting applications specified in /root/.vnc/xstartup
      Log file is /root/.vnc/kali-pi:1.log

      Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :1 to connect to the VNC server.

      root@kali-pi:~# cat /root/.vnc/kali-pi:1.log

      Xvnc TigerVNC 1.7.0 – built Dec 4 2017 09:39:19
      Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
      See http://www.tigervnc.org for information on TigerVNC.
      Underlying X server release 11905000, The X.Org Foundation

      Sat May 5 23:20:09 2018
      vncext: VNC extension running!
      vncext: Listening for VNC connections on local interface(s), port 5901
      vncext: created VNC server for screen 0
      /usr/bin/startxfce4: X server already running on display :1
      xfce4-session-Message: SSH authentication agent is already running
      gpg-agent[990]: WARNING: “–write-env-file” is an obsolete option – it has no effect
      gpg-agent: a gpg-agent is already running – not starting a new one

      (xfce4-session:978): xfce4-session-WARNING **: gpg-agent returned no PID in the variables

      (xfce4-session:978): xfce4-session-WARNING **: xfsm_manager_load_session: Something wrong with /root/.cache/sessions/xfce4-session-kali-pi:1, Does it exist? Permissions issue?
      Failure: Module initialization failed

      (xfsettingsd:1003): xfsettingsd-WARNING **: Failed to get the _NET_NUMBER_OF_DESKTOPS property.

      (xfwm4:993): xfwm4-WARNING **: Error opening /dev/dri/card0: No such file or directory

      ** (polkit-gnome-authentication-agent-1:1004): WARNING **: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject
      Cannot register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject

      (nm-applet:1006): nm-applet-WARNING **: GDBus.Error:org.freedesktop.NetworkManager.AgentManager.PermissionDenied: An agent with this ID is already registered for this user.
      XIO: fatal IO error 11 (Resource temporarily unavailable) on X server “:1”

      after 136 requests (136 known processed) with 1 events remaining.

      xfce4-session: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.
      xfwm4: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.

      (xfsettingsd:1003): libxfce4ui-WARNING **: ICE I/O Error

      (xfsettingsd:1003): libxfce4ui-WARNING **: Disconnected from session manager.
      xfce4-panel: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.
      xfsettingsd: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.
      xfdesktop: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.
      wrapper-1.0: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.
      wrapper-1.0: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.

      Xvnc TigerVNC 1.7.0 – built Dec 4 2017 09:39:19
      Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
      See http://www.tigervnc.org for information on TigerVNC.
      Underlying X server release 11905000, The X.Org Foundation

      Sat May 5 23:21:14 2018
      vncext: VNC extension running!
      vncext: Listening for VNC connections on local interface(s), port 5901
      vncext: created VNC server for screen 0
      /usr/bin/startxfce4: X server already running on display :1
      xfce4-session-Message: SSH authentication agent is already running
      gpg-agent[1158]: WARNING: “–write-env-file” is an obsolete option – it has no effect
      gpg-agent: a gpg-agent is already running – not starting a new one

      (xfce4-session:1146): xfce4-session-WARNING **: gpg-agent returned no PID in the variables

      (xfce4-session:1146): xfce4-session-WARNING **: xfsm_manager_load_session: Something wrong with /root/.cache/sessions/xfce4-session-kali-pi:1, Does it exist? Permissions issue?

      (xfsettingsd:1171): xfsettingsd-WARNING **: Failed to get the _NET_NUMBER_OF_DESKTOPS property.

      (xfwm4:1161): xfwm4-WARNING **: Error opening /dev/dri/card0: No such file or directory

      ** (polkit-gnome-authentication-agent-1:1172): WARNING **: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject
      Cannot register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject

      (nm-applet:1174): nm-applet-WARNING **: GDBus.Error:org.freedesktop.NetworkManager.AgentManager.PermissionDenied: An agent with this ID is already registered for this user.

    • #13159
      sunavetsennoloc
      Participant

      Hi Re4son,

      Any suggestion to solve the error that I have with vncserver?

    • #13160
      Re4son
      Keymaster

      Hi sunavetsennoloc,

      Do you have a PC handy for testing? There are less moving part to find the issue.
      I have just used a new image and done the following to make it work:

      I used PuTTY to ssh into the Pi and typed:

      apt install tigervnc-standalone-server
      mkdir ~/.vnc
      wget -O ~/.vnc/xstartup https://raw.githubusercontent.com/Re4son/RPi-Tweaks/master/vncservice/xstartup
      vncpasswd
      vncserver

      The server started on port 2 on my Pi

      I then added the following tunnel to the running ssh session:
      local port: 5902
      remote port: localhost:5902

      I used TigerVNC viewer to connect to 127.0.0.1:5902 and everything worked fine.

      Can you try these steps and let me know how you go, please?

      Many thanks,
      Re4son

    • #13398
      wilsonb
      Participant

      Did not work for me.

      Says connection refused..

      Here is the log;

      (xfsettingsd:2623): libxfce4ui-WARNING **: 15:52:06.676: Disconnected from session manager.
      xfsettingsd: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.
      xfwm4: Fatal IO error 104 (Connection reset by peer) on X server :1.0.

      ** (xfdesktop:2621): WARNING **: 15:52:06.691: Thumbnailer failed calling GetFlavors
      xfdesktop: Fatal IO error 0 (Success) on X server :1.0.
      xfce4-panel: Fatal IO error 0 (Success) on X server :1.0.
      Thunar: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.

      (wrapper-1.0:2718): Gtk-WARNING **: 15:52:06.710: cannot open display: :1.0
      Gdk-Message: 15:52:06.714: wrapper-2.0: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.

      Gdk-Message: 15:52:06.714: polkit-gnome-authentication-agent-1: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.

      wrapper-1.0: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.
      Gdk-Message: 15:52:06.715: nm-applet: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.

      wrapper-1.0: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.
      Gdk-Message: 15:52:06.728: wrapper-2.0: Fatal IO error 2 (No such file or directory) on X server :1.0.

      Unable to init server: Could not connect: Connection refused

      (wrapper-2.0:2717): Gtk-WARNING **: 15:52:06.736: cannot open display: :1.0
      Gdk-Message: 15:52:06.794: wrapper-2.0: Fatal IO error 0 (Success) on X server :1.0.

    • #13399
      Re4son
      Keymaster

      Odd, let me investigate

    • #13401
      Re4son
      Keymaster

      Hmmm, strange. I’ve just used a fresh Sticky Fingers image, started vnc and connected without any problems. Did an apt full-upgrade, rebooted and still worked like a charm.

      Which image did you use?

    • #13411
      vivekveeramani
      Participant

      Hello Re4son,

      I’m just starting with Kali on Raspi 3B+ and I’m also running into the same issue. I tried just as you said:

      1 – Flashed SD Card again with StickyFingers-Kali-Pi-armhf-180617.img.xz
      2 – Changed root password
      3 – Increased root disk using gparted
      4 – established ssh from my Mac using ssh root@192.168.0.18
      5 – Executed the following:
      apt install tigervnc-standalone-server
      mkdir ~/.vnc
      wget -O ~/.vnc/xstartup https://raw.githubusercontent.com/Re4son/RPi-Tweaks/master/vncservice/xstartup
      vncpasswd
      vncserver
      6 – Tried establishing connection using Real VNC with IP 192.168.0.18:1 and it returns “Connection was refused by the computer”

      I get this error in /root/.vnc/kali-pi\:1.log
      Xvnc TigerVNC 1.7.0 – built Dec 4 2017 09:39:19
      Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
      See http://www.tigervnc.org for information on TigerVNC.
      Underlying X server release 11905000, The X.Org Foundation

      Wed Aug 1 21:54:28 2018
      vncext: VNC extension running!
      vncext: Listening for VNC connections on local interface(s), port 5901
      vncext: created VNC server for screen 0
      /usr/bin/startxfce4: X server already running on display :1
      gpg-agent[1592]: WARNING: “–write-env-file” is an obsolete option – it has no effect
      gpg-agent: a gpg-agent is already running – not starting a new one

      (xfce4-session:1578): xfce4-session-WARNING **: 21:54:28.973: gpg-agent returned no PID in the variables

      (xfce4-session:1578): xfce4-session-WARNING **: 21:54:28.979: xfsm_manager_load_session: Something wrong with /root/.cache/sessions/xfce4-session-kali-pi:1, Does it exist? Permissions issue?
      Failure: Module initialization failed

      (xfsettingsd:1607): xfsettingsd-WARNING **: 21:54:29.619: Failed to get the _NET_NUMBER_OF_DESKTOPS property.

      (xfwm4:1595): xfwm4-WARNING **: 21:54:29.668: Error opening /dev/dri/card0: No such file or directory

      ** (light-locker:1604): ERROR **: 21:54:30.562: Environment variable XDG_SESSION_PATH not set. Is LightDM running?

      (nm-applet:1610): nm-applet-WARNING **: 21:54:31.217: GDBus.Error:org.freedesktop.NetworkManager.AgentManager.PermissionDenied: An agent with this ID is already registered for this user.

      What am I doing wrong or missing?? Thanks in advance !

      Best,
      Vivek

    • #13412
      Re4son
      Keymaster

      Hi Vivek,

      tigervnc does only permit vnc sessions from localhost by default.
      You have to either tunnel vnc through ssh or change the default configuration.

      Here’s a howto for establishing ssh tunnels:

      https://whitedome.com.au/re4son/topic/vnc/

      Hope that helps,
      Re4son

    • #13414
      vivekveeramani
      Participant

      Hi Re4son,

      Thank you for the quick response. I tried this now:

      1 – Exit ssh connection
      2 – ssh -L 5902:localhost:5901 root@192.168.0.18
      3 – apt-get install vncviewer
      4 – vncviewer 127.0.0.1::5902
      This now returns :
      root@kali-pi:~# vncviewer 127.0.0.1::5902
      Error: Can’t open display:

      Should I run the apt-get update and upgrade along with slim before I try this?

      Thanks,
      Vivek Veeramani

    • #13416
      vivekveeramani
      Participant

      Hi Re4son,

      Anything I could be missing here? Please let me know if I can help you with any logs as well.

      Thanks,
      Vivek Veeramani

Viewing 12 reply threads
  • You must be logged in to reply to this topic.