# Remote access Pi4 (Kali) via VNC

**URL:** <https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630>\
**Category:** Raspberry Pi\
**Created:** [27 April 2020 05:02 UTC](https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630 "2020-04-27T05:02:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![E113986](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@E113986](https://forum.core-electronics.com.au/u/E113986)\
**Post date:** [27 April 2020 05:02 UTC](https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630/1 "2020-04-27T05:02:06Z")

</div>

Hi there, I’m having some issues connecting to my Pi4 (Kali Linux). Followed the process outlined here:

> **[How to Use VNC to Remotely Access Your Raspberry Pi from Other Devices](https://null-byte.wonderhowto.com/how-to/use-vnc-remotely-access-your-raspberry-pi-from-other-devices-0178997/)**
>
> With Virtual Network Computing, you don't need to carry a spare keyboard, mouse, or monitor to use your headless computer's full graphical user interface (GUI). Instead, you can connect remotely to it through any available computer or smartphone....

  
All seemed to go fine up until connecting via VNC. This setup uses TightVNC on the pi and RealVNC viewer to access from PC/phone.  
Pi is connected to WIFI LAN via Ethernet. I can ssh into the pi perfectly fine. But when I try to access via RealVNC Viewer on my PC it timed out before connecting and from my phone I got the following message: “The port on which the computer is listening for a connection could not be contacted”. I have a monitor but no keyboard or mouse, so working via ssh only. Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Graham](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/graham/32/54_2.png) [@Graham](https://forum.core-electronics.com.au/u/Graham)\
**Post date:** [27 April 2020 09:24 UTC](https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630/2 "2020-04-27T09:24:05Z")

</div>

That’s strange - can you connect Real VNC to another PC on your network?

If that works, then does it do the same when using VNC on [Raspbian Buster with desktop and recommended software](https://www.raspberrypi.org/downloads/raspbian/) (on which VNC is pre-installed)?

---

<div class="post-metadata">

**Author:** ![Robin57159](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@Robin57159](https://forum.core-electronics.com.au/u/Robin57159)\
**Post date:** [27 April 2020 12:47 UTC](https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630/3 "2020-04-27T12:47:52Z")

</div>

Even on Raspian, the VNC server is not enabled by default, even though it is installed. The server has to be configured to start/stop with the machine.

So check to see if the VNC server is running. Something like

```auto
ps -waux | grep vnc

```

Also, if you have a firewall, make sure connections are allowed into the VNC server.

Lastly, does the start stop script need to be linked from /etc/init.d to the /etc/init.d/rc?.d directories?

---

<div class="post-metadata">

**Author:** ![E113986](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@E113986](https://forum.core-electronics.com.au/u/E113986)\
**Post date:** [28 April 2020 01:22 UTC](https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630/4 "2020-04-28T01:22:03Z")

</div>

Thanks for the suggestions! First I went through the code and realised I had split one line (regarding VNC session settings) into two, fixed this and I was successful in connecting via RealVNC viewer… however I can only get a grey screen, not the os GUI.  
Could this be to do with the session settings?

/usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565

Thanks again for the help.

---

<div class="post-metadata">

**Author:** ![E113986](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@E113986](https://forum.core-electronics.com.au/u/E113986)\
**Post date:** [28 April 2020 02:17 UTC](https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630/5 "2020-04-28T02:17:13Z")

</div>

Never mind, I made a mistake in my earlier correction- all fixed. Pays to double check the code! Thanks friends!!

---

<div class="post-metadata">

**Author:** ![Graham](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/graham/32/54_2.png) [@Graham](https://forum.core-electronics.com.au/u/Graham)\
**Post date:** [28 April 2020 02:17 UTC](https://forum.core-electronics.com.au/t/remote-access-pi4-kali-via-vnc/7630/6 "2020-04-28T02:17:25Z")

</div>

Nice, one step closer!

> [@E113986](#):
>
> however I can only get a grey screen, not the os GUI.

This seems to be a common-enough issue with settings

[https://www.google.com/search?q=realvnc+grey+screen+raspberry+pi](https://www.google.com/search?q=realvnc+grey+screen+raspberry+pi)

> [@E113986](#):
>
> Never mind, I made a mistake in my earlier correction- all fixed. Pays to double check the code! Thanks friends!!

Edit - just saw your reply, nice one!
