2

PROBLEM: Upon connecting to my tightvncerver on port 5901, I am greeted with a grey screen with an 'X' for a cursor.


Hardware: Raspberry Pi 3

Operating System: Kali Linux 0.6 Raspberry Pi 3 w/ Nexmon

Note: I am using xfce as the display manager on this machine.


STEPS:

I start tightvncserver using the following command:

vncserver :1

Which outputs:

New 'X' desktop is kali:1

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

Then I attempt to connect to my VNC server as seen below:

VNC Connection Attempt

BAM grey screen! Why?!


/root/.vnc/xstartup:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

/root/.vnc/kali:\1.log:

23/01/17 12:46:52 Xvnc version TightVNC-1.3.9
23/01/17 12:46:52 Copyright (C) 2000-2007 TightVNC Group
23/01/17 12:46:52 Copyright (C) 1999 AT&T Laboratories Cambridge
23/01/17 12:46:52 All Rights Reserved.
23/01/17 12:46:52 See http://www.tightvnc.com/ for information on TightVNC
23/01/17 12:46:52 Desktop name 'X' (kali:1)
23/01/17 12:46:52 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
23/01/17 12:46:52 Listening for VNC connections on TCP port 5901

23/01/17 12:59:57 Got connection from client 172.24.1.135
23/01/17 12:59:57 Using protocol version 3.8
23/01/17 13:00:02 Full-control authentication passed by 172.24.1.135
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 16
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 22
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 21
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 15
23/01/17 13:00:02 Using zlib encoding for client 172.24.1.135
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding -314
23/01/17 13:00:02 Enabling full-color cursor updates for client 172.24.1.135
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding -223
23/01/17 13:00:02 Pixel format for client 172.24.1.135:
23/01/17 13:00:02   8 bpp, depth 8
23/01/17 13:00:02   uses a colour map (not true colour).
23/01/17 13:00:02 Using raw encoding for client 172.24.1.135
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 22
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 21
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 16
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 15
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding -314
23/01/17 13:00:02 Enabling full-color cursor updates for client 172.24.1.135
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding -223
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 15
23/01/17 13:00:02 Using hextile encoding for client 172.24.1.135
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 22
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 21
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding 16
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding -314
23/01/17 13:00:02 Enabling full-color cursor updates for client 172.24.1.135
23/01/17 13:00:02 rfbProcessClientNormalMessage: ignoring unknown encoding -223
23/01/17 13:00:02 Pixel format for client 172.24.1.135:
23/01/17 13:00:02   32 bpp, depth 24, little endian
23/01/17 13:00:02   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
23/01/17 13:00:02   no translation needed
23/01/17 13:00:08 Client 172.24.1.135 gone
23/01/17 13:00:08 Statistics:
23/01/17 13:00:08   key events received 0, pointer events 158
23/01/17 13:00:08   framebuffer updates 3, rectangles 29, bytes 22762
23/01/17 13:00:08     cursor shape updates 3, bytes 1668
23/01/17 13:00:08     raw rectangles 1, bytes 16396
23/01/17 13:00:08     hextile rectangles 1, bytes 3088
23/01/17 13:00:08     zlib rectangles 24, bytes 1610
23/01/17 13:00:08   raw bytes equivalent 3948580, compression ratio 187.189722
1

Apparently, Kali Linux 0.6 Raspberry Pi 3 w/ Nexmon contains older packages. Once issuing the command apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade tightvncserver gets replaced by tigervncserver. Thus, TightVNC isn't part of this image of Kali Linux. TigerVNC is a fork that is supported by the standard Kali Linux repositories.

I managed to figure out a pretty good alternative to TightVNC and TigerVNC. Below is my expanded solution.

Solution:

I would recommend using x11vnc as it provides the actual desktop experience rather than a virtual one.

To install x11vnc enter the following command:

apt-get update && apt-get install -y x11vnc

If you experience that the framebuffer size is too small, then to change it by doing the following:

  1. Locate /boot/config.txt and open it using nano or vim

(Note: If the file /boot/config.txt does not exist, safely power-off the Pi using the command, poweroff and take the Micro-SD card out and plug it into a laptop or desktop computer. When the Micro-SD card mounts, open it. The config.txt file should be on the root of the mounted Micro-SD card).

  1. uncomment the following text in config.txt:

Before:

#framebuffer_width=1280

#framebuffer_height=720

After:

framebuffer_width=1280

framebuffer_height=720

  1. Save and exit the file. Then, reboot the Pi and start x11vnc by using the following command to push it into a background process: x11vnc -usepw -reopen -bg -forever &

If you would like to start x11vnc at boot, add the following to a file called x11vnc.desktop in ~/.config/autostart:

[Desktop Entry]
Type=Application
Name=x11vnc
Exec=x11vnc -usepw -reopen -bg -forever &
Comment=Starts an x11vnc server on port kali:5900

(Note: If ~/.config/autostart does not exist, create the autostart directory by issuing the following command: mkdir ~/.config/autostart).

See how-to-execute-shell-script-on-kali-linux-startup for more information on application autostart on Kali Linux.

0

Doing some additional research, I have come across an additional answer that has solved this problem for me in the past.


⚠️ Please note the below information:

This solution works with any of the Raspberry Pi Kali ARM-based images.

That is because these images come with TightVNC rather than TigerVNC installed.


Below is my step-by-step solution:

Solution:

We are going to modify the contents of ~/.vnc/xstartup, so it will be a good idea to back up its contents first.

cp ~/.vnc/xstartup ~/.vnc/xstartup.bak

Now we must modify ~/.vnc/xstartup to have the following content:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

Now, save and exit the file. Then, reboot the Pi and start tightvncserver. The grey screen should be gone and you should be presented with your xfce4 desktop.

protected by Community Feb 18 at 17:36

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.