homebridge/homebridge-raspbian-image

VNC The computer refused the connection.

Closed this issue · 8 comments

Raspberry Pi Model

Raspberry Pi 4 B

Describe The Bug

I have installed VNC as before, following the steps in sudo hb-config / extra packages.
When it installs it says it has finished successfully and shows ip:5912.
When I go to VNC and type in the ip and port it says that the computer has refused the connection.
if i remove the port and leave the ip, it locates port 5900 on the network but when it connects it does not show the desktop.
How can I solve the problem?
Thanks

Logs

Job for vncserver-pi.service failed because the service did not take the steps required by its unit configuration. homebridge systemd[1]: vncserver-pi.service: Can't open PID file /home/pi/.vnc/homebridge:12.pid (yet?) after start: Operation not permitted homebridge systemd[1]: vncserver-pi.service: Failed with result 'protocol'. homebridge systemd[1]: Failed to start VNC Virtual Desktop Service.

@kikher are you sure its successfully installed an also running? I thought so too, but then I saw the error message (just did a full re-install during the last days from the official image).

what do you get as response to:

systemctl status vncserver-pi.service

for me its enabled, but Active: failed.
I also can't manually start it with
systemctl start vncserver-pi.service
Does this work for you?

@martind1983 You are right, with systemctl status vncserver-pi.service in my case the same thing happens, it fails. if I try with systemctl start vncserver-pi.service it fails too.

I understand that I will have to try to reinstall everything from the beginning to see where the error is.

Anyway, if you find any other solution during this time I will be grateful.

Thank you very much for your help.

HI @kikher
unfortunately I did not find a solution yet and also re-install did not solve it on my side - I tried several things as I read different infos in different forums etc. connect keyboard, mouse, external screen, try to install/reboot then, did not help.
What exact error do you get? I am getting: Can't open PID file
Job for vncserver-pi.service failed because the service did not take the steps required by its unit configuration. homebridge systemd[1]: vncserver-pi.service: Can't open PID file /home/pi/.vnc/homebridge:12.pid (yet?) after start: Operation not permitted homebridge systemd[1]: vncserver-pi.service: Failed with result 'protocol'. homebridge systemd[1]: Failed to start VNC Virtual Desktop Service.

Hi, @martind1983

Yesterday I reinstalled everything and the same thing happened again. Same as you.
I get the same error lines as in your previous message.
I have tried to look for information about it but I can't find anything that solves the problem. I have also tried to install it manually and it doesn't work either.
Let's see if anyone else who has had this happen to them has solved it somehow.

so unfortunately really seems to be an issue with the actual image / actual packages?
anyone having same issues or a solution to it???

@kikher I recommend to update your initial issue description with the details

@kikher I took a look at this, and the vnc package has changed. What I found was that the service vncserver-pi.service is no longer required and can be disabled

systemctl disable vncserver-pi.service

And that it is working with the vncserver-x11-serviced.service

systemctl enable vncserver-x11-serviced.service
systemctl start vncserver-x11-serviced.service

I was then able to connect via RealVNC Viewer

I have installed the new version in bookworm. I saw the same thing happening and did some digging. I found that following these steps solved it and connected normally as byokworm defaults to Wayland (wayfire), however, it is possible to switch to X11 using the raspi-config command line utility, under Advanced -> Wayland.

I think we can close this as resolved, v1.1.1 of the raspbian image implements the changes I mentioned.