rlx
Posts: 8
Joined: Mon Aug 12, 2019 9:03 pm

Disable RealVNC VNC Conntect

Sat Mar 28, 2020 1:40 pm

Hi all,

I am desperately looking for a way to deactivate the autostart of the RealVNC VNC Connect app which starts up each time a user remotely logs in via a VNC connection. I see no need in this app to be active all the time and it bothers me a lot that I have to close it after each reboot and subsequent VNC-reconnect.

I have googled, tried to find the command which starts the app on startup in the filesystem, looked through lots of configs... no luck. I suspect it can be deactivated via a config setting, but didn't succed in finding one.

Any idea?
Attachments
vnc-connect.png
vnc-connect.png (29.41 KiB) Viewed 327 times

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

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 3:36 pm

rlx wrote:
Sat Mar 28, 2020 1:40 pm
Hi all,

I am desperately looking for a way to deactivate the autostart of the RealVNC VNC Connect app which starts up each time a user remotely logs in via a VNC connection. I see no need in this app to be active all the time and it bothers me a lot that I have to close it after each reboot and subsequent VNC-reconnect.

I have googled, tried to find the command which starts the app on startup in the filesystem, looked through lots of configs... no luck. I suspect it can be deactivated via a config setting, but didn't succed in finding one.

Any idea?
What you are asking makes no sense.
You can disable Real VNC the same way you enabled it.... Use the interfaces menu in either the GUI config tool or sudo raspi-config. Of course doing this will disable all VNC (Service Mode) connections. (If using virtual mode then you don't need to enable VNC).
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

rlx
Posts: 8
Joined: Mon Aug 12, 2019 9:03 pm

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 5:00 pm

klricks wrote:
Sat Mar 28, 2020 3:36 pm
What you are asking makes no sense.
You are absolutely right in that I forgot to point out:

No, I do not actually want to disable VNC (I'd know how to do that).

I just do not want that VNC Connect app not to start.

It autostarts after each reboot when I log in via VNC. I can quit it, and the VNC connection is still there, which leads me to the conclusion that it is just an add-on to the acutal VNC server. And I'd like to get rid of it and keep it from autostarting.

I hope this makes more sense.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 6:18 pm

It doesn't start up with a dialog on my Buster Desktop setup, just an icon in the taskbar...
Did you fiddle around with the VNC settings?

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

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 6:21 pm

rlx wrote:
Sat Mar 28, 2020 5:00 pm
klricks wrote:
Sat Mar 28, 2020 3:36 pm
What you are asking makes no sense.
You are absolutely right in that I forgot to point out:

No, I do not actually want to disable VNC (I'd know how to do that).

I just do not want that VNC Connect app not to start.

It autostarts after each reboot when I log in via VNC. I can quit it, and the VNC connection is still there, which leads me to the conclusion that it is just an add-on to the acutal VNC server. And I'd like to get rid of it and keep it from autostarting.

I hope this makes more sense.
What version of RealVNC are you running? The latest is 6.7.1
The server screen on my system RPi4 w/ latest Buster is slightly different. I don't have the black bar with x on the left side. I have gray bar with standard min max [x] on the right side.

Are you saying the RealVNC server appears maximized on the screen at connection time and does not go away until you minimize [x] it?
There is no separate app. I don't get the server screen unless I click on the RVNC icon in task bar. When I click [x] the server screen is minimized (not closed).
For me at connection time a one line connection message briefly pops up on the screen then goes away.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

rlx
Posts: 8
Joined: Mon Aug 12, 2019 9:03 pm

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 6:22 pm

DirkS wrote:
Sat Mar 28, 2020 6:18 pm
It doesn't start up with a dialog on my Buster Desktop setup, just an icon in the taskbar...
Did you fiddle around with the VNC settings?
I never said it starts up with a dialog... I said the app starts up and that's what I want to get rid off.

I confirm that it starts up as an icon in the taskbar.

I don't want it to start up at all, just the VNC server component.

rlx
Posts: 8
Joined: Mon Aug 12, 2019 9:03 pm

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 6:24 pm

klricks wrote:
Sat Mar 28, 2020 6:21 pm
For me at connection time a one line connection message briefly pops up on the screen then goes away.
Same here, it minimizes to the tray, but it has no clear use for me, I can stop it and VNC connectivity is still up and running, so I want to get rid of it - even though it's not starting full screen.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5621
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 6:28 pm

rlx wrote:
Sat Mar 28, 2020 5:00 pm
klricks wrote:
Sat Mar 28, 2020 3:36 pm
What you are asking makes no sense.
You are absolutely right in that I forgot to point out:

No, I do not actually want to disable VNC (I'd know how to do that).

I just do not want that VNC Connect app not to start.

It autostarts after each reboot when I log in via VNC. I can quit it, and the VNC connection is still there, which leads me to the conclusion that it is just an add-on to the acutal VNC server. And I'd like to get rid of it and keep it from autostarting.

I hope this makes more sense.
AIUI, it's the server that starts on reboot and, subsequently triggers/starts... "VNC connect" to inform you how to connect from another machine. If you can login initially via SSH (eg. using something like PuTTY or whatever your external m/c & O.S. provides) then you don't need to enable the (main) server on boot but just run in from the (logged in) command line. The same info. is still displayed but not as a GUI "Pop-Up". Historically I've used PuTTY (or equivalent) with X-forwarding enabled to launch a GUI-app to the display (X-compatible) on the remotely connecting m/c longer and more often than VNC. So, given also that my Pi's are setup to boot to command-line in case they are not connected to a display and are to remain headless, using the virtual mode (or, occasionally, still X-forwarding) is what I often do. It has the additional advantage in that you can specify the VNC window/display geometry. FWIW, some example screenshots can be found here: https://www.cpmspectrepi.uk/raspberry_p ... uster.html Whilst not exactly what you're asking for you may find it worth a try.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Disable RealVNC VNC Conntect

Sat Mar 28, 2020 9:21 pm

rlx wrote:
Sat Mar 28, 2020 6:22 pm
I don't want it to start up at all, just the VNC server component.
It's part of RealVNC Server that you get free with Raspbian. If you don't like it, you can install another VNC server. Alternatives will be much slower, and often lack the nifty features like file transfers and local printer mirroring.

Removing the icon keeps the vncserver* tasks running. Killing those tasks will disconnect you pronto. RealVNC is commercial, so you get what you get and like it.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

rlx
Posts: 8
Joined: Mon Aug 12, 2019 9:03 pm

Re: Disable RealVNC VNC Conntect

Sun Mar 29, 2020 8:23 pm

Thanks for all your comments and thoughts, I solved the problem the following way:

- Installed x11vnc via apt (advantage: it removes RealVNC automatically, but retains all the previously exisiting config files, which I think is essential)
- Then I set the VNC password (vncpasswd)
- FInally I am starting VNC with the script below.

Works like a charme, need to look into how to make VNC autostart at boot. Shouldn't be too hard, though.

Code: Select all

#!/bin/bash
DEFAULT_DISPLAY=:0
X11VNC_DISPLAY="$DEFAULT_DISPLAY"

if [ -x /usr/bin/x11vnc ]; then
     [ "$1" == '-nocache' ] && CACHE_FLAG='-noncache' || CACHE_FLAG='-noncache'
     [ "$2" == '-guess' ] && GUESS_FLAG='-auth guess' || GUESS_FLAG=''
         [ -f /root/.vnc/passwd ] && PASSWORD="/root/.vnc/passwd"
         [ -f $HOME/.vnc/passwd ] && PASSWORD="$HOME/.vnc/passwd"
         [ ! -z "$PASSWORD" ] && x11vnc -display $X11VNC_DISPLAY -xkb -rfbauth $PASSWORD -rfbport 5900 -shared -forever -nowf -norc -notruecolor -bg $GUESS_FLAG $CACHE_FLAG -noxdamage
    EXIT_CODE=$?
     if [ $EXIT_CODE -ne 0 ]; then

        echo "\n*********************************************************************"
        echo "*** Could not start x11vnc!  Trying again with gdm MAGIC_COOKIE! ***"
        echo "*********************************************************************\n"

        # Old GDM location for Ubuntu <= 17.10
        MAGIC_COOKIE_FILE=`sudo find /var/run/gdm/ -iname database | grep for-gdm`

        # New GDM location for Ubuntu >= 17.10
        [ -z "$MAGIC_COOKIE_FILE" ] && NUM_MAGIC_COOKIE_FILE_SESSIONS=`sudo find /run/user/ -iwholename '*/gdm/*' -iname '*Xauthority' 2>/dev/null | wc -l`
        if [ -z "$MAGIC_COOKIE_FILE" -a "$NUM_MAGIC_COOKIE_FILE_SESSIONS" -gt 1 ]; then
            # Find the current user's session
            MAGIC_COOKIE_FILE=`sudo find /run/user/$(id -u) -iwholename '*/gdm/*' -iname '*Xauthority'`
            X11VNC_DISPLAY=":1"
        else
            # Find the GDM user's session (or whichever shows up first in ps list)
            # This should pick up the original gdm session which grabs :0
            # If you login after gdm login screen, your Xorg server may end up on another display!
            # Workaround for now is to restart x11vnc on that display number
            [ -z "$MAGIC_COOKIE_FILE" ] && MAGIC_COOKIE_FILE=`sudo find /run/user/ -iwholename '*/gdm/*' -iname '*Xauthority' | head -n1`
        fi
        # Old lightdm location for Ubuntu <= 17.10
        [ -z "$MAGIC_COOKIE_FILE" ] && MAGIC_COOKIE_FILE=`sudo find /var/lib -name '.Xauthority' -o -wholename '/var/run/lightdm/root/:0' | head -n1`
        #sudo bash -c "[ -z \"$MAGIC_COOKIE_FILE\" -a -e /var/run/lightdm/root/:0 ]" && MAGIC_COOKIE_FILE='/var/run/lightdm/root/:0'
        [ -n "$MAGIC_COOKIE_FILE" -a -z "$GUESS_FLAG" ] && AUTH_COOKIE_FLAG="-auth $MAGIC_COOKIE_FILE"
        [ ! -z "$PASSWORD" ] && sudo x11vnc -display $X11VNC_DISPLAY -xkb -rfbauth $PASSWORD -rfbport 5900 -shared -forever -nowf -norc -notruecolor -bg $GUESS_FLAG $CACHE_FLAG -noxdamage ${AUTH_COOKIE_FLAG}
    fi
fi


User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Disable RealVNC VNC Conntect

Sun Mar 29, 2020 11:23 pm

About half way down this post: VNC remote desktop via web browser - Page 3 - Raspberry Pi Forums
there is a service definition for starting x11vnc. The package may come with one already
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Beginners”