Professional Documents
Culture Documents
Horizon 6
Version 6.2
EN-001908-00
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
VMware, Inc.
Contents
13
19
Index
VMware, Inc.
63
VMware, Inc.
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.
Intended Audience
This information is intended for anyone who wants to configure and use remote desktops that run on Linux
guest operating systems. The information is written for experienced Linux system administrators who are
familiar with virtual machine technology and datacenter operations.
VMware, Inc.
VMware, Inc.
To set up a Linux virtual machine as a remote desktop in a Horizon 6 environment, you must prepare the
Linux guest operating system, install View Agent on the virtual machine, and configure the machine in
View Administrator.
This chapter includes the following topics:
n
Prepare a Linux Guest Operating System for Remote Desktop Deployment, on page 13
Single Sign-on (SSO) is not supported. After logging in to Horizon 6 and launching the remote desktop,
the user must log in to the Linux guest operating system.
Automated provisioning and other features that are provided only with automated desktop pools are
not supported. For example, the refresh on logoff operation is not available.
Local devices cannot be used on the remote desktop. For example, USB redirection, virtual printing,
location-based printing, clipboard redirection, Real-Time Audio-Video, and smart cards are not
supported.
NOTE When a security server is used, port 22443 must be open in the internal firewall to allow traffic
between the security server and the Linux desktop.
VMware, Inc.
Review the system requirements for setting up a Horizon 6 for Linux deployment. See System
Requirements for Horizon 6 for Linux, on page 9.
Create a virtual machine in vSphere and install the Linux operating system. See Create a Virtual
Machine and Install Linux, on page 12.
Prepare the guest operating system for deployment as a desktop in a Horizon 6 environment. See
Prepare a Linux Guest Operating System for Remote Desktop Deployment, on page 13.
Configure the Linux guest operating system to authenticate with Active Directory. This step is
implemented with 3rd-party software, based on the requirements in your environment, and is not
described in this guide.
Install View Agent on the Linux virtual machine. See Install View Agent on a Linux Virtual Machine,
on page 15.
Create a desktop pool that contains the configured Linux virtual machines. See Create a Desktop Pool
That Contains Linux Virtual Machines, on page 17.
Review the system requirements for setting up a Horizon 6 for Linux deployment. See System
Requirements for Horizon 6 for Linux, on page 9.
Create a virtual machine in vSphere and install the Linux operating system. See Create a Virtual
Machine and Install Linux, on page 12.
Prepare the guest operating system for deployment as a desktop in a Horizon 6 environment. See
Prepare a Linux Guest Operating System for Remote Desktop Deployment, on page 13.
Configure the Linux guest operating system to authenticate with Active Directory. This step is
implemented with 3rd-party software, based on the requirements in your environment, and is not
described in this guide.
Configure 3D capabilities on your ESXi hosts and the Linux virtual machine. Follow the procedures for
the 3D feature you intend to install.
n
See Configure RHEL 6.6 for NVIDIA GRID vGPU, on page 19.
Install View Agent on the Linux virtual machine. See Install View Agent on a Linux Virtual Machine,
on page 15.
Create a desktop pool that contains the configured Linux virtual machines. See Create a Desktop Pool
That Contains Linux Virtual Machines, on page 17.
VMware, Inc.
Bulk Deployment
With View Administrator, you must deploy Linux virtual machines in a manual desktop pool.
Alternatively, with vSphere PowerCLI, you can develop scripts that automate the deployment of a pool of
Linux desktop machines. See Chapter 3, Bulk Deployment of Horizon 6 for Linux Desktops, on page 33.
Architecture
Ubuntu 14.04
x64
Ubuntu 12.04
RHEL 7.1
x64
RHEL 6.6
CentOS 6.6
NeoKylin 6 Update 1
x64
Horizon environment
VMware, Inc.
Desktop sessions might be disconnected right after the initial connection is made.
Autofit might fail to work. The desktop is then displayed in a small area of the screen.
CAUTION Horizon 6 does not automatically configure the vRAM settings on Linux virtual machines, as
happens on Windows virtual machines. You must configure the vRAM settings manually in vSphere Client.
Table 12. Recommended vRAM Settings for Linux Guest Operating Systems That Use 2D or vSGA
Graphics
10
vRAM Size
Number of
Monitors
Maximum Resolution
10 MB
1600x1200 or 1680x1050
12 MB
1920x1440
16 MB
2560x1600
32 MB
2048x1536 or 2560x1600
48 MB
2048x1536
64 MB
2560x1600
VMware, Inc.
Table 12. Recommended vRAM Settings for Linux Guest Operating Systems That Use 2D or vSGA
Graphics (Continued)
vRAM Size
Number of
Monitors
Maximum Resolution
64 MB
2048x1536
128 MB
2560x1600
RHEL and CentOS only support this configuration on vSphere 5.5.
To support this configuration on Ubuntu, you must recompile the kernel.
For NeoKylin, this configuration is not supported.
NOTE To connect to a RHEL 6.6 or CentOS 6.6 desktop with multiple monitors, you must specify the
number of displays correctly. For information about how to specify the number of displays, see Create a
Virtual Machine and Install Linux, on page 12. You must also edit the vmx file and append the following
lines:
svga.maxWidth="10240"
svga.maxHeight="2048"
If these settings are not added, only one monitor displays the desktop. The others display a black screen.
If you encounter an autofit issue with the recommended settings, you can specify a larger vRAM size.
vSphere Client permits a maximum vRAM size of 128 MB. If your specified size exceeds 128 MB, you must
modify the vmx file manually. The following example specifies a vRAM size of 256 MB:
svga.vramSize = "268435456"
NOTE To configure four monitors for a RHEL 7.1 machine that uses 2D rendering or 3D rendering with
vSGA, set a maximum resolution of 2048x1536 for each monitor. To configure a RHEL 7.1 machine to use up
to three monitors, set a maximum resolution of 2560x1600 for each monitor.
To improve performance for a RHEL 7.1 machine in a vSGA multiple-monitor environment, set the 3D
Memory setting for the virtual machine to 1 GB or larger, and configure 4 vCPUs for the machine. If you
configure four monitors at 2048x1536 resolution on a RHEL 7.1 machine, set Memory to 4 GB, and configure
4 vCPUs for the machine.
If shared memory is small, increase the maximum size with the following command:
sysctl -w "kernel.shmmax=65536000"
VMware, Inc.
11
Verify that your deployment meets the requirements for supporting Linux desktops. See System
Requirements for Horizon 6 for Linux, on page 9.
Familiarize yourself with the steps for creating virtual machines in vCenter Server and installing guest
operating systems. See "Creating and Preparing Virtual Machines" in the Setting Up Desktop and
Application Pools in View document.
Familiarize yourself with the recommended video memory (vRAM) values for the monitors you will
use with the virtual machine. See System Requirements for Horizon 6 for Linux, on page 9.
Procedure
1
Select Video card and specify the number of displays and the total video memory (vRAM).
Set the vRAM size in vSphere Web Client for virtual machines that use 2D or vSGA, which use the
VMware driver. The vRAM size has no affect on vDGA or NVIDIA GRID vGPU machines, which
use NVIDIA drivers.
For recommended values, follow the guidelines in System Requirements for Horizon 6 for Linux. Do
not use the Video Memory Calculator.
12
VMware, Inc.
Verify that a new virtual machine was created in vCenter Server and your Linux distribution was
installed on the machine
Familiarize yourself with the steps for mounting and installing VMware Tools on a Linux virtual
machine. See "Manually Install or Upgrade VMware Tools in a Linux Virtual Machine" in the vSphere
Virtual Machine Administration document.
Familiarize yourself with the steps for configuring your Linux machine to be resolvable through DNS.
These steps vary for the different Linux distributions and releases. For instructions, consult the
documentation for your Linux distribution and release.
Procedure
1
In vSphere Web Client or vSphere Client, mount the VMware Tools virtual disk on the guest operating
system.
Right-click the VMware Tools installer file, VMwareTools.x.x.x-xxxx.tar.gz, click Extract to, and select
the desktop for your Linux distribution.
The vmware-tools-distrib folder is extracted to the desktop.
In the virtual machine, log in to the guest operating system and root and open a terminal window.
Usually, the vmware-config-tools.pl configuration file runs after the installer file finishes running.
6
Ensure that the View Connection Server instances in the pod can be resolved through DNS.
VMware, Inc.
13
10
If your deployment uses a Windows Server 2012 or Windows Server 2012 R2 Active Directory (AD)
server, enable reversible password encryption.
a
Right-click the View Admin account, or create a new Linux View Agent account, and select
Properties.
In Account options, select the Store password using reversible encryption setting.
On Ubuntu 14.04 machines, disable user switching to ensure that end users cannot switch user sessions
from within the Linux desktop.
a
To successfully disable user switching, download and install the latest version of the indicatorsession package, available at https://launchpad.net/ubuntu/wily/amd64/indicatorsession/12.10.5+15.04.20150327-0ubuntu1.
On RHEL 7.1 machines, downgrade the latest graphic drivers that are installed on the machines.
These drivers disable 3D, which causes vSGA not to work and can cause the system to freeze when you
log out. Take the following steps:
yum update
yum downgrade mesa-libxatracker.x86_64 xorg-x11-drv-vmware mesa-private-llvm mesa-dri-drivers
11
12
Make sure that an HD audio device is not present in the virtual hardware settings for the virtual
machine.
If HD audio is configured on the machine, audio out might not work properly when users connect to
the Linux desktop.
13
On an Ubuntu machine that was configured to authenticate with an OpenLDAP server, set the fully
qualified domain name on the machine.
This step ensures that the information can be displayed correctly in the User field on the Sessions page
in View Administrator. Edit the /etc/hosts file as follows:
a
# nano /etc/hosts
Add the fully qualified domain name. For example: 127.0.0.1 hostname.domainname hostname.
After installing VMware Tools, if you upgrade the Linux kernel, VMware Tools might stop running. To
resolve the problem, see http://kb.vmware.com/kb/2050592.
What to do next
If you are preparing the Linux machine to use NVIDIA GRID vGPU, vDGA, or vSGA, you must complete
the 3D configuration on the virtual machine before you install View Agent. See Configure RHEL 6.6 for
NVIDIA GRID vGPU, on page 19, Configure RHEL 6.6 for vDGA, on page 25, or Configure RHEL
7.1 for vSGA, on page 29.
If you are preparing the Linux machine to use 2D graphics, install View Agent. See Install View Agent on a
Linux Virtual Machine, on page 15.
14
VMware, Inc.
Verify that the Linux guest operating system is prepared for desktop use. See Prepare a Linux Guest
Operating System for Remote Desktop Deployment, on page 13.
Familiarize yourself with the View Agent installer script for Linux. See install_viewagent.sh
Command Usage and Options, on page 16.
Verify that the View Connection Server administrative user that you provide with the installation
command has the Agent Registration Administrators or Administrators role in View Administrator.
Specifically, the Register Agent privilege is required to register View Agent with View Connection
Server. Agent Registration Administrators is a restricted role that provides this minimum privilege.
Procedure
1
Download the View Agent for Linux installer file from the VMware download site at
https://my.vmware.com/web/vmware/downloads.
Under Desktop & End-User Computing, select the VMware Horizon 6 download, which includes the
View Agent for Linux installer.
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.
Unpack the tarball for your Linux distribution on the guest operating system.
For example:
tar -xzvf <View Agent tar ball>
The -b parameter specifies the View Connection Server instance to which the Linux machine is
registered. You can use an FQDN or IP address with the -b parameter.
VMware, Inc.
15
The -d, -u, and -p parameters specify the domain, user name, and password of the View administrator
user. In the password, be sure to escape special characters such as $. For example: ab\$cdef
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 that is displayed when you enter the install_viewagent.sh script at the
command line.
The installer does not run until you accept the EULA.
The install_viewagent.sh script installs the View Agent software on the Linux virtual machine. The script
registers the machine with View Connection Server.
The viewagent service is started on the Linux virtual machine. You can verify that the service is started by
running the #service viewagent status command.
If an Agent Registration Failed message appears, see Troubleshooting View Agent Registration Failure
for a Linux Machine, on page 58.
If another View Agent issue occurs, see Troubleshooting Horizon 6 for Linux, on page 57.
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 17.
16
Mandatory Parameter
Description
-b
-d
Domain name of the View Connection Server instance administrator user. For example:
mydomain.com
-u
User name of the View Connection Server administrator user. For example: myadmin
The user must have the Agent Registration Administrators or Administrators role in View
Administrator. Specifically, the Register Agent privilege is required to register View Agent
with View Connection Server. Agent Registration Administrators is a restricted role that
provides this minimum privilege.
VMware, Inc.
Description
-p
-A
EULA acceptance. The allowed values are yes and no. You must specify yes for the install to
proceed. If this parameter is not specified, the install script prompts for the value.
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
Verify that View Agent is installed on the Linux guest operating systems. See Install View Agent on a
Linux Virtual Machine, on page 15.
Verify that the Linux virtual machines are registered in View Connection Server. In View
Administrator, select View Configuration > Registered Machines and select the Others tab. Verify that
each machine's state is Available.
On Ubuntu 14.04 machines, verify that user switching is disabled. See step 9 in Prepare a Linux Guest
Operating System for Remote Desktop Deployment, on page 13.
Procedure
1
VMware, Inc.
17
Select either dedicated or floating user assignments for the machines in the desktop pool.
On the Add Machines page, select the Linux virtual machines that you configured and complete the
Add Desktop Pool wizard.
Do not change the Remote Display Protocol settings. These settings have no effect on Linux desktops.
Also, the end user cannot choose the display protocol.
IMPORTANT Add Linux virtual machines only. If you add Windows virtual machines, the Linux
desktops in the pool will be unavailable.
The Linux virtual machines are ready to be used as remote desktops in a Horizon 6 deployment.
Verify that the VMwareBlastServer process is not running on the Linux virtual machine.
To stop this process, make sure that the user logs off the machine and no desktop session is active, or
reboot the machine.
Procedure
1
Download the latest View Agent for Linux installer file from the VMware download site at
https://my.vmware.com/web/vmware/downloads.
Under Desktop & End-User Computing, select the VMware Horizon 6 download, which includes the
View Agent for Linux installer.
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.
Unpack the tarball for your Linux distribution on the guest operating system.
For example:
tar -xzvf <View Agent tar ball>
18
VMware, Inc.
You can configure Horizon 6 for Linux virtual machines to use NVIDIA GRID vGPU (shared GPU hardware
acceleration) or Virtual Dedicated Graphics Acceleration (vDGA) on NVIDIA GRID graphics cards that are
installed on ESXi hosts. You can also configure your Linux virtual machines to use Virtual Shared Graphics
Acceleration (vSGA).
The Autofit feature, audio out feature, and multiple monitors are supported on Linux desktops that are
configured to use 3D graphics.
The steps to configure a Linux guest operating system for 3D graphics vary depending on the Linux
distribution.
This chapter includes the following topics:
n
Install the VIB for the NVIDIA Graphics Card on the ESXi Host on page 20
You must download and install the VIB for your NVIDIA GRID graphics card on the ESXi 6.0 U1 or
later host.
Configure a Shared PCI Device for vGPU on the Linux Virtual Machine on page 21
To configure a RHEL 6.6 virtual machine to use NVIDIA GRID vGPU, you must configure a shared
PCI device for the virtual machine.
VMware, Inc.
19
Install the VIB for the NVIDIA Graphics Card on the ESXi Host
You must download and install the VIB for your NVIDIA GRID graphics card on the ESXi 6.0 U1 or later
host.
For an NVIDIA GRID vGPU configuration, NVIDIA provides a vGPU software package that includes a
vGPU Manager, which you install on the ESXi host in this procedure, and a Linux Display Driver, which
you will install on the Linux virtual machine in a later procedure.
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
For an NVIDIA GRID vGPU configuration, verify that the NVIDIA Maxwell M60 GPUs are installed on
the ESXi host.
For a vSGA configuration, verify that the NVIDIA GRID K1 or K2 GPUs are installed on the ESXi host.
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.
Option
Description
Product Type
GRID
Product Series
Product
Select the version (such as GRID K2) that is installed on the ESXi host.
Operating System
NOTE You will install the Linux Display Driver on the Linux virtual machine in a later procedure.
3
For a vSGA configuration, upload the VMware vSphere ESXi Driver for vSGA to the ESXi 6.0 U1 host.
20
VMware, Inc.
esxcli
esxcli
esxcli
esxcli
Description
vSGA
# /etc/init.d/xorg start
Reboot the ESXi host.
Verify that the xorg service is running after the host is restarted.
Configure a Shared PCI Device for vGPU on the Linux Virtual Machine
To configure a RHEL 6.6 virtual machine to use NVIDIA GRID vGPU, you must configure a shared PCI
device for the virtual machine.
Prerequisites
n
Verify that the Linux virtual machine is prepared for use as a desktop. See Create a Virtual Machine
and Install Linux, on page 12 and Prepare a Linux Guest Operating System for Remote Desktop
Deployment, on page 13.
Verify that View Agent is not installed on the Linux virtual machine.
Verify that the NVIDIA VIB is installed on the ESXi host. See Install the VIB for the NVIDIA Graphics
Card on the ESXi Host, on page 20.
Familiarize yourself with the virtual GPU types that are available with NVIDIA GRID vGPU, which
you select with the GPU Profile setting. The virtual GPU types provide varying capabilities on the
physical GPUs installed on the ESXi host. See NVIDIA Virtual GPU Types, on page 22.
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.
In vSphere Web Client, select the virtual machine and, under the VM Hardware tab, click Edit Settings.
VMware, Inc.
21
Click Add and select NVIDIA GRID vGPU from the drop-down menu.
For the GPU Profile setting, select a virtual GPU type from the drop-down menu.
Power on the virtual machine and open vSphere console to connect to the machine.
Display
Heads
Maximum
Resolution
Maximum
Virtual
GPUs Per
Physical
GPU
Maximum
Virtual GPUs
Per Physical
Board
Virtual GPU
Type
Physical
Board
Physical
GPUs
FB Per
Virtual
GPU
GRID
M60-0q
GRID M60
two
512M
2560x1600
16
32
GRID
M60-1q
GRID M60
two
1G
2560x1600
16
GRID
M60-2q
GRID M60
two
2G
2560x1600
GRID
M60-4q
GRID M60
two
4G
3840x2160
GRID
M60-8q
GRID M60
two
8G
3840x2160
For an NVIDIA GRID vGPU configuration, verify that you downloaded the vGPU software package
from the NVIDIA download site, uncompressed the package, and have the Linux Display Driver (a
package component) ready to copy to the RHEL 6.6 virtual machine. See Install the VIB for the
NVIDIA Graphics Card on the ESXi Host, on page 20.
Also verify that a shared PCI device was added to the RHEL 6.6 virtual machine. See Configure a
Shared PCI Device for vGPU on the Linux Virtual Machine, on page 21
22
For a vDGA configuration, verify that the PCI device was added to the RHEL 6.6 virtual machine. See
Add a vDGA Pass-Through Device to a RHEL 6.6 Virtual Machine, on page 26.
VMware, Inc.
Procedure
1
If the grep search does not return any results, the Nouveau driver is disabled.
4
Copy or download the NVIDIA display driver to the RHEL 6.6 virtual machine.
a
For an NVIDIA GRID vGPU configuration, copy the NVIDIA Linux Display Driver to the RHEL
6.6 virtual machine.
For a vDGA configuration, download the NVIDIA driver from the NVIDIA Driver Downloads site.
Select the appropriate driver version from the NVIDIA drop-down menus:
Option
Description
Product Type
GRID
Product Series
GRID Series
Product
Select the version (such as GRID K2) that is installed on the ESXi host.
Operating System
Open a remote terminal to the virtual machine, or switch to a text console by typing Ctrl-Alt-F2, log in
as root, and run the init 3 command to disable X Windows.
Install additional components that are required for the NVIDIA driver.
sudo yum install gcc-c++
sudo yum install kernel-devel-$(uname -r)
sudo yum install kernel-headers-$(uname -r)
VMware, Inc.
23
For vDGA:
sudo ./NVIDIA-Linux-x86_64-version.run
Accept the NVIDIA software license agreement and select Yes to automatically update the X
configuration settings.
What to do next
Install View Agent on the Linux virtual machine. See Install View Agent on a Linux Virtual Machine, on
page 15.
Create a desktop pool that contains the configured Linux virtual machines. See Create a Desktop Pool That
Contains Linux Virtual Machines, on page 17.
Verify that View Agent is installed on the Linux virtual machine. See Install View Agent on a Linux
Virtual Machine, on page 15.
Verify that the Linux virtual machine is deployed in a desktop pool. See Create a Desktop Pool That
Contains Linux Virtual Machines, on page 17.
Procedure
1
In the Linux desktop session, verify that the NVIDIA display driver is installed.
Open a terminal window and run the glxinfo | grep NVIDIA command.
The NVIDIA driver output is displayed. For example:
[root]# glxinfo | grep NVIDIA
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
OpenGL version string: 4.5.0 NVIDIA 346.47
OpenGL shading language version string: 4.50 NVIDIA
The user can access the NVIDIA graphics capabilities on the remote desktop.
After installing the NVIDIA driver, if you upgrade the Linux kernel, View Agent might not be able to
communicate with View Connection Server. To resolve the problem, reinstall the NVIDIA driver.
24
VMware, Inc.
Verify that the NVIDIA GRID K1 or K2 graphics cards are installed on the ESXi host.
Procedure
1
To enable DirectPath I/O passthrough for the NVIDIA GRID GPUs, click Edit.
Icon
Description
Green icon
Orange icon
The state of the device has changed. You must reboot the host before you
can use the device.
VMware, Inc.
25
Reboot the host to make the PCI devices available for use by the Linux virtual machines.
Verify that the Linux virtual machine is prepared for use as a desktop. See Create a Virtual Machine
and Install Linux, on page 12 and Prepare a Linux Guest Operating System for Remote Desktop
Deployment, on page 13.
Verify that View Agent is not installed on the Linux virtual machine.
Verify that the NVIDIA GRID GPU PCI device was made available for DirectPath I/O pass-through on
the host. See Enable DirectPath I/O for NVIDIA GRID GPUs on a Host, on page 25.
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.
In vSphere Web Client, select the virtual machine and, under the VM Hardware tab, click Edit Settings.
Click Add and select the PCI device from the drop-down menu.
Power on the virtual machine and open vSphere console to connect to the machine.
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
For an NVIDIA GRID vGPU configuration, verify that you downloaded the vGPU software package
from the NVIDIA download site, uncompressed the package, and have the Linux Display Driver (a
package component) ready to copy to the RHEL 6.6 virtual machine. See Install the VIB for the
NVIDIA Graphics Card on the ESXi Host, on page 20.
Also verify that a shared PCI device was added to the RHEL 6.6 virtual machine. See Configure a
Shared PCI Device for vGPU on the Linux Virtual Machine, on page 21
26
For a vDGA configuration, verify that the PCI device was added to the RHEL 6.6 virtual machine. See
Add a vDGA Pass-Through Device to a RHEL 6.6 Virtual Machine, on page 26.
VMware, Inc.
Procedure
1
If the grep search does not return any results, the Nouveau driver is disabled.
4
Copy or download the NVIDIA display driver to the RHEL 6.6 virtual machine.
a
For an NVIDIA GRID vGPU configuration, copy the NVIDIA Linux Display Driver to the RHEL
6.6 virtual machine.
For a vDGA configuration, download the NVIDIA driver from the NVIDIA Driver Downloads site.
Select the appropriate driver version from the NVIDIA drop-down menus:
Option
Description
Product Type
GRID
Product Series
GRID Series
Product
Select the version (such as GRID K2) that is installed on the ESXi host.
Operating System
Open a remote terminal to the virtual machine, or switch to a text console by typing Ctrl-Alt-F2, log in
as root, and run the init 3 command to disable X Windows.
Install additional components that are required for the NVIDIA driver.
sudo yum install gcc-c++
sudo yum install kernel-devel-$(uname -r)
sudo yum install kernel-headers-$(uname -r)
VMware, Inc.
27
For vDGA:
sudo ./NVIDIA-Linux-x86_64-version.run
Accept the NVIDIA software license agreement and select Yes to automatically update the X
configuration settings.
What to do next
Install View Agent on the Linux virtual machine. See Install View Agent on a Linux Virtual Machine, on
page 15.
Create a desktop pool that contains the configured Linux virtual machines. See Create a Desktop Pool That
Contains Linux Virtual Machines, on page 17.
Verify that View Agent is installed on the Linux virtual machine. See Install View Agent on a Linux
Virtual Machine, on page 15.
Verify that the Linux virtual machine is deployed in a desktop pool. See Create a Desktop Pool That
Contains Linux Virtual Machines, on page 17.
Procedure
1
In the Linux desktop session, verify that the NVIDIA display driver is installed.
Open a terminal window and run the glxinfo | grep NVIDIA command.
The NVIDIA driver output is displayed. For example:
[root]# glxinfo | grep NVIDIA
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
OpenGL version string: 4.5.0 NVIDIA 346.47
OpenGL shading language version string: 4.50 NVIDIA
The user can access the NVIDIA graphics capabilities on the remote desktop.
After installing the NVIDIA driver, if you upgrade the Linux kernel, View Agent might not be able to
communicate with View Connection Server. To resolve the problem, reinstall the NVIDIA driver.
28
VMware, Inc.
Install the VIB for the NVIDIA Graphics Card on the ESXi Host on page 29
You must download and install the VIB for your NVIDIA GRID graphics card on the ESXi 6.0 U1 or
later host.
Install the VIB for the NVIDIA Graphics Card on the ESXi Host
You must download and install the VIB for your NVIDIA GRID graphics card on the ESXi 6.0 U1 or later
host.
For an NVIDIA GRID vGPU configuration, NVIDIA provides a vGPU software package that includes a
vGPU Manager, which you install on the ESXi host in this procedure, and a Linux Display Driver, which
you will install on the Linux virtual machine in a later procedure.
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
For an NVIDIA GRID vGPU configuration, verify that the NVIDIA Maxwell M60 GPUs are installed on
the ESXi host.
For a vSGA configuration, verify that the NVIDIA GRID K1 or K2 GPUs are installed on the ESXi host.
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.
VMware, Inc.
Option
Description
Product Type
GRID
Product Series
Product
Select the version (such as GRID K2) that is installed on the ESXi host.
Operating System
29
NOTE You will install the Linux Display Driver on the Linux virtual machine in a later procedure.
3
For a vSGA configuration, upload the VMware vSphere ESXi Driver for vSGA to the ESXi 6.0 U1 host.
esxcli
esxcli
esxcli
esxcli
Description
vSGA
# /etc/init.d/xorg start
Reboot the ESXi host.
Verify that the xorg service is running after the host is restarted.
30
Verify that the Linux virtual machine is prepared for use as a desktop, View Agent is installed, and the
machine is deployed in a desktop pool. See Chapter 1, Installing and Configuring Horizon 6 for Linux
Desktops, on page 7.
VMware, Inc.
Verify that the NVIDIA VIB is installed on the ESXi host. See Install the VIB for the NVIDIA Graphics
Card on the ESXi Host, on page 20.
Procedure
1
Power off the virtual machine. and log in to the RHEL 7.1 guest operating system as a local user
configured with sudo rights.
In vSphere Web Client, select the virtual machine and, under the VM Hardware tab, click Edit Settings.
In the Virtual Hardware tab, click Video card to expand the menu settings.
Click OK.
10
On a RHEL 7.1 machine, downgrade the latest graphic drivers that are installed on the machines.
These drivers disable 3D, which causes vSGA not to work and can cause the system to freeze when you
log out. Take the following steps:
yum update
yum downgrade mesa-libxatracker.x86_64 xorg-x11-drv-vmware mesa-private-llvm mesa-dri-drivers
What to do next
Verify that vSGA is running on the Linux virtual machine.
Next, install View Agent on the Linux virtual machine. See Install View Agent on a Linux Virtual
Machine, on page 15.
VMware, Inc.
svga|
svga|
svga|
svga|
I125:
I125:
I125:
I125:
31
If a supported GPU and NVIDIA VIB are not installed correctly, the virtual machine uses the Software
Renderer. The vmware.log file displays lines such as those in the following example:
2015-07-06T17:09:26.423Z| vmx| I125: [msg.mks.noGPUResourceFallback] Hardware GPU resources
are not available. The virtual machine will use software rendering.
2015-07-06T17:09:26.423Z| vmx| I125: ---------------------------------------2015-07-06T17:09:26.425Z| svga| I125: MKS-SWP: plugin started - llvmpipe (LLVM 3.3, 256 bits)
2015-07-06T17:09:26.426Z| svga| I125: Started Shim3D
2015-07-06T17:09:26.426Z| svga| I125: MKS-RenderMain: Starting SWRenderer
In the guest operating system on the virtual machine, type the following command.
glxinfo|grep Gallium
If vSGA is not working correctly, the command returns the following text:
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.3, 256 bits)
What to do next
Install View Agent on the Linux virtual machine. See Install View Agent on a Linux Virtual Machine, on
page 15.
32
VMware, Inc.
With View Administrator, you can create a pool of Windows, but not Linux, desktop machines
automatically. With vSphere PowerCLI, 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.
This chapter includes the following topics:
n
Create a Virtual Machine Template for Cloning Linux Desktop Machines, on page 34
Input File for the Sample PowerCLI Scripts to Deploy Linux Desktops, on page 35
Sample PowerCLI Script to Upgrade View Agent on Linux Desktop Machines, on page 43
Sample PowerShell Script to Delete Machines from the Connection Server LDAP Database, on
page 50
VMware, Inc.
33
See "Create a Customization Specification for Linux in the vSphere Web Client" in the vSphere Virtual
Machine Administration document. When you create the specification, make sure that you specify the
following settings correctly.
Setting
Value
Linux
Computer Name
Network Settings
Primary DNS
Occasionally, you might need to upgrade View Agent on the Linux virtual machines. For a sample script to
upgrade View Agent on virtual machines, see Sample PowerCLI Script to Upgrade View Agent on Linux
Desktop Machines, on page 43.
For a sample script that performs operations such as powering on, shutting down, restarting, or deleting
virtual machines, see Sample PowerCLI Script to Perform Operations on Linux Desktop Machines, on
page 47. This script can delete virtual machines from vCenter Server. To delete desktop machines from
Vew, see Sample PowerShell Script to Delete Machines from the Connection Server LDAP Database, on
page 50.
Verify that your deployment meets the requirements for supporting Linux desktops. See System
Requirements for Horizon 6 for Linux, on page 9.
Familiarize yourself with the steps for creating virtual machines in vCenter Server and installing guest
operating systems. See "Creating and Preparing Virtual Machines" in the Setting Up Desktop and
Application Pools in View document.
Familiarize yourself with the recommended video memory (vRAM) values for the monitors you will
use with the virtual machine. See System Requirements for Horizon 6 for Linux, on page 9.
If you intend the deployed machines to use NVIDIA GRID vGPU, familiarize yourself with the steps for
configuring this 3D feature. See Configure RHEL 6.6 for NVIDIA GRID vGPU, on page 19.
Procedure
1
34
VMware, Inc.
Select Video card and specify the number of displays and the total video memory (vRAM).
Set the vRAM size in vSphere Web Client for virtual machines that use 2D or vSGA, which use the
VMware driver. The vRAM size has no affect on vDGA or NVIDIA GRID vGPU machines, which
use NVIDIA drivers.
For recommended values, follow the guidelines in System Requirements for Horizon 6 for Linux. Do
not use the Video Memory Calculator.
Create a user with root privileges, for example, ViewUser. This user is used to install and uninstall
View Agent only.
If the Linux distribution is RHEL, CentOS, or NeoKylin, edit /etc/sudoers and comment out the
following lines:
Defaults requiretty
Defaults !visiblepw
If you intend to provide NVIDIA GRID vGPU for the cloned machines, configure the parent virtual
machine to use NVIDIA GRID vGPU.
10
Input File for the Sample PowerCLI Scripts to Deploy Linux Desktops
The sample PowerCLI scripts to deploy Linux desktops read one input file that contains information about
the desktop machines.
The input file is of type csv and contains the following information:
n
Flag that indicates whether to delete the desktop virtual machine if it exists
VMware, Inc.
35
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.44.172,snapshot1,TRUE
linux-003,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
linux-004,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
linux-005,Ubuntu1204x64,linuxagent,datastore1,10.117.44.172,snapshot1,TRUE
The sample scripts assume that the name of this input file is CloneVMs.csv and that the file is located in the
same folder as the scripts.
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 35. This script also interactively asks for the following information:
n
Script Content
<#
.SYNOPSIS
Create Clones from a Master VM
.DESCRIPTION
The Tool supports creation of Full clone and linked clone from Master VM
The parent VM is required for the linked-clone to work and the parent VMs file cannot be renamed
or Moved
.NOTES
#>
#------------------------- Functions ------------------------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)
{
36
VMware, Inc.
VMware, Inc.
37
{
write-host
exit
}
# Connect to the VC (Parameterize VC)
#Write-Host "DisConnecting Previous Connections"
#Disconnect-VIServer * -Confirm:$false -ErrorAction SilentlyContinue
Write-Host "Connecting to VC $vcAddress"
Connect-VIServer $vcAddress -ErrorAction Stop -user $vcAdmin -password $vcPassword
#Read input CSV file
$csvData = Import-CSV $csvFile
#$csvData = Import-CSV $csvFile header("VMName","Parentvm","CustomSpec","Datastore","Host","FromSnapshot","DeleteIfPresent")
foreach ($line in $csvData)
{
$destVMName=$line.VMName
$srcVM = $line.Parentvm
$cSpec = $line.CustomSpec
$targetDSName = $line.Datastore
$destHost = $line.Host
$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.VirtualMachineRelocateSpec
if ($CloneType -eq "linked")
{
$cloneSpec.Location.DiskMoveType =
[VMware.VIM.VirtualMachineRelocateDiskMoveOptions]::createNewChildDiskBacking
}
Write-Host "Using Datastore $targetDSName"
$newDS = Get-Datastore $targetDSName | Get-View
$CloneSpec.Location.Datastore = $newDS.summary.Datastore
Set-VM -vm $srcVM -snapshot (Get-Snapshot -vm $srcVM -Name $srcSnapshot) -confirm:$false
$cloneSpec.Snapshot = $vm.Snapshot.CurrentSnapshot
$cloneSpec.Location.Host = (get-vmhost -Name $destHost).Extensiondata.MoRef
$CloneSpec.Location.Pool = (Get-ResourcePool -Name Resources -Location (Get-VMHost -Name
$destHost)).Extensiondata.MoRef
# Start the Clone task using the above parameters
38
VMware, Inc.
Script Execution
The following messages are from an execution of the script:
PowerCLI C:\scripts> .\CloneVMs.ps1
Your vCenter address: 10.117.44.17
Your vCenter admin user name: administrator
Your vCenter admin user password: *******
Clone Type<"linked" or "Full"> : linked
Disable vSphere VM Console ("yes" or "no", recommend "yes") : yes
The time that the cloning process takes depends on the number of desktop machines and can range from
several minutes to a number of hours. To verify that the process is complete, from vSphere client, make sure
that the last desktop virtual machine is powered on and VMware Tools is running.
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 35. This script also interactively asks for the following information:
n
VMware, Inc.
39
Script Content
<#
.SYNOPSIS
Install Linux Agent
.DESCRIPTION
The Tool is to upload the Linux Agent installer tar ball to desktination VM and do installation
.NOTES
#>
#------------------------- Handle Input ------------------------"-----------------------------------------------------"
$acceptEULA = Read-Host 'Accept Linux View Agent EULA in tar bundle ("yes" or "no")'
if ($acceptEULA -ne "yes")
{
write-host -ForeGroundColor Red "You need accept the EULA with 'yes'(case sensitive)"
exit
}
$vcAddress = Read-Host 'Your vCenter address'
$vcAdmin = Read-Host 'Your vCenter admin user name'
$vcPassword = Read-Host 'Your vCenter admin user password' -AsSecureString
$vcPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($vcPassword))
"-----------------------------------------------------"
$hostAdmin = Read-Host 'Your ESXi host admin user name, such as root'
$hostPassword = Read-Host 'Your ESXi admin user password' -AsSecureString
$hostPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($hostPassword))
"-----------------------------------------------------"
$guestUser = Read-Host 'Your VM guest OS user name'
$guestPassword = Read-Host 'Your VM guest OS user password' -AsSecureString
$guestPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($guestPassword))
"-----------------------------------------------------"
$agentInstaller = Read-Host 'Type the View Agent tar ball path. Please take care the installer
arch'
#$csvFile = Read-Host 'Csv File '
$csvFile = '.\CloneVMs.csv'
40
VMware, Inc.
"-----------------------------------------------------"
$brokerAddress = Read-Host 'Type the View Connection Server address'
$brokerAdminName = Read-Host 'Type the View Connection Server Admin user name'
"Please type the View Connection Server Admin user password."
"Plase note that special character in password may not work with the script"
$brokerAdminPassword = Read-Host 'Your broker admin password' -AsSecureString
$brokerAdminPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($brokerAdminPassword))
$domainName = Read-Host 'Type the View Connection Server Admin user domain name'
#check if file exists
if (!(Test-Path $agentInstaller))
{
write-host -ForeGroundColor Red "installer File not found"
exit
}
#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.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($agentInstallerPa
th)));
$md5Hash = ($md5HashWithFormat.replace("-","")).ToLower();
return $md5Hash;
}
#------------------------- Main ------------------------#Get installer MD5Sum
$installerMD5Hash = GetSourceInstallerMD5;
#Connect to vCenter
Disconnect-VIServer $vcAddress -Confirm:$false
Connect-VIServer $vcAddress -user $vcAdmin -password $vcPassword
#Read input CSV file
$csvData = Import-CSV $csvFile
$destFolder = "/home/$guestUser/"
#Handle VMs one by one
foreach ($line in $csvData)
{
$VMName = $line.VMName
VMware, Inc.
41
42
VMware, Inc.
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.17
Your vCenter admin user name: administrator
Your vCenter admin user password: *******
-------------------------------------------------Your ESXi host admin user name, such as root: root
Your ESXi host admin user password: *******
-------------------------------------------------Your VM guest OS user name: ViewUser
Your VM guest OS user password: *******
-------------------------------------------------Type the View Agent tar ball path. Please take care of the installer arch: .\VMware-viewagentlinux-x86_64-x.y.z-1234567.tar.gz
-------------------------------------------------Type the View Connection Server address: 10.117.45.93
Type the View Connection Server Admin user name: viewadmin
Please type the View Connection Server Admin user password.
Please note that special character in password may not work with the script
Your broker admin password: *******
Type the View Connection Server Admin user domain name: domain1
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.
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 35. This script also interactively asks for the following information:
n
VMware, Inc.
43
Script Content
<#
.SYNOPSIS
Install Linux Agent
.DESCRIPTION
The Tool is to upload the Linux Agent installer tar ball to desktination VM and do installation
.NOTES
#>
#------------------------- Handle Input ------------------------"-----------------------------------------------------"
$acceptEULA = Read-Host 'Accept Linux View Agent EULA in tar bundle ("yes" or "no")'
if ($acceptEULA -ne "yes")
{
write-host -ForeGroundColor Red "You need accept the EULA with 'yes'(case sensitive)"
exit
}
$vcAddress = Read-Host 'Your vCenter address'
$vcAdmin = Read-Host 'Your vCenter admin user name'
$vcPassword = Read-Host 'Your vCenter admin user password' -AsSecureString
$vcPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($vcPassword))
"-----------------------------------------------------"
$hostAdmin = Read-Host 'Your ESXi host admin user name, such as root'
$hostPassword = Read-Host 'Your ESXi admin user password' -AsSecureString
$hostPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($hostPassword))
"-----------------------------------------------------"
$guestUser = Read-Host 'Your VM guest OS user name'
$guestPassword = Read-Host 'Your VM guest OS user password' -AsSecureString
$guestPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($guestPassword))
"-----------------------------------------------------"
$agentInstaller = Read-Host 'Type the View Agent tar ball path. Please take care the installer
arch'
#$csvFile = Read-Host 'Csv File '
$csvFile = '.\CloneVMs.csv'
#check if file exists
if (!(Test-Path $agentInstaller))
{
write-host -ForeGroundColor Red "installer File not found"
exit
}
#check if file exists
44
VMware, Inc.
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.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($agentInstallerPa
th)));
$md5Hash = ($md5HashWithFormat.replace("-","")).ToLower();
return $md5Hash;
}
#------------------------- Main ------------------------#Get installer MD5Sum
$installerMD5Hash = GetSourceInstallerMD5;
#Connect to vCenter
Disconnect-VIServer $vcAddress -Confirm:$false
Connect-VIServer $vcAddress -user $vcAdmin -password $vcPassword
#Read input CSV file
$csvData = Import-CSV $csvFile
$destFolder = "/home/$guestUser/"
#Handle VMs one by one
foreach ($line in $csvData)
{
$VMName = $line.VMName
$cmd = "rm -rf VMware-viewagent-linux-*"
Write-Host "Run cmd '$cmd' in VM '$VMName' with user '$guestUser'"
Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser
$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 md5sum
$cmd = "md5sum VMware-viewagent-linux-*"
Write-Host "Run cmd '$cmd' in VM '$VMName' with user '$guestUser'"
$output = Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName GuestUser $guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText
$cmd
if($output.Contains($installerMD5Hash))
VMware, Inc.
45
{
Write-Host $VMName": Uploaded installer's MD5Sum matches the local installer's MD5Sum";
Write-Host $VMName": Extract the installer and do installation";
$cmd = "tar -xzvf VMware-viewagent-linux-*.tar.gz"
Write-Host "Run cmd '$cmd' in VM '$VMName' with user '$guestUser'"
Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser
$guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText $cmd
$cmd = "sudo setenforce 0";
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
$cmd = "sudo killall /usr/lib/vmware/viewagent/VMwareBlastServer/VMwareBlastServer"
Write-Host "Stop VMwareBlastServer before upgrading: $cmd"
Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser
$guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText $cmd
$cmd = "cd VMware-viewagent-linux-* && sudo ./install_viewagent.sh -A yes"
Write-Host "Run upgrade cmd in VM '$VMName' with user '$guestUser'"
Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser
$guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText $cmd
$cmd = "rm -rf VMware-viewagent-linux-*"
Write-Host "Run cmd '$cmd' in VM '$VMName' with user '$guestUser'"
Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser
$guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText $cmd
$cmd = "sudo shutdown -r +5&"
Write-Host "Reboot to apply the View Agent upgrading"
Invoke-VMScript -HostUser $hostAdmin -HostPassword $hostPassword -VM $VMName -GuestUser
$guestUser -GuestPassword $guestPassword -Confirm:$false -ScriptType Bash -ScriptText $cmd
}
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.ps1
-------------------------------------------------Accept Linux View Agent EULA in tar bundle ("yes" or "no"): yes
Your vCenter address: 10.117.44.17
Your vCenter admin user name: administrator
Your vCenter admin user password: *******
--------------------------------------------------
46
VMware, Inc.
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.
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 35. This script also interactively asks for the following information:
n
Action to perform, which can be power-on, power-off, shut down guest, restart machine, or delete
virtual machine
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
.NOTES
#>
#--------------------- Functions -------------------function IsVMExists ($VMExists)
{
Write-Host "Checking if the VM $VMExists
VMware, Inc.
Exists"
47
[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.Name )
{
$Exists = $true
Write-Host "$VMExists is Exist"
}
}
return $Exists
}
function Delete_VM($VMToDelete)
{
Write-Host "Deleting VM $VMToDelete"
Get-VM $VMToDelete | where { $_.PowerState eq "PoweredOn" } | Stop-VM confirm:$false
Get-VM $VMToDelete | Remove-VM DeleteFromDisk confirm:$false
}
#------------------ Handle input --------------------"-----------------------------------------------------"
$vcAddress = Read-Host 'Your vCenter address'
$vcAdmin = Read-Host 'Your vCenter admin user name'
$vcPassword = Read-Host 'Your vCenter admin user password' -AsSecureString
$vcPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStrin
gToBSTR($vcPassword))
"-----------------------------------------------------"
#$csvFile = Read-Host 'Csv File '
$action = Read-Host 'Select action: 1). Power On 2). Power Off 3) Shutdown VM Guest 4). Restart
VM 5). Restart VM Guest 6). Delete VM'
$sleepTime = Read-Host 'Wait time (seconds) between each VM'
"-----------------------------------------------------"
switch ($action)
{
1
{
"Your selection is 1). Power On"
}
2
{
"Your selection is 2). Power Off"
}
3
{
"Your selection is 3) Shutdown"
}
4
{
"Your selection is 4). Restart VM"
}
5
48
VMware, Inc.
{
"Your selection is 5). Restart VM Guest"
}
6
{
"Your selection is 6). Delete VM"
}
default
{
"Invalid selection for action: $action"
exit
}
}
$csvFile = '.\CloneVMs.csv'
#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 = Import-CSV $csvFile
foreach ($line in $csvData)
{
$VMName = $line.VMName
switch ($action)
{
1
{
Get-VM $VMName | Start-VM -Confirm:$false
}
2
{
Get-VM $VMName | Stop-VM -Confirm:$false
}
3
{
Get-VM $VMName | Shutdown-VMGuest -Confirm:$false
}
4
{
Get-VM $VMName | Restart-VM -Confirm:$false
}
5
{
Get-VM $VMName | Restart-VMGuest -Confirm:$false
VMware, Inc.
49
}
6
{
if (IsVMExists ($VMName))
{
Delete_VM ($VMName)
}
}
default{}
}
Start-Sleep -s $sleepTime
}
Disconnect-VIServer $vcAddress -Confirm:$false
exit
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). Delete VM: 1
Wait time (seconds) between each VM: 20
For the operations power on, reatart VM, and restart VM guest, specify a wait time between virtual
machines of at least 20 seconds to avoid a boot storm situation, which might cause some operations to fail.
50
VMware, Inc.
Script Input
The input file is of type csv and contains the names of the machines to be deleted. The following example
shows what the input file may contain.
MachineName
linux-001
linux-002
linux-003
The sample script assumes that the name of this input file is DeleteMachineItems.csv and that the file is
located in the same folder as the scripts.
Script Content
<#
bulk Delete registered machine items from broker LDAP database.
#>
$csvFile = '.\DeleteMachineItems.csv'
#check if file exists
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.Children)
{
$machineName = $child.get("pae-DisplayName");
if(IsNameInCsv($machineName))
{
$machineAttributes = $child | get-member;
$machineAttributes = $machineAttributes -join ' ';
if ($machineAttributes -like "*pae-MemberDNOf*")
{
$desktopPool = $child.get("pae-MemberDNOf");
Write-Host "Skip $machineName, which is included by desktop pool $desktopPool";
VMware, Inc.
51
}
else
{
Write-Host "Delete $machineName, which is in csv file and not included by any desktop
pool";
$child.distinguishedName;
$child.DeleteObject(0);
}
}
else
{
Write-Host "Skip $machineName, which is not in csv file";
}
Write-Host '--------------------------------------';
}
52
VMware, Inc.
After you deploy Horizon 6 for Linux desktops, you can manage, uninstall, and troubleshoot the virtual
machines in your deployment.
This chapter includes the following topics:
n
VMware, Inc.
53
Click Remove.
If users are logged in to the unmanaged machine-based desktops, choose whether to terminate the
sessions or let the sessions remain active.
Option
Description
Leave active
Active sessions remain until the user logs off. View Connection Server
does not keep track of these sessions.
Terminate
Click OK.
Click OK to confirm.
54
Verify that the machine was removed from the desktop pool and from Horizon 6 . See Remove an
Unmanaged Machine from a Manual Desktop Pool, on page 53 and Remove Registered Machines
from View, on page 54.
VMware, Inc.
Procedure
1
Open a terminal window on the virtual machine and run the View Agent uninstall script.
For example:
sudo /usr/lib/vmware/viewagent/bin/uninstall_viewagent.sh
The script stops View Agent processes, deletes the View Agent service, and deletes the View Agent
installation directory, /usr/lib/vmware/viewagent.
2
Manually delete the Horizon 6 for Linux configuration files, located in the /etc/vmware/ directory.
If you intend to reinstall View Agent (for example, to upgrade to a later View Agent version), you do
not have to delete these configuration files.
delete
delete
delete
delete
/etc/vmware/viewagent-machine.cfg
/etc/vmware/viewagent-config.txt
/etc/vmware/jms
/etc/vmware/ssl
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
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.
If the configuration files and registered machine name were removed, familiarize yourself with the
steps for performing a fresh installation of View Agent. See Install View Agent on a Linux Virtual
Machine, on page 15.
Procedure
n
To reinstall with an existing Horizon 6 for Linux configuration, you can run the View Agent installation
script without parameters.
sudo ./install_viewagent.sh
The View Agent installer reuses the existing configuration files and machine registration in View
Connection Server. The installer does not register the machine again.
n
To reinstall with a new Horizon 6 for Linux configuration, run the View Agent installation script with
the required parameters.
The installation steps are the same as those in a fresh installation. The installer registers the machine
with View Connection Server.
VMware, Inc.
55
Edit the file and add the following line to enable the lossless PNG mode.
RemoteDisplay.alwaysLossless=TRUE
Restart the VMwareBlastServer service by logging out of the Linux remote desktop and connecting to the
Linux desktop again.
On the ESXi host, add the following line to the Linux virtual machine's vmx file.
RemoteDisplay.maxConnections = "0"
The vSphere console display remains blank even when you connect to the virtual machine when the
user is logged out of the desktop.
56
VMware, Inc.
where x.x is the product version and yyyyyyy is the build number.
n
Location
/usr/lib/vmware/viewagent
Logs
/var/log/vmware/
/etc/vmware/viewagent-config.txt
Machine configuration
/etc/vmware/viewagent-machine.cfg
VMware, Inc.
57
Log in to the Linux virtual machine as a user with the required privileges.
The script generates a tarball that contains the DCT bundle. For example:
ubuntu-12-vdm-sdct-20150201-0606-agent.tgz
The tarball is generated in the directory from which the script was executed (the current working directory).
The View Connection Server FQDN, domain name, user name, or password that was provided during
View Agent installation was incorrect.
The View administrator user does not have the Agent Registration Administrators or Administrators
role in View Administrator. Specifically, the Register Agent privilege is required to register View Agent
with View Connection Server. Agent Registration Administrators is a restricted role that provides this
minimum privilege.
The View administrator password contains a special character, such as $, that was not escaped with a
backslash.
Reversible password encryption was not enabled on the Windows Server 2012 or 2012 R2 Active
Directory (AD) server.
Solution
58
Verify that you have the correct View Connection Server FQDN, domain name, user name, and
password.
Verify that the View administrator user has the privileges to allow View Agent registration.
a
In the Administrators and Groups tab, select the View administrator user that you provided during
View Agent installation.
Verify that the user has the Agent Registration Administrators or Administrators role.
VMware, Inc.
If the View administrator password includes a special character, escape the special character with a
backslash.
For example: ab\$cdef
On the Linux guest operating system, open the View Agent registration log.
/usr/lib/vmware/viewagent/viewagent-registration.log
If the View Agent registration log reports LDAP errors, and a message asks if reversible password
encryption was enabled on a Windows Server 2012 or Windows Server 2012 R2 Active Directory (AD)
server, enable reversible password encryption.
a
Right-click the View Admin account, or create a new Linux View Agent account, and select
Properties.
In Account options, select the Store password using reversible encryption setting.
Look for messages that indicate the hostname of the View Connection Server instance cannot be
resolved.
For example:
2015-01-31T09:21:33.516Z DEBUG <JMS Handler for:svohraUb12x6> [JmsManager]
Using connection broker sm-15q1-broker.myDomain.com
2015-01-31T09:21:33.518Z DEBUG <JMS Handler for:svohraUb12x6> [JmsManager]
Unable to resolve hostname for sm-15q1-broker.myDomain.com
Make sure the DNS service is configured properly on the Linux machine.
The steps for configuring DNS vary depending on the Linux distribution and release. For instructions,
consult the documentation for your Linux distribution.
VMware, Inc.
59
As a workaround, you can manually add the View Connection Server FQDNs to the /etc/hosts file on
the Linux machine. However, this method is not recommended for production use. The proper solution
is to configure the DNS service so that the Linux machine can resolve the View Connection Server
FQDNs.
After you take these steps, ping the View Connection Server hostnames to verify that they can be
resolved. For example:
ping sm-15q1-broker.myDomain.com
If the problem continues, make sure that the system hostname of the Linux machine is resolvable.
For example, on CentOS you might take the following steps:
a
NOTE If you specify the DNS server on the Linux machine by manually editing the /etc/resolv.conf file,
the setting might become lost in some Linux distributions. The setting is preserved if you specify the DNS
server in the /etc/hosts file. For complete instructions for configuring DNS and the hostname, consult the
documentation for your Linux distribution and release.
On the Linux virtual machine, open a terminal window and stop and restart the View Agent service.
sudo service viewagent <stop/start/restart>
60
Install the X11 Simple VNC server on the virtual machine and verify that the X session is active over
VNC.
VMware, Inc.
VMware, Inc.
61
62
VMware, Inc.
Index
B
bulk deployment
create a virtual machine template for
cloning 34
input file for sample scripts 35
overview 33
D
desktop pool creation, Linux virtual machines 17
F
firewalls, Linux desktops 61
N
NVIDIA GRID vGPU
configuring a shared PCI device 21
configuring RHEL 6.6 19
installing the VIB for Linux desktops 20, 29
virtual GPU Types 22
NVIDIA display driver
installing on RHEL 6.6 22, 26
verify the installation 24, 28
glossary 5
H
Horizon 6 for Linux
bulk deployment 33
gathering information 57
reinstalling 55
troubleshooting View Agent that is not
responding 60
uninstalling 54
Horizon for Linux
reinstalling 53
uninstalling 53
I
install_viewagent.sh, command usage and
options 16
intended audience 5
L
left-handed mouse, Ubuntu desktops 56
Linux installation
troubleshooting 57
View Agent fails to register 58
View Agent is unreachable 59
Linux systems
adding to desktop pools 17
administering 53
collecting diagnostic information 58
configuring the firewall 61
desktop features 7
desktops 5
overview of desktop setup steps 8
VMware, Inc.
P
physical computers, removing from a pool 53
power operations from vSphere, Linux
desktops 56
R
registered machines
removing 54
removing from View 54
removing registered machines 54
RHEL
configuring for vDGA 25
configuring for vSGA 29
configuring for NVIDIA GRID vGPU 19
S
sample script
to bulk delete desktop machines 50
to clone desktop machines 36
to install View Agent 39
to perform operations on VMs 47
to upgrade View Agent 43
sample scripts, input file 35
U
unmanaged machines, removing from a pool 53
63
V
vDGA
adding PCI device to a Linux machine 26
enabling DirectPath I/O on a host 25
vDGA (Virtual Dedicated Graphics Acceleration)
for Linux machines 19
for RHEL 6.6 25
View Agent
installing on a Linux virtual machine 15
Linux installation command options 16
Linux operating system requirements 9
reinstalling on a Linux machine 55
uninstalling on a Linux machine 54
upgrading on a Linux virtual machine 18
virtual machines, creating for Linux desktops 12
VMware Tools, configuring on a Linux guest 13
vSGA
configuring 3D settings on a Linux video
card 30
for RHEL 7.1 29
installing the VIB for Linux desktops 20, 29
verify on a Linux machine 31
vSphere console, suppress display 56
64
VMware, Inc.