Setting Up for Linux Desktops

Table Of Contents
Sample Script to Upload Configuration Files to Linux Virtual Machines
Using SSH
You can customize and use the following sample script to upload the conguration les config and
viewagent-custom.conf to multiple Linux virtual machines (VMs). This script uses SSH to run commands on
the Linux VMs.
To copy and paste the script content without page breaks, use the HTML version of this topic, available from
the Horizon 7 documentation page at hps://www.vmware.com/support/pubs/view_pubs.html.
Script Input
This script reads one input le, which is described in “Input File for the Sample PowerCLI Scripts to Deploy
Linux Desktops,” on page 69. This script also interactively asks for the following information:
n
IP address of the vCenter Server
n
Administrator login name for the vCenter Server
n
Administrator password for the vCenter Server
n
User login name for the Linux VM
n
User password for the Linux VM
Script Content
<#
Upload the configuration files config and viewagent-custom.conf to Linux VMs using SSH
#>
#------------------------- 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.Marshal]::SecureStrin
gToBSTR($input))
}
else
{
$input = Read-Host
}
[Console]::ResetColor()
return $input
}
function Check_SSH_Client
{
Param($IsPlink, $IsPSCP)
if ($IsPlink)
{
Chapter 8 Bulk Deployment of Horizon 7 for Manual Desktop Pools
VMware, Inc. 83