Problem - VNC Viewer Timed Out waiting for a response from the host computer
Problem - VNCViewer client not responding
Windows 11 client, and a Raspberry Pi.
Article under construction. Here are my notes.
An imperfect solution is listed below.
Consideration #3 has helped a lot of people, but was not a solution for my problem.
Symptoms:
Desktop computer attempting to reach a VNC Server (in my case a Raspberry PI, acting as a server) gets ~ error
VNC Viewer 'worked before' or has worked "occasionally", or works one-time.
The host computer (the server) is operational and VNC is installed properly
The server is ping-able
VNC services are running
Waking the host-server (from sleep) did not solve the problem
Some sites recommended plugging in a monitor, keyboard, and mouse; nope; did not help
Diagnostics:
Confirm the service is running on the server:
From a remote SSH desktop connection (Putty.exe), run this console command:
sudo systemctl status vncserver-x11-serviced.service
(then ctrl-C to cancel/close the command)
Look for:
"Active (running) since <date>" (green)
"Started VNC Server in Service Mode daemon" and
"ServerManager: Server started."
* You may see: "ConsoleDisplay: Cannot find a running X server on vtl"
Other web articles suggest VNC will not operate without a monitor plugged-in and active. Nonsense. Many Raspberry pi's are "headless" -- without a monitor or keyboard. Adding a monitor, keyboard, and mouse is not the solution to this problem. This idea can be ignored.
Assuming VNC was installed properly; services started, IP Address
ping-able, and all that nonsense, it can't be a problem with the server
or with the VNC Server Services not running. It can't be a problem with
ports, firewall rules, or other configuration -- after all, it worked
before...
Poor Solution:
This is a less-than perfect solution.
1. From the Windows VNC Viewer Client, delete the Connection icon to your server
(e.g. "keyliner.local") -- this is the connection that worked before, but does not now.
2. Rebuild the connection from scratch.
This is asinine and indicates a possible problem in C:\Users\<you>\appdata\local\RealVNC folder
But after hours and hours of research, a proper solution was not found.
Considerations:
1. Be sure to upgrade VNC and other services on the Server's desktop:
Even a new install, with a new distro, VNC needs to be updated. From a terminal/console command window (putty.exe), or from the Raspberry pi's Terminal (console),
type sudo apt update
type sudo apt upgrade
(I noted the VNC service was updated during this patch cycle)
2. Some articles recommend forcing a manual screen resolution
From a terminal/console command window (putty.exe), or from the Raspberry pi's Terminal (console),
type sudo raspi-config
Select "Display Options"
Set "D5 VNC Resolution" to a fixed setting, such as 1280x1024 -- anything smaller than your Windows client's native desktop size.
This does not fix this immediate problem, contrary to other web articles. However, setting a predictable resolution seems a good idea.
3. Many have reported a bug in the Raspberry PI operating system, where a "headless" pi (one without a keyboard/mouse) does not generate a 'cached random-number pool' of some type. (However, my pi has a keyboard and mouse installed (at least temporarily) and this did not help. I discounted this idea.)
To solve this random-number problem, some sites suggest installing a program called "haveged". Reportedly, this fixed VNC for many users, but it did not resolve the issue for me. Regardless, here are the full details and credit in this article:
https://forums.raspberrypi.com//viewtopic.php?f=28&t=230779&p=1413648#p1413648
Not-recommended steps:
sudo apt-get install haveged
sudo update-rc.d haveged defaults
(to uninstall):
sudo apt remove haveged,
followed by sudo apt-get --purge remove haveged )
Bad-to-Worse Solution:
Start a new VNC session:
This is not necessarily a good idea, but will work (one) time per boot -- starting a second
virtual desktop on the server -- a second copy, separate from the
already-running service. This seems a poor solution. In any case, from the terminal/console window, type this command, launching a second VM (desktop)
vncserver
Test
by launching the client's copy of VNC and make the VNC connection.
This should should work, but once you disconnect the client's VNC, you will not be able to make a second connection without
rebooting the pi server. Spinning-up a second instance of a VNC server masks the underlying problem.
Other notes
Installation
Starting and confirming the VNC Service on the Raspberry pi server:
Assuming VNC was not started or installed on your raspberry pi server, and assuming SSH was installed...
a. Using Putty.exe on a Windows box (remote console)
(Download from: https://www.putty.org)
Launch and connect to your server, from the local network (e.g. my server: "keyliner.local")
Login as admini
and the SSH password:
b. Type this command: sudo raspi-config
c. Select menu choice "Interfacing Options"
Select menu choice I3: "VNC" Enable/disable; enable the service.
d. The Windows VNC Viewer (client) can be launched in either a local,
non-logged-in mode (recommended) or with a "cloud" (internet) account.
Both exhibit the same problem and I see little reason to build the
RealVNC "cloud" account.
I have recommended bypassing the cloud login:
On your (Windows) workstation, download and install a VNC Viewer client.
Download: https://www.realvnc.com/en/connect/download/viewer/
Select Standalone EXE x64 Installer
On startup, note the link: "Use RealVNC Viewer without signing in"
(assuming a local network, not over the Internet)
Connect to your server's name: e.g. "keyliner.local"
In Case Needed: To Start the VNC Service:
As an alternative to raspi-config, from the remote console:
a. sudo systemctl start vncserver-x11-serviced.service
(where x11 is x-one-one. There is no console response to this command)
To Enable VNC Service at next boot, and for every boot:
a. sudo systemctl enable vncserver-x11-serviced.service
Resources:
Article on everything about VNC on Raspberry pi:
https://help.realvnc.com/hc/en-us/articles/360002249917-VNC-Connect-and-Raspberry-Pi#creating-and-remoting-a-virtual-desktop-0-8
-end
No comments:
Post a Comment
Comments are moderated and published upon review. (As an aside, not a single spam has been allowed through; why bother?)