Hi there, I’m having some issues connecting to my Pi4 (Kali Linux). Followed the process outlined here:
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!
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 (on which VNC is pre-installed)?
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
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?
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.
Never mind, I made a mistake in my earlier correction- all fixed. Pays to double check the code! Thanks friends!!
Nice, one step closer!
This seems to be a common-enough issue with settings
https://www.google.com/search?q=realvnc+grey+screen+raspberry+pi
Edit - just saw your reply, nice one!