Changes

From Amahi Wiki
Jump to: navigation, search
388 bytes added ,  11:32, 2 January 2014
no edit summary
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.
 
 
 
=== MATE-Desktop Environment ===
 
* As root, install MATE-Desktop Environment:
yum -y groupinstall mate-desktop-extra
=== KDE-Desktop Environment ===
 
* As root, install KDE-Desktop Environment:
yum install -y groupinstall @kde-desktop === Cinnamon-Desktop Environment === * As root, install Cinnamon-Desktop Environment:  yum -y groupinstall cinnamon 
= TigerVNC Server Installation =
* As root, install the server:
yum install tigervnc-server
*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 t 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 following. Please note this is for root access ONLY, see below on how to setup for other users.
[Service] Type=forking User=root # Clean any existing files in /tmp/.X11-unix environment ExecStartPre=-/usr/bin/vncserver -kill %i ExecStart=/usr/bin/vncserver %i ExecStop=/usr/bin/vncserver -kill %i
* Once the root config file vncserver@:1.service has been modified we next run the command
= Password Setup =
* 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 passwdinside the folder.
* From the example log into terminal as root 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 =
#!/bin/sh # # 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 &
=== KDE-Desktop Environment ===
* As root, remove the context of the xstartup file and replace with the following.
#!/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 & startkde &  === Cinnamon-Desktop Environment ===   #!/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 &
= TigerVNC Server Commands=
* The following commands will allow you to autostart and start the vncserver service.  systemctl enable vncserver@:1.service systemctl start vncserver@:1.service
systemctl enable * The following commands will allow you to disable autostart and stop the vncserver@:1.service systemctl start vncserver@:1.service
* The following commands will allow you to systemctl disable autostart and vncserver@:1.service systemctl stop the vncserver@:1.service.
* The following command will restart the vncserver service.  systemctl disable stop vncserver@:1.service * The following command will display the status of the vncserver service.  systemctl stop status vncserver@:1.service * The following command will stop the vncserver.  pkill vnc
* It is possible to setup multiple user login's other than root. For this example with will create 2 other users, Tom & Dick.
 
 
* First we need to create these user, either using the Amahi Dashboard under the USER setting or by the following commands under root control.
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
* Once all the config vncserver@:#.service files are 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 need needs to login in via terminal and run the the command as above 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 under via terminal and modify the xstarup file to reflect the chosen desktop environment as listed above. Each As above the xstartup file doesn't exist yet so each user will need make a xstartup file.  * As above we can access create the file as followedeither by nano ~/.vnc/xstartup* Or systemctl start vncserver@:1.service systemctl stop vncserver@:1.service
cd ~/.vnc
nano xstartup
* For this example we will use the MATE-Desktop Environment, each user will copy the following into their xstartup file.
#!/bin/sh # # 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 the services are running then each user can access their remote desktop using a client software as listed below.
 
* From the example tom's access ip address will be
28

edits