Horizon 6 brought us many exciting changes. One of the more memorable ones is the addition of support for certified Linux Guests. At the time of this writing, Horizon 6 supports RHEL 6.6, Ubuntu 12.04, CentOS 6.6, and Neoukylin 6/6U1.
NOTE: newer versions may work just fine, but aren't certified to work. Meaning, if you want VMware Support to back you up, you should probably stick with the versions listed above.
To get started using Linux with your VDI implementation, make sure you have the prereqs:
- vSphere 5.5 U2 or vSphere 6.0 and later
- Horizon 6.1.1 or later
- Horizon Client 3.4 or later
- Note that Zero and mobile are not supported at this time
- First, let's build the template VM.
- After it's installed, run Ubuntu's Update Manager and get the system fully patched (be sure to decline the 14.04 dist upgrade)
- Now we'll install VMware Tools
- Right click VM > All vCenter Actions > Guest OS > Install VMware Tools
- Click Mount
- Once mounted, you should see a folder pop up
- I like to copy the VMwareTools-9*.tar.gz file to the Desktop.
- Right click the .tar.gz and choose Copy to > Desktop
- Right click the .tar.gz on the desktop and choose Extract Here
- Open Terminal, change directory into the folder, and run vmware-install.pl
To accept defaults, hit Enter for each question unless you understand what you're customizing. - Reboot Ubuntu
- Ensure DNS is working to and from the View Connection Server
- Proceed to building a manual pool or bulk linked clone pool below.
Building a manual Pool
- Now we're ready to install the Linux View Agent!
- NOTE: if using Windows Server 2012/R2 AD, follow the step 8 on page 11 from this doc
- NOTE: if your Ubuntu VM doesn't have internet access, follow step 9 on page 12 from the above doc
- Unpack the tar ball, and run install_viewagent.sh -b -d -u -p appropriately:
- Reboot Ubuntu
- Back in the View Admin page, ensure the VM is registered to View
- In the View Admin page, create a new Manual Desktop Pool and add the VM.
- NOTE: This pool can only contain Linux VMs
Building a bulk Linked Clone pool
Building a Linux linked clone pool is not quite as simple as creating a Windows linked clone pool (yet .. crossing fingers). Essentially we automate the cloning process with PowerCLI, then add the created linked clones to a manual pool within View.
- Create a View Administrative user (viewuser) in the Ubuntu Guest OS. This account is dedicated for installing the View Agent.
- Shutdown the VM and take a vCenter Snapshot
- Build the guest customization script
- From vSphere Web Client Home page, click Rules and Profiles > Customization Specification Manager
- Click the Create a New Specification button
- Select Linux for the target OS and enter your desired input
- Note the specification name you entered as this will be referenced in your CloneVMs.csv file later
- On your PowerCLI machine, create a folder to store the Horizon Linux PowerCLI scripts
- Download these three files to your folder (Sometimes my file server is down for maintenance): CloneVMs.csv, CloneVMs.ps1 and InstallAgent.ps1. If you'd rather copy the text from the official VMware docs, you'll want to copy it from the HTML version here. You'll also want to include the Linux Agent installer in your folder for later.
- Customize CloneVMs.csv to match the details of your environment - in my file, I'm only building 2 VMs
VMName,Parentvm,CustomSpec,Datastore,Host,FromSnapshot,DeleteIfPresent linux-001,Ubuntu-Template,linuxagent,share,192.168.1.174,snap1,TRUE linux-002,Ubuntu-Template,linuxagent,share,192.168.1.174,snap1,TRUE
Once this file is tweaked to match your environment, we can starting running the PowerCLI scripts
- Launch PowerCLI and change directory into the folder we created containing the scripts
- Invoke the CloneVMs.ps1 script and answer the prompts
You should start seeing the clones show up in vCenter - Once the linked clones have been created, we'll run the Agent Installation script
- If you run into any errors, check out the troubleshooting section below.
- Assuming this completes successfully, you should see the machines show up as registered VMs in View Administrator: View Configuration > Registered Machines > Other
NOTE: at this point you shouldn't see a Pool assigned already like my screenshot. We'll perform that next - Now let's create a manual pool to add our freshly baked Ubuntu Linked Clones
- Catalog > Desktop Pools > Add
- Select Manual Desktop Pool
- Pick your assignment preferences
- On Machine Source page, choose Other Sources
- After selecting your VMs, don't change the Remote Display Protocol - it needs to be left default.
- NOTE: Don't add Windows VMs to this pool, it will cause the Linux machines to become unavailable
- Victory! Ensure you're on the latest Horizon Client before connecting
Troubleshooting VM cloning and Agent install
When running the InstallAgent.ps1 script, you see the error
sudo: no tty present and no askpass program specified
Sorry, try again
Sorry, try again
:: Double check your sudoers file we edited earlier. There is likely a typo, or the username wasn't entered in all lowercase.
When running InstallAgent.ps1 you see the error
Failed to authenticate with the guest operating system
:: Verify password is correct. Check username is lowercase in script as that's the default case for new accounts
When running InstallAgent.ps1 you see the errorHostname not resolvable, terminating installation
Ensure host is registered with name service or listed in hosts file
:: Ensure your Custom Specification file is properly referenced and the vm naming is correct
View Administrator shows VMs as Agent Unreachable
:: Check out the official troubleshooting doc for this one here.
Failed to authenticate with the guest operating system
:: Verify password is correct. Check username is lowercase in script as that's the default case for new accounts
When running InstallAgent.ps1 you see the errorHostname not resolvable, terminating installation
Ensure host is registered with name service or listed in hosts file
:: Ensure your Custom Specification file is properly referenced and the vm naming is correct
View Administrator shows VMs as Agent Unreachable
:: Check out the official troubleshooting doc for this one here.
Ryan, what does "NOTE: if using Windows Server 2012/R2 AD, follow the step 8 on page 11 from this doc" refer to?
ReplyDeleteHi Jack. The text "this doc" should link to the official Linux Install Guide. Page 11 covers Preparing a Linux Guest for Remote Desktop Access, and this step has you enable reversible password encryption if you have Active Directory 2012 or 2012 R2.
ReplyDeleteHello Sir,
ReplyDeleteI have urgent requirement of scripted deployment of 500 Ubuntu linux machines for a open source project from a customer, The above article published by you provides fantastic information about the linux VDI deployment and which would actually meet my requirement. The sad part is that the scripts hosted on the cloud are not available for download. It would be greatly appreciated if you can share the scripts on the below email
Links have been updated, thank you for letting me know. Good luck with your deployment!
ReplyDeleteI'm having an issue installing the agent. It seems like its timing out waiting for input. I see 'Are you sure to install linux agent (y/n)? Invalid input and installation stopped.' The files are copied to the vm's, but the vm's are not registed. Any help is appreciated. Great article by the way.
ReplyDelete[…] of the more popular posts on That Virtual Boy has been Deploying Linux VDI Pools with Horizon 6. That post was written when Linux and VDI were just getting acquainted. Horizon has grown up a bit […]
ReplyDeleteadd '-A yes' before the command ./install_viewagent.sh
ReplyDeleteexample:
$cmd = "cd VMware-horizonagent-linux-* && ./install_viewagent.sh -A yes -n $VMName -b $brokerAddress -d $domainName -u $brokerAdminName -p $brokerAdminPassword"
Write-Host "Run install cmd in VM '$VMName' with user '$guestUser'"