Horizon View – How to install the Linux Desktop agent.

In the previous post we looked at joining the Linux desktop to an Active Directory domain. While its not necessary for Linux desktop to be domain members I feel it should be done if a domain is available.

As before we’ll be focusing on two business ready distro’s; Centos 7.X (RHEL) and Ubuntu 18.04 (LTS). We’ll get the correct dependencies setup, and the agents installed.

To begin I have deployed CentOS 7, with a GUI (Gnome) and Ubuntu 18.04 LTS. VM’s. Both VM’s are fully patched and running the latest available official kernels as of 16/11/18. A local user has been created during install time called viewuser01. The VM’s are called centosdt-01 and ubuntudt-01 respectively. Static IP’s have been assigned. Ubuntu is running the GNOME desktop and CentOS is running KDE.

In addition I would recommend you go and take a look at this page System Requirements For Horizon 7 for Linux.

[EDIT 26/01/19]: Depending how your VM is installed you might get an error when trying to install the agent stating that the hostname is resolvable.  This is common if you are setting up a template to be referenced by an automated desktop pool and the hostname of the desktop pool isn’t in DNS. The fix is to add the hostname to the /etc/hosts file next to the entry 127.0.0.1.

Ubuntu:

Only certain desktop environments are supported in Ubuntu and unity is not one of them. VMware have written a kb detailing how to change the desktop in Ubuntu:  KB2151294.  Since I’m using 18.04 LTS its not an issue as the default desktop is Gnome.

  1. Open a terminal and run the following to update and install dependencies. Note that you’ll be asked to choose a display manager, choose lightdm:
  2.  sudo apt-get update
    sudo apt-get -y upgrade
    sudo apt-get -y install open-vm-tools python python-dbus python-gobject lightdm 
  3. Reboot (might not be strictly necessary but if there is a kernel update its a good idea)
  4. Download or copy across the VMware Linux agent. (Currently VMware-horizonagent-linux-x86_64-7.6.0-9857537.tar.gz)
  5. Open a terminal and locate the downloaded agent. Usually in /home/<user>/Downloads/
  6. Unpack the file.
  7.  tar zxvf VMware-horizonagent-linux-x86_64-7.6.0-9857537.tar.gz 
  8. Change into the unpacked directory
  9.  cd VMware-horizonagent-linux-x86_64-7.6.0-9857537 
  10. Run the installer, type y to accept the EULA
  11.  sudo sh ./install_viewagent.sh 
  12. Reboot your VM
  13.  sudo reboot 

Ubuntu is configured and ready to go.

CentOS:

It’s usually easier to get dependancies resolved in CentOS and CentOS is “aware” its running as a VM and will usually have the open VMtools installed.

  1. Open a terminal, switch to root and run the following to update and install dependencies, and fix the networking.
     yum -y update&amp;amp;amp;amp;lt;/li&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;li&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;pre&amp;amp;amp;amp;gt;yum -y install glibc
    virsh net-destroy default
    virsh net-undefine default
    service libvirtd restart
    
  2. Reboot (might not be strictly necessary but if there is a kernel update its a good idea),
  3. Download or copy across the VMware Linux agent. (Currently VMware-horizonagent-linux-x86_64-7.6.0-9857537.tar.gz)
  4. Open a terminal and locate the downloaded agent. Usually in /home/<user>/Downloads/.
  5. Unpack the file.
     tar zxvf VMware-horizonagent-linux-x86_64-7.6.0-9857537.tar.gz 
  6. Change into the unpacked directory
     cd VMware-horizonagent-linux-x86_64-7.6.0-9857537 
  7. Run the installer, type y to accept the EULA
     sh ./install_viewagent.sh 
  8. Add a Firewall rule so that the agent can talk to the Connection server
     firewall-cmd --add-port=4001/tcp --permanent
  9. Reboot your VM
  10. reboot 

CentOS is configured and ready to go.

Linux Desktop – How to Join an Active Directory Domain (general)

Not just for horizon view but since this is part of a series….

Getting Linux desktops to join an active directory domain is now fairly simple, it used to be quite painful and often a bit hit and miss.

Prep work

  • I’ve create a top level OU called Horizon and a nested OU called Virtual_Desktops.
  • A service account has been created called domainjoin, that has the following permissions to the relevant OU
    • Read All Properties
    • Write All Properties
    • Read Permissions
    • Reset Password
    • Create Computer Objects
    • Delete Computer Objects

Here’s the procedure for Centos (RedHat too) and Ubuntu.

Ubuntu 18.04 LTS

  1. Open a terminal and run the following to get the required dependencies. Note that during the krb5-user install your be asked for the domain name. Fill it in in CAPITAL letters.
  2. sudo apt-get update sudo apt-get upgrade sudo apt-get install realmd sssd sssd-tools oddjob oddjob-mkhomedir adcli samba-common krb5-user
  3. Run the pam-auth-update command and select Create Home Directory on Login
  4. The next set of commands creates a computer account in the following Virtual_Desktops OU, nested under Horizon and joins the desktop to the domain.
  5. sudo echo [domainjoin_password] |sudo realm join --computer-ou="ou=Virtual_Desktops,ou=Horizon,dc=port115,dc=com" --user=domainjoin port115.com
  6. Since there is no confirmation you’ve joined the domain correctly run the following command realm list. You’ll get an output stating things like the domain name. If the desktop didn’t join successfully, there’ll be no output.
  7. You should now be able to login using DOMAIN\user

CentOS 7.X

  1. Open a terminal and run the following as root to get the required dependencies. Note that during the krb5-user install your be asked for the domain name. Fill it in in CAPITAL letters.
  2. yum -y update yum -y install realmd sssd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools ntpdate ntp libvirt-client virsh net-destroy default # This might not be nessesary, depending on your base install virsh net-undefine default # This might not be nessesary, depending on your base install service libvirtd restart # This might not be nessesary, depending on your base install systemctl enable ntpd.service ntpdate 0.uk.pool.ntp.org systemctl start ntpd.service 
  3. The next set of commands creates a computer account in the following Virtual_Desktops OU, nested under Horizon and joins the desktop to the domain.
  4.  echo [domainjoin_password] | realm join --computer-ou="ou=Virtual_Desktops,ou=Horizon,dc=port115,dc=com" --user=domainjoin port115.com exit
  5. Since there is no confirmation you’ve joined the domain correctly run the following command realm list. You’ll get an output stating things like the domain name. If the desktop didn’t join successfully, there’ll be no output.
  6. You should now be able to login using DOMAIN\user