User avatar
makem
Posts: 280
Joined: Tue Jun 18, 2013 9:22 pm

How to install efficient VNC on Raspbian

Tue Dec 03, 2019 4:46 pm

I have Raspbian Buster with Desktop installed on a Pi4 and am in the process of setting up a VNC from a Linux laptop.

I followed the https://github.com/gitbls/RPiVNCHowTo then made and executed the 'make-systemd-xvnc script' mentioned in the guide.

I encountered questions I was unable to answer:

1. The script requested a VNC resolution for VNC1 which I entered as 1880x960. I was then asked for the resolution for VNC2 and so on. When to stop, how to stop making VNC sockets?

If using Ctrl+C to exit, has the script run enough at that stage?

2. The script contains a reminder, "echo "% Don't forget to 'sudo systemctl enable' the sockets so they restart on reboot""

The script does not reach that reminder if using Ctrl+C so has not completed.

3. How to 'systemctl enable' the socket(s)?

The script has an entry: 'systemctl restart xvnc$i.socket' so enable the socket(s) is 'systemctl enable xvnc0.socket', 'systemctl enable xvnc1.socket' and so on?

4. Is there a set limit within the script at which point it stops requesting further VNC socket resolutions? I don't thinks so, so how to remove those which are not required?

5. After completing the set up, the guide says, " Reboot and you're done!"

Not me! When I try to connect to the VNC0 using TigerVNC Viewer I get the error, "No matching security types" I did wonder as I worked through the guide about there being no mention of passwords.

I am sure these questions are very basic but I want to get this VNC instance correct and efficient!

Answers please?

Edit:

1. I stopped with Ctrl+C
2. Script has completed enough after stopping with Ctrl+C
3. sudo systemctl enable xvnc0.socket is correct (Says so in the guide!)
4. service and socket files which are not needed can be removed from '/etc/systemd/system'?
5. Remmina connects

Would still like to use TigerVNC viewer :-( as I do for two other Pi's.

I've just noticed that the VNC is not seeing the 'real' desktop so no fit for my purpose :-(

User avatar
topguy
Posts: 5934
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 3:09 pm


I've just noticed that the VNC is not seeing the 'real' desktop so no fit for my purpose.
So what is wrong with the official guide in that case: https://www.raspberrypi.org/documentati ... /README.md ?

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 3:37 pm

makem wrote:
Tue Dec 03, 2019 4:46 pm
I have Raspbian Buster with Desktop installed on a Pi4 and am in the process of setting up a VNC from a Linux laptop.

I followed the https://github.com/gitbls/RPiVNCHowTo then made and executed the 'make-systemd-xvnc script' mentioned in the guide.

I encountered questions I was unable to answer:

1. The script requested a VNC resolution for VNC1 which I entered as 1880x960. I was then asked for the resolution for VNC2 and so on. When to stop, how to stop making VNC sockets?

If using Ctrl+C to exit, has the script run enough at that stage?

2. The script contains a reminder, "echo "% Don't forget to 'sudo systemctl enable' the sockets so they restart on reboot""

The script does not reach that reminder if using Ctrl+C so has not completed.

3. How to 'systemctl enable' the socket(s)?

The script has an entry: 'systemctl restart xvnc$i.socket' so enable the socket(s) is 'systemctl enable xvnc0.socket', 'systemctl enable xvnc1.socket' and so on?

4. Is there a set limit within the script at which point it stops requesting further VNC socket resolutions? I don't thinks so, so how to remove those which are not required?

5. After completing the set up, the guide says, " Reboot and you're done!"

Not me! When I try to connect to the VNC0 using TigerVNC Viewer I get the error, "No matching security types" I did wonder as I worked through the guide about there being no mention of passwords.

I am sure these questions are very basic but I want to get this VNC instance correct and efficient!

Answers please?

Edit:

1. I stopped with Ctrl+C
2. Script has completed enough after stopping with Ctrl+C
3. sudo systemctl enable xvnc0.socket is correct (Says so in the guide!)
4. service and socket files which are not needed can be removed from '/etc/systemd/system'?
5. Remmina connects

Would still like to use TigerVNC viewer :-( as I do for two other Pi's.

I've just noticed that the VNC is not seeing the 'real' desktop so no fit for my purpose :-(
Given your last comment (I've just noticed that the VNC is not seeing the 'real' desktop so no fit for my purpose :-() there's not much point in further discussion. The guide creates virtual VNC desktops, not attached to the HDMI console.

That said, the correct way to cause make-systemd-xvnc to stop making VNC sockets is to simply press the Enter key in response to the "VNC resolution" prompt. Obviously the script should be updated to make this point more visible. Thanks for pointing it out!

I was just thinking about adding support to the project for connecting to the HDMI console (the 'real desktop'). Would this be of interest to you?

If you have any further questions/problems/feedback on the github project, please post them as issues in the github project.

User avatar
makem
Posts: 280
Joined: Tue Jun 18, 2013 9:22 pm

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 7:26 pm

Thank you for your reply.

I will post in github issues but to complete this thread:

I decided to use x11vnc and within a few minutes with very few 'operations' I had a working 'real' desktop which I could leave and return to later.

The only issue (not related to VNC) was the HDMI sound output which was missing. I had plugged in the HDMI connector in the socket furthest from the power connector thinking the space would allow easier removal of one or the other later. Fatal! It took me ages to find the sound was on the socket closest to the power supply. No idea why.

As for adding a 'real' interface to your package, I would hesitate as it has already been 'done'. Your package has one purpose which it does perfectly. It was my fault for not realising it was not suitable for my purpose.

One addition I would suggest is a note at the beginning pointing out to newbies like me, that it doesn't provide 'real' desktops.

klricks
Posts: 6613
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 9:08 pm

makem wrote:
Wed Dec 04, 2019 7:26 pm
Thank you for your reply.

I will post in github issues but to complete this thread:

I decided to use x11vnc and within a few minutes with very few 'operations' I had a working 'real' desktop which I could leave and return to later.

The only issue (not related to VNC) was the HDMI sound output which was missing. I had plugged in the HDMI connector in the socket furthest from the power connector thinking the space would allow easier removal of one or the other later. Fatal! It took me ages to find the sound was on the socket closest to the power supply. No idea why.

As for adding a 'real' interface to your package, I would hesitate as it has already been 'done'. Your package has one purpose which it does perfectly. It was my fault for not realising it was not suitable for my purpose.

One addition I would suggest is a note at the beginning pointing out to newbies like me, that it doesn't provide 'real' desktops.
Not sure why you are messing with the Github stuff?
RealVNC (service mode) is already installed in Raspbian and by default mirrors the actual 'real' desktop.
You only need to enable VNC using sudo raspi-config then reboot.
Use the appropriate RealVNC client from here: https://www.realvnc.com/en/connect/download/viewer/

If you prefer virtual mode then type vncserver at the command prompt to start a virtual session(s). But the virtual session(s) will be independent of the main session.

Note that audio over VNC is not supported.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
makem
Posts: 280
Joined: Tue Jun 18, 2013 9:22 pm

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 10:13 pm

klricks wrote:
Wed Dec 04, 2019 9:08 pm
[
Not sure why you are messing with the Github stuff?
RealVNC (service mode) is already installed in Raspbian and by default mirrors the actual 'real' desktop.
You only need to enable VNC using sudo raspi-config then reboot.
Use the appropriate RealVNC client from here: https://www.realvnc.com/en/connect/download/viewer/

If you prefer virtual mode then type vncserver at the command prompt to start a virtual session(s). But the virtual session(s) will be independent of the main session.

Note that audio over VNC is not supported.
Because that (RealVNC), is what I first tried and found it clashed with VNC clients already in use for other pi's

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 10:53 pm

klricks wrote:
Wed Dec 04, 2019 9:08 pm
Not sure why you are messing with the Github stuff?
People want choice, and make choices for different reasons. Raspbian includes 3 different VNC servers, so there's plenty of choice there :lol:

I authored the "github stuff" in question. I ended up going down this path because I had some problems with RealVNC, and it "felt heavy" to me. Once I had found a working solution, I discovered it was pretty lightweight on system resources, so wrote it up in case anyone else was interested.

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 11:03 pm

makem wrote:
Wed Dec 04, 2019 7:26 pm
Thank you for your reply.

I will post in github issues but to complete this thread:

I decided to use x11vnc and within a few minutes with very few 'operations' I had a working 'real' desktop which I could leave and return to later.

The only issue (not related to VNC) was the HDMI sound output which was missing. I had plugged in the HDMI connector in the socket furthest from the power connector thinking the space would allow easier removal of one or the other later. Fatal! It took me ages to find the sound was on the socket closest to the power supply. No idea why.

As for adding a 'real' interface to your package, I would hesitate as it has already been 'done'. Your package has one purpose which it does perfectly. It was my fault for not realising it was not suitable for my purpose.

One addition I would suggest is a note at the beginning pointing out to newbies like me, that it doesn't provide 'real' desktops.
Thanks for your feedback. I've added a note to the README that it only works with virtual mode. Still thinking about adding a way to easily enable Console VNC (actually it's been on my ToDo list for a while). And yes, it's easy (as you discovered), but x11vnc has a super-long man page, some people might appreciate the canned approach.

User avatar
makem
Posts: 280
Joined: Tue Jun 18, 2013 9:22 pm

Re: How to install efficient VNC on Raspbian

Wed Dec 04, 2019 11:15 pm

bls wrote:
Wed Dec 04, 2019 11:03 pm
Thanks for your feedback. I've added a note to the README that it only works with virtual mode. Still thinking about adding a way to easily enable Console VNC (actually it's been on my ToDo list for a while). And yes, it's easy (as you discovered), but x11vnc has a super-long man page, some people might appreciate the canned approach.
[/quote]

"Super long", you can say that again! I gave up reading all and just dived in. Most of it was way over what I needed but obviously useful to most knowledgeable persons.

I must go back to reading it now I have discovered screen corruption on the client, but the remote desktop is rock steady so i can live with that for a while. I have never seen it before when using x11vnc, the only difference is the Pi which is faster.

Edit: Just found mention of -noxdamage but this term is not mention on the x11vnc man page although X DAMAGE extension is mentioned.

User avatar
rin67630
Posts: 582
Joined: Fri Mar 04, 2016 10:15 am

Re: How to install efficient VNC on Raspbian

Thu Dec 05, 2019 2:24 am

What was wrong with just enabling VNC from the Raspberry Pi configuration and enjoying it without frills?
Why do you need all the GitHub stuff and reading super-long man pages?
:o

fruitoftheloom
Posts: 21037
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How to install efficient VNC on Raspbian

Thu Dec 05, 2019 2:46 am

rin67630 wrote:
Thu Dec 05, 2019 2:24 am
What was wrong with just enabling VNC from the Raspberry Pi configuration and enjoying it without frills?
Why do you need all the GitHub stuff and reading super-long man pages?
:o

+ 100%

Totally agree RealVNC Connect was developed to run on the Raspberry Pi SBC running Raspbian Operating System, and is fully supported.

The other offerings are generic so as many have found they have foibles.

https://www.realvnc.com/en/raspberrypi/

https://www.raspberrypi.org/documentati ... /README.md
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
makem
Posts: 280
Joined: Tue Jun 18, 2013 9:22 pm

Re: How to install efficient VNC on Raspbian

Thu Dec 05, 2019 2:20 pm

I have said twice now that the RealVNC viewer 'app' conflicted with the viewer I currently use on other Pi's So, I did try the in-built RealVNC and also did not like:

1. It goes on about using a free so-called 'Cloud service'. I have my data on as few other computers as possible, so don't use clouds.
2. I needed to 'sign up'
3. I needed to use a 'compatible app'. Smacks of winblows to me.
4. I simply wanted a 'real' desktop.
5. The software seemed ott for my needs. (I don't play games or need access from anywhere other than my home)

Having installed all the RealVNC software and then decided it was not for me, and not being other than a 'newbie', I found that to me RealVNC 'stuff' was interfering with the service(s) I was then trying out. I decided the simple way was to re-image the SD card rather than have a messed up install.

I am sure the RealVNC app on the pi4 is brilliant for those who need it but I don't in my humble opinion.

User avatar
DougieLawson
Posts: 36511
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: How to install efficient VNC on Raspbian

Thu Dec 05, 2019 2:27 pm

makem wrote:
Thu Dec 05, 2019 2:20 pm


1. It goes on about using a free so-called 'Cloud service'. I have my data on as few other computers as possible, so don't use clouds.
2. I needed to 'sign up'
3. I needed to use a 'compatible app'. Smacks of winblows to me.
4. I simply wanted a 'real' desktop.
5. The software seemed ott for my needs. (I don't play games or need access from anywhere other than my home)
1. It's optional, RTFWP at: https://www.realvnc.com/en/connect/features/ https://www.realvnc.com/en/raspberrypi/ the cloud piece is only for connect from anywhere (outside your LAN) - You DO NOT need to use that.
2. It's optional, only if you want to use #1
3. There's RealVNC for Windows, Linux and MacOS and Android phones.
4. That's what RealVNC gives you, they've done some work precisely for that on a Raspberry Pi
https://help.realvnc.com/hc/en-us/artic ... spberry-Pi
5. No it's not. It's also extremely well supported with some of the developers posting on this forum
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

fruitoftheloom
Posts: 21037
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How to install efficient VNC on Raspbian

Thu Dec 05, 2019 3:48 pm

DougieLawson wrote:
Thu Dec 05, 2019 2:27 pm
makem wrote:
Thu Dec 05, 2019 2:20 pm


1. It goes on about using a free so-called 'Cloud service'. I have my data on as few other computers as possible, so don't use clouds.
2. I needed to 'sign up'
3. I needed to use a 'compatible app'. Smacks of winblows to me.
4. I simply wanted a 'real' desktop.
5. The software seemed ott for my needs. (I don't play games or need access from anywhere other than my home)
1. It's optional, RTFWP at: https://www.realvnc.com/en/connect/features/ https://www.realvnc.com/en/raspberrypi/ the cloud piece is only for connect from anywhere (outside your LAN) - You DO NOT need to use that.
2. It's optional, only if you want to use #1
3. There's RealVNC for Windows, Linux and MacOS and Android phones.
4. That's what RealVNC gives you, they've done some work precisely for that on a Raspberry Pi
https://help.realvnc.com/hc/en-us/artic ... spberry-Pi
5. No it's not. It's also extremely well supported with some of the developers posting on this forum

3) there is a viewer for Chrome OS though old still functional...
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
rin67630
Posts: 582
Joined: Fri Mar 04, 2016 10:15 am

Re: How to install efficient VNC on Raspbian

Thu Dec 05, 2019 4:27 pm

makem wrote:
Thu Dec 05, 2019 2:20 pm
I have said twice now that the RealVNC viewer 'app' conflicted with the viewer I currently use on other Pi's
You can use VNC on your LAN with hundreds of Pis without conflict and without registering. You need registration only to use VNC across NATs.
Just mind the IP which is tied to the Pi if it has onboard WLAN / LAN or tied to the USB Adapter else.

Return to “Raspbian”