Changes

From Amahi Wiki
Jump to: navigation, search
91 bytes added ,  18:16, 7 May 2016
no edit summary
<!-- This page is crated automaticaly by a script.This part is commented and shall not show--><!--At the top of the page can be vissible one of the following tags..--> {{WorkInProgress}}<!--{{NeedsUpdate}}--><!--{{NeedsMerge | [[Main Page]]}}--><!--{{NeedsExpantion}}--><!--{{NeedsDelete MessageBox|[[Main Page]]}}--><!--Please remove or place comment accordingly--><!--Your text bellow this line--> {{MessageBox|backgroundcolor = #FBBfaa|
image =Warning.png|
heading =WARNING|
message = Proceed with extreme caution. This should only guidance has not been tested nor will be attempted supported by advanced usersAmahi. Continuing could break your HDA and a reinstall from scratch may be necessary.}}<brdiv style="border: 1px solid #A3B1BF; padding: .8em 1em; background-color: #E6F2FF; margin: 0px 1em;">It '''NOTE:''' The one-click [https://www.amahi.org/apps/vnc VNC App] has been discontinued for Amahi 7 or greater. The reason is still under developmentthat it pulls a lot of packages, including desktop and that breaks DNS in Fedora.}}</div><br />__TOC__
__TOC__= 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 [[Amahi_8_Install|Fedora 21 Server DVD]] or [[Amahi_9_Install|Fedora 23 Server DVD]] install method. == Cinnamon (Amahi 8/Fedora 21) == * As root, install Cinnamon Desktop Environment:  yum groupinstall "Cinnamon Desktop" --skip-broken
= Amahi 7 (The reason for '''--skip-broken''' is that Fedora 19) Desktop Installation =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.
For TigerVNC If you wish to work an Desktop Environment must be installed even if the HDA does not boot to Fedora into a graphical mode instead of console, as root use the selected Desktop Environment. So far KDE and Mate Desktop Environments have been tested.following
=== MATE systemctl set-Desktop Environment ===* As root, install MATE-Desktop Environment:default graphical.target
yum groupinstall mate-desktop-extra== LXDE (Amahi 9/Fedora 23) ==
=== KDE-Desktop Environment ===* As root, install KDE-LXDE Desktop Environment:
yum dnf group install @kdelxde-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-serverNote: 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.
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service
*Once install we need to create Open the 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 nano /lib/systemd/system/vncserver@:1.service
*Open 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 new configuration <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 filecalled 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
nano /lib/systemd/system/vncserver@:1.service vncpasswd
*The configuration following response will look like thisappear waiting for a password to be entered
# 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 || Password:' [Install] WantedBy=multi-user.target
*Under [Service] replace with the The following. Please note this is for root access ONLY, see below on how response will appear waiting to setup for other usersverify the password entered.
[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 Verify:
= Setup Desktop Environment Access =
* Modification of the ~/.vnc/xstartup will be required to match run the chosen Desktop-Environment * As root create a backup of . At this point the existing xstartup filedoesn't exist so we do the following.
cd ~/For this example we need to login as the user.vnc mv xstartup xstartup.bak nano xstartup
=== MATE-Desktop Environment ===* As root, remove Create the xstartup file using the context of command below then copy/paste the required xstartup file and replace with for the followingchosen desktop enviroment. nano ~/.vnc/xstartup
#!/bin/sh== Amahi 8 (Fedora 21) == # # Uncomment For the Cinnamon Desktop on Amahi 8 (Fedora 21), modify 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/to the below.Xresources xsetroot -solid grey vncconfig -iconic & x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & mate-session &
* Once file has been modified run the following command #!/bin/sh # exec /usr/bin/cinnamon-session
systemctl daemon-reload== Amahi 9 (Fedora 23) ==For the LXDE Desktop on Amahi 9 (Fedora 23), modify the xstartup to the below.
=== KDE #!/bin/sh # unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS lxterminal & /usr/bin/lxsession -Desktop Environment ===* As root, remove the context of the xstartup file and replace with the following.s LXDE &lxterminal &
#!/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 &= Starting Tiger VNC =
* Once file has been modified Log back in as root and run the following commandthe commands below to enable and start the vncservice.
systemctl daemon-reloadenable vncserver@:1.service systemctl start vncserver@:1.service
= Password Setup TigerVNC Server Commands=* Set the VNC password for the user as defined in the vncserver@:1.service * From the example log into terminal as root and run the following command
vncpasswd* The following commands will allow you to start on boot and start the vncserver service.
* The following response will appear waiting for a password to be entered systemctl enable vncserver@:1.service systemctl start vncserver@:1.service
Password:* The following commands will allow you to disable start on boot and stop the vncserver service.
* The following response will appear waiting to verify the password entered systemctl disable vncserver@:1.service systemctl stop vncserver@:1.service
Verify:* The following command will restart the vncserver service.
= Starting/Stopping TigerVNC Server = systemctl restart vncserver@:1.service
* The following commands command will allow you to autostart and start display the status of the vncserver service.
systemctl enable vncserver@:1.service systemctl start status vncserver@:1.service
* The following commands command will allow you to disable autostart and stop the servicevncserver.
systemctl disable vncserver@:1.service systemctl stop vncserver@:1.service pkill vnc
= 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 & DickHarry.  
* First we need to create these user, either using the Amahi Dashboard under the USER setting or by the following commands under root control.
* For the example the commands will be
adduser tom
adduser dick
adduser harry
* Then create a password for that user using the following command
* For this example the command will be
passwd tom
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.
* Tom Dick will be assigned the following config file using the following.
cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:2.service
* Dick 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 Tom Dick (under root control)
nano /lib/systemd/system/vncserver@:2.service
# 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 dick -c "/usr/bin/vncserver %i" PIDFile=/home/tomdick/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
  * For Dick Harry (under root control)
nano /lib/systemd/system/vncserver@:3.service
# 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 harry -c "/usr/bin/vncserver %i" PIDFile=/home/dickharry/.vnc/%H%i.pid
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 can access the will need make a xstartup file as followed
cd ~/* Log in as each user and run the following command to create the xstartup file.vnc nano xstartup
* For this example we will use the MATE-Desktop Environment, each user will copy the following into their nano ~/.vnc/xstartup file.
#!/bin/sh # # Uncomment * Again modify the following two lines for normal xstartup file as above to use the cinnamon 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/environment.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.
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 tom's Dicks access ip address will be
192.168.1.10:2
* For dick's Harrys the access ip address will be
192.168.1.10:3
 
 
 
= Windows Client Software =
[[File:UltraVNC_Screen1.png]]
If connection is successful it will as ask for a password, which is the password entered from the setup above. = Screenshots = Screenshot of KDE Remote Desktop
[[File:KDE Example.png]]
12,424

edits