1

I want to use the VNC shipped with a Raspberry Pi. My goal is to offer the possibility to several users to connect to their own home at the same time. By default, I can connect to the "pi" user.

I have created 3 accounts "lary" "gary" and "hary". They have their own home : "/home/lary", "/home/gary" and "/home/hary". With a VNC client I would like to have "lary" being able to connect to the content of "/home/lary". Same for "gary" and "hary" at the same time.

Can I use ports for that ? Which files do I need to change ?

2 Answers2

1

The default RealVNC installation shows the monitor screen, so it will show the display of whoever is using this.

You can start a virtual desktop and can run multiple instances.

The RealVNC documentation explains how to do this.

See https://www.raspberrypi.org/documentation/remote-access/vnc/README.md

To create and connect to a virtual desktop:

On your Raspberry Pi (using Terminal or via SSH), run vncserver. Make note of the IP address/display number that VNC Server will print to your Terminal (e.g. 192.167.5.149:1).

On the device you'll use to take control, enter this information into VNC Viewer.

It is also possible to create a systemd service to start vncserver instances.

https://raspberrypi.stackexchange.com/a/39374/8697 is a service I used with tightvncserver; this should also work with RealVNC (with minor changes for user)

Milliways
  • 62,573
  • 32
  • 113
  • 225
0

Create Multiple Virtual Desktops

You can create multiple virtual desktops in Raspberry Pi by starting VNC Server on different display numbers. For example, to start a VNC server on display :1, :2, etc., use:

vncserver-virtual

Each time this command will start a new VNC session on a different virtual desktop.

Connect to Virtual Desktops

On your computer, open VNC Viewer and connect to your Raspberry Pi using the IP address followed by the display number. For example:

192.168.1.100:1 for the first virtual desktop 192.168.1.100:2 for the second virtual desktop To end a specific VNC session, use:

vncserver-virtual -kill :DISPLAY

For Example,

vncserver-virtual -kill :1