1

I have a Raspberry Pi B running a fresh install of PIXEL that I'm trying to connect to headless, within my own network. When I connect with a monitor, I have no issues - I can use RealVNC viewer from another device perfectly.

But when I restart the device headless, I cannot connect. Specifically I get an error: "The connection was refused by the host computer". I have created a virtual desktop using the instructions at VNC, but I cannot connect.

Again, plugging the same device with no changes into a monitor lets me log in from ANY remote device on the network. Shutdown, restart without monitor - connection refused.

Also noted, I can ssh in at any time. If I ssh in and run 'vncserver', I can then connect vncviewer headless. I take this to mean that vncserver is not starting up automatically when headless? I have followed the instructions at this page for setting up VNC server. Step 2 states, "From now on, VNC Server will start automatically whenever your Pi is powered on." I apparently am not observing this behavior.

Also related - when I am able to connect headless after ssh'ing in, if I close the connection and let the device idle for some undetermined length of time (hours), the whole process starts over again.

I'd really love some advice for this.

EDIT to add: I also tried the steps at https://www.realvnc.com/docs/raspberry-pi.html#raspberry-pi-ssh, running sudo systemctl start vncserver-x11-serviced.service and then sudo systemctl enable vncserver-x11-serviced.service This has also not had the desired effect.

2

I added the following lines to my config.txt file in /boot.

# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=82
#hdmi_safe=1

This forces the headless pi to 1080p. I've seen other similar posts but this is what is working for me.

  • Much as I don't like such duct tape solutions, this one is probably the simplest one that will work. – Dmitry Grigoryev Oct 10 '16 at 9:43
  • 1
    This worked. The resolution is not quite the right size (scroll bars everywhere!), but I can sign in now after reboots without SSH. Thanks! – apathos Oct 11 '16 at 17:52
1

From the link you posted,

sudo systemctl enable vncserver-x11-serviced.service

This will enable the service to start when booted. It will not start the service though, you'll need to either start it or simply reboot your pi

  • I had tried that previously without effect, and tried it again just now and then rebooted. I still get a refused connection. – apathos Oct 4 '16 at 2:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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