Difference between revisions of "TigerVNC"

From Amahi Wiki
Jump to: navigation, search
 
(39 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{MessageBox|
 
{{MessageBox|
backgroundcolor = #f8d6d6|
+
backgroundcolor = #faa|
 
image =Warning.png|
 
image =Warning.png|
heading =Released|
+
heading =WARNING|
message = Latest stable release is [[Amahi 8]] on Fedora 21.}}
+
message = Proceed with extreme caution.  This guidance has not been tested nor will be supported by Amahi.  Continuing could break your HDA and a reinstall from scratch may be necessary.}}
 
+
<div style="border: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;">
 +
'''NOTE:''' The one-click [https://www.amahi.org/apps/vnc VNC App] has been discontinued for Amahi 7 or greater. The reason is that it pulls a lot of packages, including desktop and that breaks DNS in Fedora.</div>
 +
<br />
 
__TOC__
 
__TOC__
  
= Amahi 7 (Fedora 19) Desktop Installation =
+
= Desktop Installation Amahi 8/9 =
  
For TigerVNC to work an Desktop Environment must be installed even if the HDA does not boot to the selected Desktop Environment. So far KDE and Mate Desktop Environments have been tested.
+
For TigerVNC to work a Desktop Environment must be installed even if the HDA does not boot to the selected Desktop Environment.  
  
<div style="border: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;">
+
This guidance is based on a clean installation of Amahi 8 or 9, using the [[Amahi_8_Install|Fedora 21 Server DVD]] or [[Amahi_9_Install|Fedora 23 Server DVD]] install method.
'''NOTE: there is a one-click [http://www.amahi.org/apps/vnc VNC App] in BETA'''</div>
 
  
 +
== Cinnamon (Amahi 8/Fedora 21) ==
  
=== MATE-Desktop Environment ===
+
* As root, install Cinnamon Desktop Environment:
  
* As root, install MATE-Desktop Environment:
+
yum groupinstall "Cinnamon Desktop" --skip-broken
  
yum -y groupinstall mate-desktop
+
The reason for '''--skip-broken''' is that Fedora Workstation contains several variant packages that would otherwise conflict with the Server versions. By passing this argument, we’re letting yum know that it is okay to skip those packages that would have conflicts.
  
=== KDE-Desktop Environment ===
+
If you wish to boot Fedora into a graphical mode instead of console, as root use the following
  
* As root, install KDE-Desktop Environment:
+
systemctl set-default graphical.target
  
yum -y groupinstall @kde-desktop
+
== LXDE (Amahi 9/Fedora 23) ==
  
=== Cinnamon-Desktop Environment ===
+
* As root, install LXDE Desktop Environment:
  
* As root, install Cinnamon-Desktop Environment:
+
dnf group install lxde-desktop
 
 
yum -y groupinstall cinnamon
 
  
 +
= TigerVNC Server Installation =
  
= TigerVNC Server Installation =
+
* These steps are the same for Amahi 8 and Amahi 9
  
 
* It is recommended to only use TigerVNC on a secure network or via a VPN.
 
* It is recommended to only use TigerVNC on a secure network or via a VPN.
Line 41: Line 42:
  
 
  yum install tigervnc-server
 
  yum install tigervnc-server
 +
Note: For Fedora 23, use dnf instead of yum
  
*The following example is if you wish to setup access under root control, if you wish to setup under normal user the see below under Multiply User Setup
 
  
 
+
*Once install we need to create new configuration file, vncserver@.service is only a template file, from this we need to create a the following config file.
 
 
*Once install we need to create new configuration file, vncserver@.service is only a template file, from this we need t create a the following config file.
 
  
 
  cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
 
  cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
Line 98: Line 97:
 
  WantedBy=multi-user.target
 
  WantedBy=multi-user.target
  
*Under [Service] replace with the following. Please note this is for root access ONLY, see below on how to setup for other users.
+
*Under [Service] replace with the <USER> with the user name setup in Amahi/Fedora. For this example we will use tom. The modified file will look like this.  
  
 
  [Service]
 
  [Service]
 
  Type=forking
 
  Type=forking
User=root
 
 
  # Clean any existing files in /tmp/.X11-unix environment
 
  # Clean any existing files in /tmp/.X11-unix environment
  ExecStartPre=-/usr/bin/vncserver -kill %i
+
  ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  ExecStart=/usr/bin/vncserver %i
+
  ExecStart=/sbin/runuser -l tom -c "/usr/bin/vncserver %i"
  ExecStop=/usr/bin/vncserver -kill %i
+
PIDFile=/home/tom/.vnc/%H%i.pid
 +
  ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  
* Once the root config file vncserver@:1.service has been modified we next run the command
+
* Once the config file vncserver@:1.service has been modified we next run the command as root.
  
 
  systemctl daemon-reload
 
  systemctl daemon-reload
 +
 +
 +
* We now have to modify the firewall and open port 5901 in the iptables, run the command as root.
 +
 +
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5901 -j ACCEPT
  
 
= Password Setup =
 
= Password Setup =
 +
*These are universal for both Amahi 8 and 9
  
 
* Set the VNC password for the user as defined in the vncserver@:1.service, this will create the .VNC folder for each user and place a file called passwd inside the folder.
 
* Set the VNC password for the user as defined in the vncserver@:1.service, this will create the .VNC folder for each user and place a file called passwd inside the folder.
  
  
* From the example log into terminal as root and run the following command
+
* From the example log into terminal as the user, in this example it will be tom and run the following command
  
 
  vncpasswd
 
  vncpasswd
Line 131: Line 136:
 
= Setup Desktop Environment Access =
 
= Setup Desktop Environment Access =
  
* Modification of the ~/.vnc/xstartup will be required to match the chosen Desktop-Environment. At this point the xstartup file doesn't exist so we have two options.
+
* Modification of the ~/.vnc/xstartup will be required to run the Desktop Environment. At this point the xstartup file doesn't exist so we do the following.
 
 
  
For this example we need to login as root.
+
For this example we need to login as the user.
  
 
* Create the xstartup file using the command below then copy/paste the required xstartup for the chosen desktop enviroment.
 
* Create the xstartup file using the command below then copy/paste the required xstartup for the chosen desktop enviroment.
 
  nano ~/.vnc/xstartup
 
  nano ~/.vnc/xstartup
  
 
+
== Amahi 8 (Fedora 21) ==
* Or we can use the commands below to start/stop the vncservice, this will create the default xstartup file which can then be modified. The service has to be stopped to allow the modification to work when restarted.
+
For the Cinnamon Desktop on Amahi 8 (Fedora 21), modify the xstartup to the below.
 
 
systemctl start vncserver@:1.service
 
systemctl stop vncserver@:1.service
 
 
 
* Below are xstartup scripts for the various desktop environments, if the xstartup was made via your favourite editor then simply cut/paste the script required else if using the default xstartup remove its context and again cut/paste required script.
 
 
 
 
 
=== MATE-Desktop Environment ===
 
 
 
  
 
  #!/bin/sh
 
  #!/bin/sh
 
  #
 
  #
  # Uncomment the following two lines for normal desktop:
+
  exec /usr/bin/cinnamon-session
# unset SESSION_MANAGER
 
unset DBUS_SESSION_BUS_ADDRESS
 
# exec /etc/X11/xinit/xinitrc
 
#
 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
 
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
 
xsetroot -solid grey
 
vncconfig -iconic &
 
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 
mate-session &
 
 
 
   
 
 
 
=== KDE-Desktop Environment ===
 
  
 +
== Amahi 9 (Fedora 23) ==
 +
For the LXDE Desktop on Amahi 9 (Fedora 23), modify the xstartup to the below.
  
 
  #!/bin/sh
 
  #!/bin/sh
 
  #
 
  #
  # Uncomment the following two lines for normal desktop:
+
  unset SESSION_MANAGER
#unset SESSION_MANAGER
+
  unset DBUS_SESSION_BUS_ADDRESS
  #exec /etc/X11/xinit/xinitrc
+
  lxterminal &
  #
+
  /usr/bin/lxsession -s LXDE &lxterminal &
  [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
 
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
 
#xsetroot -solid grey
 
#vncconfig -iconic &
 
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 
#twm &
 
startkde &
 
  
 +
= Starting Tiger VNC =
  
=== Cinnamon-Desktop Environment ===
+
* Log back in as root and run the following the commands below to enable and start the vncservice.
 
 
 
 
#!/bin/sh
 
#
 
# Uncomment the following two lines for normal desktop:
 
#unset SESSION_MANAGER
 
#exec /etc/X11/xinit/xinitrc
 
#
 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
 
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
 
#xsetroot -solid grey
 
#vncconfig -iconic &
 
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 
#twm &
 
cinnamon &
 
  
 +
systemctl enable vncserver@:1.service
 +
systemctl start vncserver@:1.service
  
 
= TigerVNC Server Commands=
 
= TigerVNC Server Commands=
Line 230: Line 194:
 
= Multiple User Setup =
 
= Multiple User Setup =
  
* It is possible to setup multiple user login's other than root. For this example with will create 2 other users, Tom & Dick.
+
* It is possible to setup multiple user login's. For this example with will create 2 other users, Dick & Harry.
  
  
Line 240: Line 204:
 
* For the example the commands will be
 
* For the example the commands will be
  
adduser tom
 
 
  adduser dick
 
  adduser dick
 +
adduser harry
  
 
* Then create a password for that user using the following command
 
* Then create a password for that user using the following command
Line 249: Line 213:
 
* For this example the command will be
 
* For this example the command will be
  
passwd tom
 
 
  passwd dick
 
  passwd dick
 +
passwd harry
  
 
* When requested enter a password and renter the password to verify it for each user created.
 
* When requested enter a password and renter the password to verify it for each user created.
  
* Once the user are created we will need to assign configuration files for each user. For this will assign the following config files as followed.
+
* Once the user are created we will need to assign configuration files for each user. For this will assign the following config files as followed. Carry out the below as root.
  
* Tom will be assigned the following config file using the following.
+
* Dick will be assigned the following config file using the following.
  
 
  cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service
 
  cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service
  
* Dick will be assigned the following config file.
+
* Harry will be assigned the following config file.
  
 
  cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:3.service
 
  cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:3.service
Line 267: Line 231:
  
  
* For Tom (under root control)
+
* For Dick (under root control)
  
 
  nano /lib/systemd/system/vncserver@:2.service
 
  nano /lib/systemd/system/vncserver@:2.service
Line 277: Line 241:
 
  # Clean any existing files in /tmp/.X11-unix environment
 
  # Clean any existing files in /tmp/.X11-unix environment
 
  ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
 
  ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  ExecStart=/sbin/runuser -l tom -c "/usr/bin/vncserver %i"
+
  ExecStart=/sbin/runuser -l dick -c "/usr/bin/vncserver %i"
  PIDFile=/home/tom/.vnc/%H%i.pid
+
  PIDFile=/home/dick/.vnc/%H%i.pid
 
  ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
 
  ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  
  
  
* For Dick (under root control)
+
* For Harry (under root control)
  
 
  nano /lib/systemd/system/vncserver@:3.service
 
  nano /lib/systemd/system/vncserver@:3.service
Line 293: Line 257:
 
  # Clean any existing files in /tmp/.X11-unix environment
 
  # Clean any existing files in /tmp/.X11-unix environment
 
  ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
 
  ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  ExecStart=/sbin/runuser -l dick -c "/usr/bin/vncserver %i"
+
  ExecStart=/sbin/runuser -l harry -c "/usr/bin/vncserver %i"
  PIDFile=/home/dick/.vnc/%H%i.pid
+
  PIDFile=/home/harry/.vnc/%H%i.pid
 
  ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
 
  ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  
Line 308: Line 272:
  
  
* As above we can create the file either by
+
* Log in as each user and run the following command to create the xstartup file.
 +
 
 
  nano ~/.vnc/xstartup
 
  nano ~/.vnc/xstartup
* Or
 
systemctl start vncserver@:1.service
 
systemctl stop vncserver@:1.service
 
 
 
* For this example we will use the MATE-Desktop Environment, each user will copy the following into their xstartup file.
 
  
#!/bin/sh
+
* Again modify the xstartup file as above to use the cinnamon desktop environment.
#
 
# Uncomment the following two lines for normal desktop:
 
# unset SESSION_MANAGER
 
unset DBUS_SESSION_BUS_ADDRESS
 
# exec /etc/X11/xinit/xinitrc
 
#
 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
 
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
 
xsetroot -solid grey
 
vncconfig -iconic &
 
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 
mate-session &
 
  
 
* Once each xstartup file is modified we need to start each service. Login as root and run the following commands.
 
* Once each xstartup file is modified we need to start each service. Login as root and run the following commands.
Line 338: Line 285:
 
  systemctl start vncserver@:3.service
 
  systemctl start vncserver@:3.service
  
* Once the services are running then each user can access their remote desktop using a client software as listed below.
+
* Once the services are running then each user can access their remote desktop using a client software as listed below. The ip address will depend on how you have setup your HDA.
  
  
* From the example tom's access ip address will be
+
* From the example Dicks access ip address will be
  
 
  192.168.1.10:2
 
  192.168.1.10:2
  
* For dick's the access ip address will be  
+
* For Harrys the access ip address will be  
  
 
  192.168.1.10:3
 
  192.168.1.10:3
 
 
= Multiple User/Multiply Desktop-Environment Setup =
 
 
* It is possible to for each user to use the VNC under different desktop-environment. For this example Tom wants to use KDE whilst Dick wants to use Cinnamon.
 
 
 
As root
 
 
* Install each required desktop-environment.
 
 
* Stop Tom's and Dick's VCN services.
 
 
systemctl disable vncserver@:2.service
 
systemctl disable vncserver@:3.service
 
systemctl stop vncserver@:2.service
 
systemctl stop vncserver@:3.service
 
 
* As Tom login and alter the xstartup file to reflect the desktop-environment required.
 
 
nano ~/.vnc/xstartup
 
 
* As Dick login and alter the xstartup file to reflect the desktop-environment required.
 
 
nano ~/.vnc/xstartup
 
 
* As root restart all the services
 
 
systemctl enable vncserver@:2.service
 
systemctl enable vncserver@:3.service
 
systemctl start vncserver@:2.service
 
systemctl start vncserver@:3.service
 
 
* Each user will now be-able to use their desktop-environment of there choice.
 
 
  
 
= Windows Client Software =
 
= Windows Client Software =
Line 400: Line 312:
 
[[File:UltraVNC_Screen1.png]]
 
[[File:UltraVNC_Screen1.png]]
  
If connection is successful it will as for a password, which is the password entered from the setup above.
+
If connection is successful it will ask for a password, which is the password entered from the setup above.
 
 
= Screenshots =
 
 
 
Screenshot from the examples above showing root, tom & dick's VNC connections under different desktop-environments.
 
 
 
[[File:Example desktop.png]]
 
 
 
Screenshot of KDE Remote Desktop
 
  
  
[[File:KDE Example.png]]
 
  
  

Latest revision as of 18:16, 7 May 2016

Warning.png WARNING
Proceed with extreme caution. This guidance has not been tested nor will be supported by Amahi. Continuing could break your HDA and a reinstall from scratch may be necessary.


NOTE: The one-click VNC App has been discontinued for Amahi 7 or greater. The reason is that it pulls a lot of packages, including desktop and that breaks DNS in Fedora.


Desktop Installation Amahi 8/9

For TigerVNC to work a Desktop Environment must be installed even if the HDA does not boot to the selected Desktop Environment.

This guidance is based on a clean installation of Amahi 8 or 9, using the Fedora 21 Server DVD or Fedora 23 Server DVD install method.

Cinnamon (Amahi 8/Fedora 21)

  • As root, install Cinnamon Desktop Environment:
yum groupinstall "Cinnamon Desktop" --skip-broken

The reason for --skip-broken is that Fedora Workstation contains several variant packages that would otherwise conflict with the Server versions. By passing this argument, we’re letting yum know that it is okay to skip those packages that would have conflicts.

If you wish to boot Fedora into a graphical mode instead of console, as root use the following

systemctl set-default graphical.target

LXDE (Amahi 9/Fedora 23)

  • As root, install LXDE Desktop Environment:
dnf group install lxde-desktop

TigerVNC Server Installation

  • These steps are the same for Amahi 8 and Amahi 9
  • It is recommended to only use TigerVNC on a secure network or via a VPN.
  • As root, install the server:
yum install tigervnc-server

Note: For Fedora 23, use dnf instead of yum


  • Once install we need to create new configuration file, vncserver@.service is only a template file, from this we need to create a the following config file.
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
  • Open the new configuration file
nano /lib/systemd/system/vncserver@:1.service
  • The configuration will look like this
# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@:<display>.service
# 2. Edit <USER> and vncserver parameters appropriately
#   ("runuser -l <USER> -c /usr/bin/vncserver %i -arg1 -arg2")
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
#
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel.  See the "-via" option in the
# `man vncviewer' manual page.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target
  • Under [Service] replace with the <USER> with the user name setup in Amahi/Fedora. For this example we will use tom. The modified file will look like this.
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l tom -c "/usr/bin/vncserver %i"
PIDFile=/home/tom/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  • Once the config file vncserver@:1.service has been modified we next run the command as root.
systemctl daemon-reload


  • We now have to modify the firewall and open port 5901 in the iptables, run the command as root.
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5901 -j ACCEPT

Password Setup

  • These are universal for both Amahi 8 and 9
  • Set the VNC password for the user as defined in the vncserver@:1.service, this will create the .VNC folder for each user and place a file called passwd inside the folder.


  • From the example log into terminal as the user, in this example it will be tom and run the following command
vncpasswd
  • The following response will appear waiting for a password to be entered
Password:
  • The following response will appear waiting to verify the password entered.
Verify:

Setup Desktop Environment Access

  • Modification of the ~/.vnc/xstartup will be required to run the Desktop Environment. At this point the xstartup file doesn't exist so we do the following.

For this example we need to login as the user.

  • Create the xstartup file using the command below then copy/paste the required xstartup for the chosen desktop enviroment.
nano ~/.vnc/xstartup

Amahi 8 (Fedora 21)

For the Cinnamon Desktop on Amahi 8 (Fedora 21), modify the xstartup to the below.

#!/bin/sh
#
exec /usr/bin/cinnamon-session

Amahi 9 (Fedora 23)

For the LXDE Desktop on Amahi 9 (Fedora 23), modify the xstartup to the below.

#!/bin/sh
#
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
lxterminal &
/usr/bin/lxsession -s LXDE &lxterminal &

Starting Tiger VNC

  • Log back in as root and run the following the commands below to enable and start the vncservice.
systemctl enable vncserver@:1.service
systemctl start vncserver@:1.service

TigerVNC Server Commands

  • The following commands will allow you to start on boot and start the vncserver service.
systemctl enable vncserver@:1.service
systemctl start vncserver@:1.service
  • The following commands will allow you to disable start on boot and stop the vncserver service.
systemctl disable vncserver@:1.service
systemctl stop vncserver@:1.service
  • The following command will restart the vncserver service.
systemctl restart vncserver@:1.service
  • The following command will display the status of the vncserver service.
systemctl status vncserver@:1.service
  • The following command will stop the vncserver.
pkill vnc


Multiple User Setup

  • It is possible to setup multiple user login's. For this example with will create 2 other users, Dick & Harry.


  • First we need to create these user, either using the Amahi Dashboard under the USER setting or by the following commands under root control.
adduser <user name>
  • For the example the commands will be
adduser dick
adduser harry
  • Then create a password for that user using the following command
passwd <user name>
  • For this example the command will be
passwd dick
passwd harry
  • When requested enter a password and renter the password to verify it for each user created.
  • Once the user are created we will need to assign configuration files for each user. For this will assign the following config files as followed. Carry out the below as root.
  • Dick will be assigned the following config file using the following.
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service
  • Harry will be assigned the following config file.
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:3.service
  • Once the config files are created we will need to modify them for the correct user access. Accessing the files using your favourite editor the config files need to be modified under [Service] to reflect the assigned user. For this example the files should look like the following.


  • For Dick (under root control)
nano /lib/systemd/system/vncserver@:2.service
  • Then modify the [Service] as followed
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l dick -c "/usr/bin/vncserver %i"
PIDFile=/home/dick/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'


  • For Harry (under root control)
nano /lib/systemd/system/vncserver@:3.service
  • Then modify the [Service] as followed
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l harry -c "/usr/bin/vncserver %i"
PIDFile=/home/harry/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  • Once all the vncserver@:#.service files have been created and modified we then run the following command (as root)
systemctl daemon-reload
  • We need to assign password to access vnc-server for each user, for this each user needs to login in via terminal and run the the command as below, this will be the same procedure as described under the password section
vncpasswd
  • Once each user has created a password, then each user needs to login in via terminal and modify the xstarup file to reflect the chosen desktop environment as listed above. As above the xstartup file doesn't exist yet so each user will need make a xstartup file.


  • Log in as each user and run the following command to create the xstartup file.
nano ~/.vnc/xstartup
  • Again modify the xstartup file as above to use the cinnamon desktop environment.
  • Once each xstartup file is modified we need to start each service. Login as root and run the following commands.
systemctl enable vncserver@:2.service
systemctl enable vncserver@:3.service
systemctl start vncserver@:2.service
systemctl start vncserver@:3.service
  • Once the services are running then each user can access their remote desktop using a client software as listed below. The ip address will depend on how you have setup your HDA.


  • From the example Dicks access ip address will be
192.168.1.10:2
  • For Harrys the access ip address will be
192.168.1.10:3

Windows Client Software

Download the latest Windows Client Software


Using UltraVNC for this example enter in the VNC Server text Box your hda ip address location with :1 as per the example picture below

The :1 refers to the vncserver@:1.service file that was modified


UltraVNC Screen1.png

If connection is successful it will ask for a password, which is the password entered from the setup above.