Setting Up Horizon 6 for Linux Desktops Horizon 6 Version 6.2.1 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 6 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 © 2015 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 6 for Linux Desktops 5 1 Features and System Requirements 7 Features of Horizon 6 Linux Desktops and Desktop Pools 7 Overview of Configuration Steps for Horizon 6 for Linux Desktops System Requirements for Horizon 6 for Linux 9 8 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 14 3 Setting Up Active Directory Integration for Linux Desktops 17 Integrating Linux
Setting Up Horizon 6 for Linux Desktops Sample Script to Install View Agent on Linux Virtual Machines Using SSH 68 Sample Script to Upload Configuration Files to Linux Virtual Machines 73 Sample Script to Upload Configuration Files to Linux Virtual Machines Using SSH 77 Sample Script to Upgrade View Agent on Linux Desktop Machines 81 Sample Script to Upgrade View Agent on Linux Virtual Machines Using SSH 85 Sample Script to Perform Operations on Linux Virtual Machines 90 Sample Script to Delete Machines
Setting Up Horizon 6 for Linux Desktops The Setting Up Horizon 6 for Linux Desktops document provides information about setting up a Linux virtual machine for use as a VMware Horizon 6™ desktop, including preparing the Linux guest operating system, installing View Agent on the virtual machine, and configuring the machine in View Administrator for use in a Horizon 6 deployment.
Setting Up Horizon 6 for Linux Desktops 6 VMware, Inc.
Features and System Requirements 1 With Horizon 6, users can connect to remote desktops that run the Linux operating system. This chapter includes the following topics: n “Features of Horizon 6 Linux Desktops and Desktop Pools,” on page 7 n “Overview of Configuration Steps for Horizon 6 for Linux Desktops,” on page 8 n “System Requirements for Horizon 6 for Linux,” on page 9 Features of Horizon 6 Linux Desktops and Desktop Pools Horizon 6 version 6.2.
Setting Up Horizon 6 for Linux Desktops Clipboard Redirection Single Sign-on Smart Card Redirection n vDGA is supported on RHEL 6.6 Workstation x64 with NVIDIA GRID K1 or K2 graphics cards. n vGPU is supported on RHEL 6.6 Workstation x64 with NVIDIA Maxwell M60 graphics cards. n vGPU is supported on RHEL 7.1 Workstation x64 with NVIDIA Maxwell M60 graphics cards. n Rich text and plain text support on RHEL 6.6 Workstation x64. n Rich text and plain text support on CentOS 6.6 x64.
Chapter 1 Features and System Requirements 5 Install View Agent on the Linux virtual machine. See “Install View Agent on a Linux Virtual Machine,” on page 39. 6 Create a desktop pool that contains the configured Linux virtual machines. See “Create a Desktop Pool That Contains Linux Virtual Machines,” on page 42.
Setting Up Horizon 6 for Linux Desktops Table 1‑1. Supported Linux Operating Systems for View Agent (Continued) Linux Distribution Architecture RHEL 6.6 x86 and x64 CentOS 6.6 x64 NeoKylin 6 Update 1 x64 NOTE On Ubuntu 14.04, disable Compiz to avoid poor performance. Required Platform and Horizon 6 Software Versions To install and use Horizon 6 for Linux, your deployment must meet certain vSphere platform, Horizon 6, and client requirements. vSphere platform version vSphere 5.5 U3, vSphere 6.
Chapter 1 Features and System Requirements Table 1‑2. Recommended vRAM Settings for 2D or vSGA Graphics (Continued) vRAM Size Number of Monitors Maximum Resolution 16 MB 1 2560x1600 32 MB 2 2048x1536 or 2560x1600 48 MB 3 2048x1536 64 MB 3 2560x1600 64 MB 4 2048x1536 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.
Setting Up Horizon 6 for Linux Desktops Recommended vCPU and Shared Memory Settings to Support Multiple Monitors To improve desktop performance with multiple monitors, configure at least two vCPUs for a Linux virtual machine. Also make sure that the virtual machine has adequate shared memory to support multiple monitors.
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 6 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 6 for Linux Desktops 14 Edit /etc/nsswitch.conf and modify the hosts entry as follows: hosts: cache db files dns The default setting is hosts: files dns and might cause the Linux desktop to fail to recover from a temporary network outage. The desktop might lose communication with View Connection Server permanently and require a reboot to resolve the issue. After installing VMware Tools, if you upgrade the Linux kernel, VMware Tools might stop running.
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 6 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 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). 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 View Agent, you must first disable SELinux or enable permissive mode for SELinux.
Setting Up Horizon 6 for Linux Desktops 20 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 21 n “Suppress the vSphere Console Display of a Linux Desktop,” on page 23 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 6 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. Clipboard.Direction 0, 1, 2, or 3 2 This option determines the clipboard redirectopn policy. 0 - Disable clipboard redirection. n 1 - Enable clipboard redirection in both directions. n 2 - Enable clipboard redirection from client to remote desktop only.
Chapter 4 Configuration Options for Linux Desktops Suppress the vSphere Console Display of a Linux Desktop When a user connects to a Linux desktop, the desktop can also be displayed in the vSphere console for the Linux virtual machine. You can configure Linux virtual machines to ensure that the vSphere console is blank when users connect to their desktops. Procedure u On the ESXi host, add the following line to the Linux virtual machine's vmx file. RemoteDisplay.
Setting Up Horizon 6 for Linux Desktops 24 VMware, Inc.
Setting Up Graphics for Linux Desktops 5 This chapter includes the following topics: n “Configure RHEL 6.6 and RHEL 7.1 for vGPU,” on page 25 n “Configure RHEL 6.6 for vDGA,” on page 30 n “Configure RHEL 7.1 for vSGA,” on page 34 Configure RHEL 6.6 and RHEL 7.1 for vGPU You can set up an RHEL 6.6 and RHEL 7.1 to take advantage of NVIDIA vGPU (shared GPU hardware acceleration) capabilities on the ESXi host. IMPORTANT NVIDIA vGPU is supported on NVIDIA Maxwell M60 graphics cards.
Setting Up Horizon 6 for Linux Desktops Procedure 1 Download the VIB for your NVIDIA GRID graphics card from the NVIDIA Driver Downloads site. Select the appropriate VIB version from the drop-down menus. 2 Option Description Product Type GRID Product Series For vGPU, select NVIDIA GRID vGPU. For vSGA, select GRID Series. Product Select the version (such as GRID K2) that is installed on the ESXi host. Operating System Select the VMware vSphere ESXi version.
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 6 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 6 for Linux Desktops What to do next Install View Agent on the Linux virtual machine. See “Install View Agent on a Linux Virtual Machine,” on page 39. Create a desktop pool that contains the configured Linux virtual machines. See “Create a Desktop Pool That Contains Linux Virtual Machines,” on page 42. 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 Enable DirectPath I/O for NVIDIA GRID GPUs on a Host Before you configure a Linux virtual machine to use vDGA, you must make the NVIDIA GRID GPU PCI devices available for DirectPath I/O passthrough on the ESXi host. Prerequisites n Verify that vSphere 6.0 or a later release is installed in your environment. n Verify that the NVIDIA GRID K1 or K2 graphics cards are installed on the ESXi host.
Setting Up Horizon 6 for Linux Desktops 7 Verify that the NVIDIA GRID device is passed through to the virtual machine. Open a terminal window and run the following command: lspci | grep NVIDIA The XX:00.0 VGA-compatible controller is displayed. For example: NVIDIA Corporation GK104GL [GRID K2] Install the NVIDIA Display Driver To install the NVIDIA display driver, you must disable the default NVIDIA driver, download the NVIDIA display drivers, and configure the PCI device on the virtual machine.
Chapter 5 Setting Up Graphics for Linux Desktops 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. b For a vDGA configuration, download the NVIDIA driver from the NVIDIA Driver Downloads site.
Setting Up Horizon 6 for Linux Desktops n Verify that View Agent is installed on the Linux virtual machine. See “Install View Agent on a Linux Virtual Machine,” on page 39. n Verify that the Linux virtual machine is deployed in a desktop pool. See “Create a Desktop Pool That Contains Linux Virtual Machines,” on page 42. Procedure 1 Restart the Linux virtual machine. The View Agent startup script initializes the X server and display topology.
Chapter 5 Setting Up Graphics for Linux Desktops Procedure 1 Download the VIB for your NVIDIA GRID graphics card from the NVIDIA Driver Downloads site. Select the appropriate VIB version from the drop-down menus. 2 Option Description Product Type GRID Product Series For vGPU, select NVIDIA GRID vGPU. For vSGA, select GRID Series. Product Select the version (such as GRID K2) that is installed on the ESXi host. Operating System Select the VMware vSphere ESXi version.
Setting Up Horizon 6 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 View Agent on the Linux virtual machine. See “Install View Agent on a Linux Virtual Machine,” on page 39. 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 6 for Linux Desktops 38 VMware, Inc.
Installing View Agent and Managing Linux Desktops 6 You must install View Agent on the Linux desktops so that View Connection Server can communicate with and manage the desktops.
Setting Up Horizon 6 for Linux Desktops Prerequisites n Verify that the Linux guest operating system is prepared for desktop use. See “Prepare a Linux Machine for Remote Desktop Deployment,” on page 14. n Familiarize yourself with the View Agent installer script for Linux. See “install_viewagent.sh Command Line Options,” on page 41.
Chapter 6 Installing View Agent and Managing Linux Desktops If another View Agent issue occurs, see Chapter 8, “Troubleshooting Linux Desktops,” on page 97. NOTE The install_viewagent.sh script installs JRE 8 in the View Agent installation directory, /usr/lib/vmware/viewagent/jre, on the Linux virtual machine. View Agent requires JRE 8. What to do next Deploy the virtual machine in a desktop pool. See “Create a Desktop Pool That Contains Linux Virtual Machines,” on page 42. install_viewagent.
Setting Up Horizon 6 for Linux Desktops Table 6‑3. install_viewagent.sh Optional Parameters Optional Parameters Description -n Machine name that is registered to View Connection Server. By default, the View Agent installer uses the host name. You can specify your own name. -s Subject DN of the self-signed certificate. By default, the View Agent installer generates a self-signed certificate with the following Subject DN value: '/C=US/ST=California/O=VMware/CN=Hostname.DomainName'.
Chapter 6 Installing View Agent and Managing Linux Desktops n On Ubuntu 14.04 machines, verify that user switching is disabled. See step 9 in “Prepare a Linux Machine for Remote Desktop Deployment,” on page 14. Procedure 1 In View Administrator, add a manual desktop pool. Select Catalog > Desktop Pools > Add . 2 Select Manual Desktop Pool. 3 Select either dedicated or floating user assignments for the machines in the desktop pool. 4 On the Machine Source page, select Other Sources.
Setting Up Horizon 6 for Linux Desktops The installer filename is VMware-viewagent-linux-x86_64-y.y.y-xxxxxxx.tar.gz for 64-bit Linux or VMware-viewagent-linux-y.y.y-xxxxxxx.tar.gz for 32-bit Linux, where y.y.y is the version number and xxxxxxx is the build number. 2 Unpack the tarball for your Linux distribution on the guest operating system. For example: tar -xzvf 3 Navigate to the tar ball folder. 4 Run the install_viewagent.sh script. For example: sudo ./install_viewagent.
Chapter 6 Installing View Agent and Managing Linux Desktops Prerequisites Verify that the registered machines that you want to remove are not being used in any desktop pool. Procedure 1 In View Administrator, select View Configuration > Registered Machines. 2 Click the Others tab. 3 Select one or more machines and click Remove. You can select only machines that are not being used by a desktop pool. 4 Click OK to confirm.
Setting Up Horizon 6 for Linux Desktops Prerequisites n Verify whether the Horizon 6 for Linux configuration files are present on the machine. /etc/vmware/viewagent-machine.cfg /etc/vmware/viewagent-config.txt /etc/vmware/jms /etc/vmware/ssl n Verify whether the Linux virtual machine is registered in View Connection Server. In View Administrator, select View Configuration > Registered Machines and select the Others tab.
Chapter 6 Installing View Agent and Managing Linux Desktops n Files Location View Agent configuration /etc/vmware/viewagent-config.txt Machine configuration /etc/vmware/viewagent-machine.cfg Stop, start, or restart the View Agent service. A View Agent service with these operations is provided on the Linux distributions. For example, on Ubuntu 12.04, you can run the following command: sudo service viewagent VMware, Inc.
Setting Up Horizon 6 for Linux Desktops 48 VMware, Inc.
Bulk Deployment of Horizon 6 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 6 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 6 for Linux Desktops See “Sample Script to Upload Configuration Files to Linux Virtual Machines,” on page 73 or “Sample Script to Upload Configuration Files to Linux Virtual Machines Using SSH,” on page 77. 7 Create a desktop pool. See “Create a Desktop Pool That Contains Linux Virtual Machines,” on page 42. Occasionally, you might need to upgrade View Agent on the Linux virtual machines.
Setting Up Horizon 6 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 6 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 6 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 6 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 6 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 6 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 6 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 6 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 6 for Linux Desktops To copy and paste the script content without page breaks, use the HTML version of this topic, available from the Horizon 6 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 52.
Chapter 7 Bulk Deployment of Horizon 6 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 6 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 6 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 6 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 View Agent to register the Linux machine with View Connection Server.
Chapter 7 Bulk Deployment of Horizon 6 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 View Agent tar ball path.
Setting Up Horizon 6 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 6 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 6 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 6 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 6 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 6 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 6 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 6 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 6 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 52.
Chapter 7 Bulk Deployment of Horizon 6 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 6 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 6 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 6 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 6 for Linux Desktops $IP = $VM.guest.IPAddress[0] $command = "echo yes | .\pscp.
Setting Up Horizon 6 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 6 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 6 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 6 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 6 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 6 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 View Agent EULA in tar bundle ("yes" or "no"): yes Your vCenter address: 10.117.44.
Setting Up Horizon 6 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 6 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 6 for Linux Desktops $agentInstaller = GetInput -prompt 'Type the View Agent tar ball path.
Chapter 7 Bulk Deployment of Horizon 6 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 6 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 6 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 6 for Linux Desktops return $Exists } function Delete_VM($VMToDelete) { Write-Host "Deleting VM $VMToDelete" Get-VM $VMToDelete | where { $_.
Chapter 7 Bulk Deployment of Horizon 6 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 6 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 6 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 6 for Linux Desktops 96 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 6 for Linux Desktops Cause The View 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 View 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, View Agent stores a list of FQDNs of the View Connection Server instances in the /etc/vmware/viewagent-machine.cfg configuration file. View Agent uses FQDNs even if you specify an IP address of a View Connection Server instance with the -b parameter during the View Agent installation. A second cause might be that the hostname of the Linux machine itself cannot be resolved. Solution 1 On the Linux machine, open the View Agent log file.
Setting Up Horizon 6 for Linux Desktops Troubleshooting View Agent on a Linux Machine That Is Not Responding View Agent that is installed on a Linux virtual machine is not responding. Problem The Horizon 6 for Linux desktop is not accessible, and View Agent is not responding. Cause The View 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 View Agent service.
Index A L Active Directory, integrating with Linux 17 Linux desktops configuring 21 features 7 features and requirements 7 installing View Agent 39 setting up AD integration 17 Linux installation View Agent fails to register 97 View Agent is unreachable 98 Linux systems adding to desktop pools 42 collecting diagnostic information 97 configuring the firewall 100 desktops 5 overview of desktop setup steps 8 preparing for desktop use 14 vSphere console display 23 Linux virtual machines, preparing for deskt
Setting Up Horizon 6 for Linux Desktops configuring for vGPU 25 configuring for vSGA 34 S sample script bulk delete desktop machines 94 clone desktop machines using SSH 59 install View Agent using SSH 63 perform operations on VMs 90 to clone desktop machines 53, 57 to install View Agent 68 to upgrade View Agent 81 upgrade View Agent using SSH 85 upload configuration files 73 upload configuration files using SSH 77 sample scripts, input file 52 single sign-on 18 smart card redirection 18 T troubleshooting