Crussader87
Posts: 7
Joined: Tue Apr 14, 2020 9:31 pm

Impossible to connect via VNC headless

Tue Apr 14, 2020 10:46 pm

Hello, first of all I’m new here so please redirect this topic if necessary.

I’ve got a Raspberry Pi 4 (4GB) with Ubuntu sever 19.10 and Lubuntu desktop installed. I did a headless setup as I dont have screen, keyboard or mouse to work with so I did everything via SSH but I want to access via VNC to have the desktop environment.

I followed every tutorial online but I couldn’t get it working. I did manage with Raspbian so I don’t really know what else to try, I’m very new to this.
I’ve tried with x11vnc, tiger vnc and tighvnc.

The closest I got was with this tutorial: https://www.tecmint.com/install-and-...ver-on-ubuntu/
But when I reached the part where I have to create an SSH tunnel to VNC server I got the error:

Warning: Identity file /home/ubuntu/.ssh/ubuntu19.04 not accessible: No such file or directory.
ubuntu@192.168.1.127's password:
bind [127.0.0.1]:5901: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 5901
Could not request local forwarding.


I don’t really know what else to do, if any has a link to a tutorial that is working for you please let me know.

Thanks

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Impossible to connect via VNC headless

Thu Apr 16, 2020 2:37 pm

Crussader87 wrote:
Tue Apr 14, 2020 10:46 pm
I followed every tutorial online but I couldn’t get it working. I did manage with Raspbian so I don’t really know what else to try, I’m very new to this.
I’ve tried with x11vnc, tiger vnc and tighvnc.
if you're new to the game why not use Raspbian rather than Ubuntu as it's easier to learn how to use that and you'll get better support from here.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
waveform80
Posts: 359
Joined: Mon Sep 23, 2013 1:28 pm
Location: Manchester, UK
Contact: Website Twitter

Re: Impossible to connect via VNC headless

Thu Apr 16, 2020 9:17 pm

Can't say I know anything about TightVNC (or VNC generally beyond playing with RealVNC on raspbian, which is a pretty slick piece of kit). However, setting up xrdp is relatively simple and provides a similar remote desktop experience (barring the fancy bits RealVNC does like camera previews - I don't think anything else can do that yet as nothing else uses dispmanx for display capture):
  • Install your favoured desktop package (in your case you've gone with lubuntu-desktop - a good choice for the pi)
  • Install xrdp: sudo apt install xrdp
  • Add the xrdp user to the ssl-cert group (so it can access the default snakeoil certificate): sudo adduser xrdp ssl-cert
  • Restart the service (so the group change takes effect): sudo systemctl restart xrdp
  • Connect to your Pi with some RDP client like remmina
In the RDP client you'll need to specify the hostname (which hopefully you can figure out with whatever your local network provides), your login username (presumably ubuntu) and password (also ubuntu by default but you must have changed this before connecting with RDP, so SSH to your Pi first to do this).
Author of / contributor to a few pi related things (picamera, Sense HAT emulator, gpio-zero, piwheels, etc.), and currently a software engineer at Canonical responsible for Ubuntu Server and Core on the Raspberry Pi.

Return to “Ubuntu”