Setting Up Horizon 7 for Linux Desktops VMware Horizon 7 Version 7.0 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.
Setting Up Horizon 7 for Linux Desktops You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com Copyright © 2016 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com 2 VMware, Inc.
Contents Setting Up Horizon 7 for Linux Desktops 5 1 Features and System Requirements 7 Features of Horizon 7 Linux Desktops and Desktop Pools 7 Overview of Configuration Steps for Horizon 7 for Linux Desktops System Requirements for Horizon 7 for Linux 8 7 2 Preparing a Linux Virtual Machine for Desktop Deployment 13 Create a Virtual Machine and Install Linux 13 Prepare a Linux Machine for Remote Desktop Deployment Install Dependency Packages for Horizon Agent 16 14 3 Setting Up Active Directory In
Setting Up Horizon 7 for Linux Desktops Sample Script to Join Cloned Virtual Machines to AD Domain Using SSH 61 Sample Script to Install Horizon Agent on Linux Virtual Machines 65 Sample Script to Install Horizon Agent on Linux Virtual Machines Using SSH 70 Sample Script to Upload Configuration Files to Linux Virtual Machines 75 Sample Script to Upload Configuration Files to Linux Virtual Machines Using SSH 79 Sample Script to Upgrade Horizon Agent on Linux Desktop Machines 83 Sample Script to Upgrade Hori
Setting Up Horizon 7 for Linux Desktops The Setting Up Horizon 7 for Linux Desktops document provides information about setting up a Linux virtual ® machine for use as a VMware Horizon 7 desktop, including preparing the Linux guest operating system, installing Horizon Agent on the virtual machine, and configuring the machine in View Administrator for use in a Horizon 7 deployment.
Setting Up Horizon 7 for Linux Desktops 6 VMware, Inc.
Features and System Requirements 1 With Horizon 6 or later, users can connect to remote desktops that run the Linux operating system.
Setting Up Horizon 7 for Linux Desktops 5 Install Horizon Agent on the Linux virtual machine. See “Install Horizon Agent on a Linux Virtual Machine,” on page 41. 6 Create a desktop pool that contains the configured Linux virtual machines. See “Create a Desktop Pool That Contains Linux Virtual Machines,” on page 46.
Chapter 1 Features and System Requirements Table 1‑1. Supported Linux Operating Systems for View Agent (Continued) Linux Distribution Architecture RHEL 6.6 and 7.1 x64 CentOS 6.6 and 7.1 x64 NeoKylin 6 Update 1 x64 SLED 11 SP3/SP4 x64 SLED 12 is supported for installation and connections only. x64 NOTE Linux agent has dependency packages on some Linux distribution. See “Install Dependency Packages for Horizon Agent,” on page 16 for more information.
Setting Up Horizon 7 for Linux Desktops Verify the Linux Account Used by Linux Virtual Machines The following table lists the account name and account type used by Linux virtual machines. Table 1‑4.
Chapter 1 Features and System Requirements Table 1‑5. Recommended vRAM Settings for 2D or vSGA Graphics (Continued) vRAM Size Number of Monitors Maximum Resolution 128 MB 3 2560x1600 128 MB 4 2560x1600 RHEL and CentOS only support this configuration on vSphere 5.5. To support this configuration on Ubuntu, you must recompile the kernel and disable 3D. For information about how to disable 3D, see http://kb.vmware.com/kb/2114809 . For NeoKylin, this configuration is not supported.
Setting Up Horizon 7 for Linux Desktops Also make sure that the virtual machine has adequate shared memory to support multiple monitors. Determine the current maximum shared memory size (shmmax) with the following command: sysctl -a | grep shm If shared memory is small, increase the maximum size with the following command: sysctl -w "kernel.
Preparing a Linux Virtual Machine for Desktop Deployment 2 Setting up a Linux desktop involves creating a Linux virtual machine and preparing the operating system for remote desktop deployment.
Setting Up Horizon 7 for Linux Desktops 2 Configure custom configuration options. a Right-click the virtual machine and click Edit Settings. b Specify the number of vCPUs and the vMemory size. For recommended values, follow the guidelines in the installation guide for your Linux distribution. For example, Ubuntu 12.04 recommends configuring 2048 MB for vMemory and 2 vCPUs. c Select Video card and specify the number of displays and the total video memory (vRAM).
Chapter 2 Preparing a Linux Virtual Machine for Desktop Deployment 4 Uncompress the VMware Tools tar installer file. For example: tar zxpf /mnt/cdrom/VMwareTools-x.x.x-yyyy.tar.gz 5 Run the installer and configure VMware Tools. The command might vary slightly in different Linux distributions. For example: cd vmware-tools-distrib sudo ./vmware-install.pl -d Usually, the vmware-config-tools.pl configuration file runs after the installer file finishes running.
Setting Up Horizon 7 for Linux Desktops Install Dependency Packages for Horizon Agent Horizon Agent for Linux has some dependency packages unique to a Linux distribution. You must install these packages before installing Horizon Agent for Linux. Prerequisites Verify that a new virtual machine (VM) is created in vCenter Server and your Linux distribution is installed on the machine. Procedure 1 Install the mandatory packages that are not installed or upgraded by default.
Chapter 2 Preparing a Linux Virtual Machine for Desktop Deployment 2 Install the optional packages for Horizon Agent. Clipboard Redirection feature depends on libexpat.so.1 and libpng12.so.0. The installer displays a warning message for any missing library file and the installation continues. However, Clipboard Redirection feature will not work. Table 2‑2. Optional Dependency Packages Linux Distribution Packages RHEL or CentOS 6.6 n n RHEL or CentOS 7.
Setting Up Horizon 7 for Linux Desktops 18 VMware, Inc.
Setting Up Active Directory Integration for Linux Desktops 3 View uses the existing Microsoft Active Directory (AD) infrastructure for user authentication and management. You can integrate the Linux desktops with Active Directory so that users can log in to a Linux desktop using their Active Directory user account.
Setting Up Horizon 7 for Linux Desktops Setting Up Single Sign-on and Smart Card Redirection To set up single sign-on (SSO) and smart card redirection, you must perform some configuration steps. Single Sign-on The Horizon View single sign-on module talks to PAM (pluggable authentication modules) in Linux and does not depend on the method that you use to integrate Linux with Active Directory (AD). Horizon View SSO is known to work with the OpenLDAP and Winbind solutions that integrate Linux with AD.
Chapter 3 Setting Up Active Directory Integration for Linux Desktops #./configure --prefix=/usr/ --libdir=/usr/lib64/ --enable-usbdropdir=/usr/lib64/pcsc/drivers --enable-confdir=/etc --enable-ipcdir=/var/run --disable-libusb --disable-serial --disable-usb --disable-libudev #service pcscd start When you install the Horizon Agent, you must first disable SELinux or enable permissive mode for SELinux.
Setting Up Horizon 7 for Linux Desktops 22 VMware, Inc.
Configuration Options for Linux Desktops 4 You can configure various options to customize the user experience using configuration files. This chapter includes the following topics: n “Setting Options in Configuration Files on a Linux Desktop,” on page 23 n “Suppress the vSphere Console Display of a Linux Desktop,” on page 25 Setting Options in Configuration Files on a Linux Desktop You can configure certain options by adding entries to the files /etc/vmware/config or /etc/vmware/viewagent-custom.conf.
Setting Up Horizon 7 for Linux Desktops Table 4‑1. Configuration Options in /etc/vmware/config (Continued) Option Value Default Description VVC.ScRedir.Enable TRUE or FALSE TRUE Set this option to disable smart card redirection. VVC.logLevel FATAL, ERROR, WARN, INFO, DEBUG, or TRACE INFO Use this option to set the log level of the VVC proxy node. Clipboard.Direction 0, 1, 2, or 3 2 This option determines the clipboard redirection policy. 0 - Disable clipboard redirection.
Chapter 4 Configuration Options for Linux Desktops Table 4‑2. Configuration Options in /etc/vmware/viewagent-custom.conf (Continued) Option Value Default Description SSLCipherServerPr eference TRUE or FALSE TRUE Use this option to enable or disable the option SSL_OP_CIPHER_SERVER_PREFERENCE. For more information, see https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_opti ons.html.
Setting Up Horizon 7 for Linux Desktops 26 VMware, Inc.
Setting Up Graphics for Linux Desktops 5 You can configure RHEL 6.6 and 7.1 to take advantage of NVIDIA capabilities on ESXi host or on a guest operating system. VM Clone Requirements for Setting Up 3D Graphics You must consider the following requirements for VM Clone before setting up 3D graphics. n For vGPU and vSGA, complete the graphic setup in the base VM. Clone the VMs. The graphic settings work for cloned VMs and no further settings are required.
Setting Up Horizon 7 for Linux Desktops For an vSGA configuration, NVIDIA provides a VMware vSphere ESXi Driver for vSGA. For vSGA, an NVIDIA display driver is not installed on the Linux virtual machine. Prerequisites n Verify that vSphere 6.0 U1 or a later release is installed in your environment. n Verify that NVIDIA driver 346.69 or 346.42 is installed in your environment. n For an NVIDIA GRID vGPU configuration, verify that the NVIDIA Maxwell M60 GPUs are installed on the ESXi host.
Chapter 5 Setting Up Graphics for Linux Desktops 8 Reboot or update the ESXi host. 3D Type Description NVIDIA GRID vGPU For an installed ESXi host, reboot the host. For a stateless ESXI host, take the following steps to update the host. (These steps also work on an installed host.) Update vmkdevmgr: # kill -HUP $(cat /var/run/vmware/vmkdevmgr.pid) Wait for the update to complete: # localcli --plugin-dir /usr/lib/vmware/esxcli/int deviceInternal bind This is a new requirement with the NVIDIA 352.
Setting Up Horizon 7 for Linux Desktops NVIDIA Virtual GPU Types With the GPU Profiles setting on the Virtual Hardware page in vSphere Web Client, you can select a virtual GPU type that provides specific capabilities on the physical NVIDIA GPU on the ESXi host. On Linux virtual machines, NVIDIA GRID vGPU is supported on NVIDIA Maxwell M60 GPUs. Table 5‑1.
Chapter 5 Setting Up Graphics for Linux Desktops c Edit the blacklist.conf file. sudo vi /etc/modprobe.d/blacklist.conf d Add the following line anywhere in the blacklist.conf file. blacklist nouveau 2 Restart the virtual machine. The display has a changed look and feel. 3 (Optional) Verify that the Nouveau driver is disabled. /sbin/lsmod | grep nouveau If the grep search does not return any results, the Nouveau driver is disabled.
Setting Up Horizon 7 for Linux Desktops What to do next Install Horizon Agent on the Linux virtual machine. See “Install Horizon Agent on a Linux Virtual Machine,” on page 41. Create a desktop pool that contains the configured Linux virtual machines. See “Create a Desktop Pool That Contains Linux Virtual Machines,” on page 46. Verify That the NVIDIA Display Driver Is Installed You can verify that the NVIDIA display driver is installed on a RHEL 6.6.
Chapter 5 Setting Up Graphics for Linux Desktops Configure RHEL 6.6 for vDGA You can set up an RHEL 6.6 guest operating system so that Horizon 7 for Linux desktop can take advantage of vDGA capabilities on the ESXi host. CAUTION Before you begin, verify that Horizon Agent is not installed on the Linux virtual machine. If you install Horizon Agent before you configure the machine to use vDGA, required configuration parameters in the xorg.conf file are overwritten, and vDGA does not work.
Setting Up Horizon 7 for Linux Desktops Procedure 1 Power off the virtual machine. and log in to the RHEL 6.6 guest operating system as a local user configured with sudo rights. 2 In vSphere Web Client, select the virtual machine and, under the VM Hardware tab, click Edit Settings. 3 In the New device menu, select PCI Device. 4 Click Add and select the PCI device from the drop-down menu. 5 Click Reserve all memory and click OK.
Chapter 5 Setting Up Graphics for Linux Desktops 2 Restart the virtual machine. The display has a changed look and feel. 3 (Optional) Verify that the Nouveau driver is disabled. /sbin/lsmod | grep nouveau If the grep search does not return any results, the Nouveau driver is disabled. 4 Copy or download the NVIDIA display driver to the virtual machine. a For an NVIDIA GRID vGPU configuration, copy the NVIDIA Linux Display Driver to the virtual machine.
Setting Up Horizon 7 for Linux Desktops Verify That the NVIDIA Display Driver Is Installed You can verify that the NVIDIA display driver is installed on a RHEL 6.6. virtual machine by displaying the NVIDIA driver output in a View desktop session. Prerequisites n Check that you installed the NVIDIA display driver. n Verify that Horizon Agent is installed on the Linux virtual machine. See “Install Horizon Agent on a Linux Virtual Machine,” on page 41.
Chapter 5 Setting Up Graphics for Linux Desktops For an vSGA configuration, NVIDIA provides a VMware vSphere ESXi Driver for vSGA. For vSGA, an NVIDIA display driver is not installed on the Linux virtual machine. Prerequisites n Verify that vSphere 6.0 U1 or a later release is installed in your environment. n Verify that NVIDIA driver 346.69 or 346.42 is installed in your environment. n For an NVIDIA GRID vGPU configuration, verify that the NVIDIA Maxwell M60 GPUs are installed on the ESXi host.
Setting Up Horizon 7 for Linux Desktops 8 Reboot or update the ESXi host. 3D Type Description NVIDIA GRID vGPU For an installed ESXi host, reboot the host. For a stateless ESXI host, take the following steps to update the host. (These steps also work on an installed host.) Update vmkdevmgr: # kill -HUP $(cat /var/run/vmware/vmkdevmgr.pid) Wait for the update to complete: # localcli --plugin-dir /usr/lib/vmware/esxcli/int deviceInternal bind This is a new requirement with the NVIDIA 352.
Chapter 5 Setting Up Graphics for Linux Desktops Next, install Horizon Agent on the Linux virtual machine. See “Install Horizon Agent on a Linux Virtual Machine,” on page 41. Verify that vSGA is Running on a Linux Virtual Machine You can verify that vSGA is running on a RHEL 7.1 virtual machine by checking the virtual machine log file and checking the guest operating system. Procedure 1 Open the vmware.log file for the virtual machine.
Setting Up Horizon 7 for Linux Desktops 40 VMware, Inc.
Installing Horizon Agent and Managing Linux Desktops 6 You must install Horizon Agent on the Linux desktops so that View Connection Server can communicate with and manage the desktops.
Setting Up Horizon 7 for Linux Desktops n Kerberos. To use this mechanism, you must specify the Active Directory server's address using the -k command line option. Also, for the required parameter -b, you must provide Connection Server's fully qualified domain name (FQDN) using the real host name and domain name. You cannot use an IP address or a mapped FQDN.
Chapter 6 Installing Horizon Agent and Managing Linux Desktops If you do not type the -p parameter with the command, you are prompted to provide the password after you enter the command. When you type the password at the prompt, the text is hidden. By default, the hostname of the Linux machine is used to register the machine. You can specify a different machine name with the -n parameter. 5 Type Yes to accept the EULA if you run install_viewagent.sh without specifying the -A option.
Setting Up Horizon 7 for Linux Desktops Table 6‑2. install_viewagent.sh Password Parameter Optional Parameter (Required Information) Description -p Password for the View Connection Server administrator. You do not have to type the -p parameter at the command line if you do not want to expose the password in text. If you type the install_viewagent.sh command without the -p parameter, you are prompted to enter the password. When you type the password at the prompt, the text is hidden.
Chapter 6 Installing Horizon Agent and Managing Linux Desktops Table 6‑4. Examples of install_viewagent.sh Parameters Condition Examples Broker host and Broker admin are from same domain n Digest-MD5. n sudo install_viewagent.sh -A yes -n mymachine -b mybroker.mydomain.com -d mydomain.com -u myadmin -p Pa\$ssword Kerberos. sudo install_viewagent.sh -A yes -n mymachine -b mybroker.mydomain.com -d mydomain.com -u myadmin -p Pa\$ssword -k mydomain-host.mydomain.
Setting Up Horizon 7 for Linux Desktops 2 Install the root and intermediate Certificate Authority into the Linux OS Certificate Authority store. NOTE Check your Linux distribution documentation for the Linux system settings change. Create a Desktop Pool That Contains Linux Virtual Machines To configure Linux virtual machines for use as remote desktops, you create a manual desktop pool and add the Linux machines to the pool. When you create the desktop pool, add only Linux virtual machines to the pool.
Chapter 6 Installing Horizon Agent and Managing Linux Desktops Upgrade Horizon Agent on a Linux Virtual Machine You can upgrade Horizon Agent on a Linux machine by installing the latest version of Horizon Agent.. Most of the install parameters that were specified in the previous install will be remembered. You can optionally specify the following parameters: Parameter Description -A yes EULA acceptance. You must specify yes for the install to proceed.
Setting Up Horizon 7 for Linux Desktops 3 Select the Inventory tab. 4 Select the unmanaged machines to remove. 5 Click Remove. 6 If users are logged in to the unmanaged machine-based desktops, choose whether to terminate the sessions or let the sessions remain active. 7 Option Description Leave active Active sessions remain until the user logs off. View Connection Server does not keep track of these sessions. Terminate Active sessions end immediately. Click OK.
Chapter 6 Installing Horizon Agent and Managing Linux Desktops Procedure 1 Open a terminal window on the virtual machine and run the Horizon Agent uninstall script. For example: sudo /usr/lib/vmware/viewagent/bin/uninstall_viewagent.sh The script stops Horizon Agent processes, deletes the Horizon Agent service, and deletes the Horizon Agent installation directory, /usr/lib/vmware/viewagent. 2 Manually delete the Horizon 7 for Linux configuration files, located in the /etc/vmware/ directory.
Setting Up Horizon 7 for Linux Desktops How to Perform Power Operations on Linux Desktops from vSphere Occasionally, it might be necessary to perform power operations on Linux desktops from vSphere. Do not use the operations Power Off or Reset because they might cause a loss of data or Horizon Agent might not restart properly. Instead, use the operations Shut Down Guest or Restart Guest.
Bulk Deployment of Horizon 7 for Linux Desktops 7 With View Administrator, you can create a pool of Windows, but not Linux, desktop machines automatically. However, you can develop scripts that automate the deployment of a pool of Linux desktop machines. The sample scripts that are provided are for illustration purposes only. VMware does not accept any responsibility for issues that might arise when you use the sample scripts.
Setting Up Horizon 7 for Linux Desktops PowerCLI SSH No need to install additional tools. n For Ubuntu, you need to install the SSH server with the command sudo apt-get install openssh-server. For RHEL and CentOS, openssh-server is installed by default but you need to ensure that the firewall settings allow ssh. n Need to download the SSH client applications pscp.exe and plink.exe and put them in the same folder as the PowerCLI scripts. Uploading files and command execution are slower.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops See “Sample Script to Install Horizon Agent on Linux Virtual Machines,” on page 65 or “Sample Script to Install Horizon Agent on Linux Virtual Machines Using SSH,” on page 70. 6 Update configuration options in virtual machines. See “Sample Script to Upload Configuration Files to Linux Virtual Machines,” on page 75 or “Sample Script to Upload Configuration Files to Linux Virtual Machines Using SSH,” on page 79. 7 Create a desktop pool.
Setting Up Horizon 7 for Linux Desktops 2 Configure custom configuration options. a Right-click the virtual machine and click Edit Settings. b Specify the number of vCPUs and the vMemory size. For recommended values, follow the guidelines in the installation guide for your Linux distribution. For example, Ubuntu 12.04 recommends configuring 2048 MB for vMemory and 2 vCPUs. c Select Video card and specify the number of displays and the total video memory (vRAM).
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops n ESXi server that hosts the desktop machine n Parent virtual machine's snapshot that is used for cloning n Flag that indicates whether to delete the desktop virtual machine if it exists The following example shows what the input file may contain. VMName,Parentvm,CustomSpec,Datastore,Host,FromSnapshot,DeleteIfPresent linux-001,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE linux-002,Ubuntu1204x64,linuxagent,datastore1,10.117.
Setting Up Horizon 7 for Linux Desktops gToBSTR($input)) } else { $input = Read-Host } [Console]::ResetColor() return $input } function IsVMExists () { Param($VMExists) Write-Host "Checking if the VM $VMExists already Exists" [bool]$Exists = $false #Get all VMS and check if the VMs is already present in VC $listvm = Get-vm foreach ($lvm in $listvm) { if($VMExists -eq $lvm.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops $disableVMConsole = GetInput -prompt 'Disable vSphere VM Console ("yes" or "no", recommend "yes")' -IsPassword $false "-----------------------------------------------------" $csvFile = '.\CloneVMs.csv' # Check that user passed only linked or full clone if (($CloneType.
Setting Up Horizon 7 for Linux Desktops $srcSnapshot = $line.FromSnapshot $deleteExisting = $line.DeleteIfPresent if (IsVMExists ($destVMName)) { Write-Host "VM $destVMName Already Exists in VC $vcAddress" if($deleteExisting -eq "TRUE") { Delete_VM ($destVMName) } else { Write-Host "Skip clone for $destVMName" continue } } $vm = get-vm $srcvm -ErrorAction Stop | get-view -ErrorAction Stop $cloneSpec = new-object VMware.VIM.VirtualMachineCloneSpec $cloneSpec.Location = new-object VMware.VIM.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops Script Execution The following messages are from an execution of the script: PowerCLI C:\scripts> .\CloneVMs.ps1 Your vCenter address: 10.117.44.
Setting Up Horizon 7 for Linux Desktops #> #------------------------- Functions ------------------------function GetInput { Param($prompt, $IsPassword = $false) $prompt = $prompt + ": " Write-Host $prompt -NoNewLine [Console]::ForegroundColor = "Blue" if ($IsPassword) { $input = Read-Host -AsSecureString $input = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops else { Write-Host 'vCenter is connected' } #Read input CSV file $csvData = Import-CSV $csvFile $destFolder = "/home/$guestUser/" #Handle VMs one by one foreach ($line in $csvData) { "`n-----------------------------------------------------" $VMName = $line.
Setting Up Horizon 7 for Linux Desktops To copy and paste the script content without page breaks, use the HTML version of this topic, available from the Horizon 7 documentation page at https://www.vmware.com/support/pubs/view_pubs.html. Script Input This script reads one input file, which is described in “Input File for the Sample PowerCLI Scripts to Deploy Linux Desktops,” on page 54.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops if ($IsPlink) { if (Test-Path { write-host } else { write-host from its official web exit } } if ($IsPSCP) { if (Test-Path { write-host } else { write-host from its official web exit } } } ".\plink.exe") -ForeGroundColor Yellow 'SSH client "plink.exe" found' -ForeGroundColor Red 'SSH client "plink.exe" not found, please download site' ".\pscp.exe") -ForeGroundColor Yellow 'SSH client "pscp.exe" found' -ForeGroundColor Red 'SSH client "pscp.
Setting Up Horizon 7 for Linux Desktops write-host "Upload file: $command" Invoke-Expression $command } #------------------------- Handle input ------------------------"-----------------------------------------------------" Check_SSH_Client -IsPlink $true -IsPSCP $false "-----------------------------------------------------" $vcAddress = GetInput -prompt "Your vCenter address" -IsPassword $false $vcAdmin = GetInput -prompt "Your vCenter admin user name" -IsPassword $false $vcPassword = GetInput -prompt "Yo
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops RunCmdViaSSH -VM_Name $VMName -User $guestUser -Password $guestPassword -Cmd $cmd } Disconnect-VIServer $vcAddress -Confirm:$false exit Script Execution The following messages are from an execution of the script: PowerCLI C:\scripts> .\ClonedVMs_JoinDomain_SSH.ps1 -------------------------------------------------Your vCenter address: 10.117.44.
Setting Up Horizon 7 for Linux Desktops n IP address of View Connection Server n Administrator login name for View Connection Server n Administrator password for View Connection Server n Domain name of the View Connection Server administrator n The AD server's address if Kerberos is the authentication method for Horizon Agent to register the Linux machine with View Connection Server.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops "-----------------------------------------------------" $guestUser = GetInput -prompt 'Your VM guest OS user name' -IsPassword $false $guestPassword = GetInput -prompt 'Your VM guest OS user password' -IsPassword $true "-----------------------------------------------------" $agentInstaller = GetInput -prompt 'Type the Horizon Agent tar ball path.
Setting Up Horizon 7 for Linux Desktops $installerMD5Hash = GetSourceInstallerMD5; #Connect to vCenter $VC_Conn_State = Connect-VIServer $vcAddress -user $vcAdmin -password $vcPassword if([string]::IsNullOrEmpty($VC_Conn_State)) { Write-Host 'Exit since failed to login vCenter' exit } else { Write-Host 'vCenter is connected' } #Read input CSV file $csvData = Import-CSV $csvFile $destFolder = "/home/$guestUser/" #Handle VMs one by one foreach ($line in $csvData) { "`n----------------------------------------
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops Write-Host "Set the selinux to permissive mode: $cmd" Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser $guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText $cmd #Run the installation command. $cmd = "cd VMware-viewagent-linux-* && sudo ./install_viewagent.
Setting Up Horizon 7 for Linux Desktops Your broker admin password: ******* Type the View Connection Server Admin user domain name: domain1 Install the Smartcard redirection feature ("yes" or "no"): no AD address for Kerberos authentication to register. Please type Enter to skip for MD5 Digest: 10.117.45.1 After the script completes, you can log in to View Administrator and view the Linux desktop machines by navigating to View Configuration > Registered Machines and clicking the Others tab.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops $prompt = $prompt + ": " Write-Host $prompt -NoNewLine [Console]::ForegroundColor = "Blue" if ($IsPassword) { $input = Read-Host -AsSecureString $input = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin gToBSTR($input)) } else { $input = Read-Host } [Console]::ResetColor() return $input } function Check_SSH_Client { Param($IsPlink, $IsPSCP) if ($IsPlink) { if (Test-Path ".\plink.
Setting Up Horizon 7 for Linux Desktops write-host "Run cmd on $VM_Name ($IP)" if($returnOutput) { $command = "echo yes | .\plink.exe -ssh -l $user -pw $password $IP " + '"' + $cmd +'"' $output = Invoke-Expression $command return $output } else { echo yes | .\plink.exe -ssh -l $user -pw $password $IP "$cmd" } } function UploadFileViaSSH { Param($VM_Name, $User, $Password, $LocalPath, $DestPath) $VM= Get-VM $VM_Name $IP = $VM.guest.IPAddress[0] $command = "echo yes | .\pscp.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops $domainName = GetInput -prompt 'Type the View Connection Server Admin user domain name' IsPassword $false $installSmartcard = GetInput -prompt 'Install the Smartcard redirection feature ("yes" or "no")' -IsPassword $false if (($installSmartcard -ne "yes") -AND $installSmartcard -ne "no") { write-host -ForeGroundColor Red "You need select 'yes' or 'no'(case sensitive)" exit } $kdc = GetInput -prompt 'AD address for Kerberos authentication to register
Setting Up Horizon 7 for Linux Desktops } #Read input CSV file $csvData = Import-CSV $csvFile $destFolder = "/home/$guestUser/" #Handle VMs one by one foreach ($line in $csvData) { "`n-----------------------------------------------------" $VMName = $line.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops installation, and you may hit the ssh connection closed error message, which is expectation" } else { Write-Host $VMName": Uploaded installer's MD5Sum does NOT match the local installer's MD5Sum"; Write-Host $VMName": Skip the installation. Please check your network and VMware Tools status"; exit; } } Disconnect-VIServer $vcAddress -Confirm:$false exit Script Execution The following messages are from an execution of the script: PowerCLI C:\scripts>
Setting Up Horizon 7 for Linux Desktops Script Input This script reads one input file, which is described in “Input File for the Sample PowerCLI Scripts to Deploy Linux Desktops,” on page 54.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops $guestUser = GetInput -prompt 'Your VM guest OS user name' -IsPassword $false $guestPassword = GetInput -prompt 'Your VM guest OS user password' -IsPassword $true "-----------------------------------------------------" $csvFile = '.\CloneVMs.csv' $setConfig = $false $setCustomConf = $false $config_File = "config" $customConf_File = "viewagent-custom.
Setting Up Horizon 7 for Linux Desktops #Handle VMs one by one foreach ($line in $csvData) { "`n-----------------------------------------------------" $VMName = $line.VMName write-host -ForeGroundColor Yellow "VM: $VMName`n" #Try to delete the configuration file from home folder on destination VM $cmd = "rm -rf config viewagent-custom.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops Your ESXi host admin user password: ******* -------------------------------------------------Your VM guest OS user name: ViewUser Your VM guest OS user password: ******* Sample Script to Upload Configuration Files to Linux Virtual Machines Using SSH You can customize and use the following sample script to upload the configuration files config and viewagent-custom.conf to multiple Linux virtual machines (VMs).
Setting Up Horizon 7 for Linux Desktops { Param($IsPlink, $IsPSCP) if ($IsPlink) { if (Test-Path ".\plink.exe") { write-host -ForeGroundColor } else { write-host -ForeGroundColor from its official web site' exit } } if ($IsPSCP) { if (Test-Path ".\pscp.exe") { write-host -ForeGroundColor } else { write-host -ForeGroundColor from its official web site' exit } } } Yellow 'SSH client "plink.exe" found' Red 'SSH client "plink.exe" not found, please download Yellow 'SSH client "pscp.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops $IP = $VM.guest.IPAddress[0] $command = "echo yes | .\pscp.
Setting Up Horizon 7 for Linux Desktops if([string]::IsNullOrEmpty($VC_Conn_State)) { Write-Host 'Exit since failed to login vCenter' exit } else { Write-Host 'vCenter is connected' } #Read input CSV file $csvData = Import-CSV $csvFile $destFolder = "/home/$guestUser/" #Handle VMs one by one foreach ($line in $csvData) { "`n-----------------------------------------------------" $VMName = $line.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops Script Execution The following messages are from an execution of the script: PowerCLI C:\scripts> .\UpdateOptionFile.ps1 -------------------------------------------------Please ensure your config file and view-agent.conf file are in current working directory. Your vCenter address: 10.117.44.
Setting Up Horizon 7 for Linux Desktops $prompt = $prompt + ": " Write-Host $prompt -NoNewLine [Console]::ForegroundColor = "Blue" if ($IsPassword) { $input = Read-Host -AsSecureString $input = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops { write-host exit } -ForeGroundColor Red "installer File not found" #check if file exists if (!(Test-Path $csvFile)) { write-host -ForeGroundColor Red "CSV File not found" exit } #------------------------- Functions ------------------------function GetSourceInstallerMD5() { $agentInstallerPath = Convert-Path $agentInstaller; $md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider; $md5HashWithFormat = [System.
Setting Up Horizon 7 for Linux Desktops $guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText $cmd #Upload installer tar ball to Linux VM Write-Host "Upload File '$agentInstaller' to '$destFolder' of VM '$VMName' with user '$guestUser'" Copy-VMGuestFile -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser $guestUser -GuestPassword $guestPassword -Confirm:$false -LocalToGuest -Destination $destFolder Source $agentInstaller #Check the uploaded installer md5s
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops } } Disconnect-VIServer $vcAddress -Confirm:$false exit Script Execution The following messages are from an execution of the script: PowerCLI C:\scripts> .\InstallAgent.ps1 -------------------------------------------------Accept Linux Horizon Agent EULA in tar bundle ("yes" or "no"): yes Your vCenter address: 10.117.44.
Setting Up Horizon 7 for Linux Desktops Script Content <# Upload the Linux Agent installer tar ball using SSH and re-install #> #----------------------------------------------------Functions-----------------------------------------------------------------function GetInput { Param($prompt, $IsPassword = $false) $prompt = $prompt + ": " Write-Host $prompt -NoNewLine [Console]::ForegroundColor = "Blue" if ($IsPassword) { $input = Read-Host -AsSecureString $input = [Runtime.InteropServices.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops from its official web site' exit } } } function RunCmdViaSSH { Param($VM_Name, $User, $Password, $Cmd, $returnOutput = $false) $VM= Get-VM $VM_Name $IP = $VM.guest.IPAddress[0] write-host "Run cmd on $VM_Name ($IP)" if($returnOutput) { $command = "echo yes | .\plink.exe -ssh -l $user -pw $password $IP " + '"' + $cmd +'"' $output = Invoke-Expression $command return $output } else { echo yes | .\plink.
Setting Up Horizon 7 for Linux Desktops $agentInstaller = GetInput -prompt 'Type the Horizon Agent tar ball path.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops Write-Host 'vCenter is connected' } #Read input CSV file $csvData = Import-CSV $csvFile $destFolder = "/home/$guestUser/" #Handle VMs one by one foreach ($line in $csvData) { "`n-----------------------------------------------------" $VMName = $line.
Setting Up Horizon 7 for Linux Desktops upgrade, and you may hit the ssh connection closed error message, which is expectation" } else { Write-Host $VMName": Uploaded installer's MD5Sum does NOT match the local installer's MD5Sum"; Write-Host $VMName": Skip the installation. Please check your network and VMware Tools status"; exit; } } Disconnect-VIServer $vcAddress -Confirm:$false exit Script Execution The following messages are from an execution of the script: PowerCLI C:\scripts> .\InstallAgent.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops n The wait time, in seconds, between operations on the VMs. Script Content <# .DESCRIPTION The Tool supports: 1. Power off VMs 2. Power on VMs 3. Shutdown VMs 4. Restart VMs 5. Restart VM guest 6. Delete VMs from Disk .
Setting Up Horizon 7 for Linux Desktops return $Exists } function Delete_VM($VMToDelete) { Write-Host "Deleting VM $VMToDelete" Get-VM $VMToDelete | where { $_.
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops #check if file exists if (!(Test-Path $csvFile)) { write-host -ForeGroundColor Red "CSV File not found" exit } "-----------------------------------------------------" #--------------------- Main -------------------------#Read input CSV file Disconnect-VIServer $vcAddress -Confirm:$false #Connect-VIServer $vcAddress -ErrorAction Stop -user $vcAdmin -password $vcPassword Connect-VIServer $vcAddress -user $vcAdmin -password $vcPassword $csvData = Impor
Setting Up Horizon 7 for Linux Desktops Script Execution The following messages are from an execution of the script: PowerCLI C:\scripts> .\VMOperations.ps1 Your vCenter address: 10.117.44.17 Your vCenter admin user name: administrator Your vCenter admin user password: ******* -------------------------------------------------Select action: 1). Power On 2). Power Off 3) Shutdown VM Guest 4). Restart VM 5). Restart VM Guest 6).
Chapter 7 Bulk Deployment of Horizon 7 for Linux Desktops if (!(Test-Path $csvFile)) { write-host -ForeGroundColor Red "CSV File $CSVFile not found" exit } function IsNameInCsv($name) { $csvData = Import-CSV $csvFile; foreach ($line in $csvData) { if($line.MachineName -eq $name) { Write-Host "$name exists in csv" return $true; } } Write-Host "$name does not exists in csv" return $false; } $obj = [adsi]'LDAP://localhost:389/OU=Servers,DC=vdi,DC=vmware,DC=int'; foreach ($child in $obj.psbase.
Setting Up Horizon 7 for Linux Desktops 98 VMware, Inc.
Troubleshooting Linux Desktops 8 Certain issues might arise when you manage Linux desktops. You can follow various procedures to diagnose and fix problems.
Setting Up Horizon 7 for Linux Desktops Cause The Horizon Agent installer might fail to register a Linux machine with View Connection Server for the following reasons: n The View Connection Server FQDN, domain name, user name, or password that was provided during Horizon Agent installation was incorrect. n The View administrator user does not have the Agent Registration Administrators or Administrators role in View Administrator.
Chapter 8 Troubleshooting Linux Desktops After installation, Horizon Agent stores a list of FQDNs of the View Connection Server instances in the /etc/vmware/viewagent-machine.cfg configuration file. Horizon Agent uses FQDNs even if you specify an IP address of a View Connection Server instance with the -b parameter during the Horizon Agent installation. A second cause might be that the hostname of the Linux machine itself cannot be resolved.
Setting Up Horizon 7 for Linux Desktops Troubleshooting Horizon Agent on a Linux Machine That Is Not Responding Horizon Agent that is installed on a Linux virtual machine is not responding. Problem The Horizon 7 for Linux desktop is not accessible, and Horizon Agent is not responding. Cause The Horizon Agent service might not be running, or the X session might not be active on the Linux machine. Solution 1 On the Linux virtual machine, open a terminal window and stop and restart the Horizon Agent service.
Index A I Active Directory, integrating with Linux 19 install_viewagent.
Setting Up Horizon 7 for Linux Desktops R registered machines removing 48 removing from View 48 removing registered machines 48 reversible password encryption 45 RHEL configuring for vDGA 33 configuring for vGPU 27 configuring for vSGA 36 S sample script bulk delete desktop machines 96 clone desktop machines using SSH 61 install Horizon Agent using SSH 65 perform operations on VMs 92 to clone desktop machines 55, 59 to install Horizon Agent 70 to upgrade Horizon Agent 83 upgrade Horizon Agent using SSH 87