Release date: May 22th 2020
Welcome to my VMware Horizon series. In this session I will venture into the “somewhat unknown”, VMware Horizon 7 for Linux desktops. As I’m in no sense a Linux-expert, this has been planned for quite some while. I like the idea about an operating system that isn’t linked to one company, but rather is made as best possible by many great minds. VMware has a great guide to setting up Linux as a Horizon desktop, but I find it lacking in some areas, but this is probably most likely due to the fact that there are different ways of using the Linux-specific technology to achieve the same goals. VMware’s official documentation about setting up Linux in VMware Horizon is here: Setting Up Horizon 7 for Linux Desktops. I was careful to check out the system requirements before starting this session, and I’ll be using Ubuntu 18.04 for this. Beforehand I have verified that this is supported. For anyone that are venturing down the path of setting up Linux in a VMware Horizon environment, I would recommend reading the documentation beforehand carefully.
To complete this session, I have identified the following tasks that have to be completed.
- Deploy Virtual Machine
- Configure Virtual Machine
- Install Operating System
- Install Open VM Tools
- Configure Operating System
- USB Redirection
- Install and configure VMware Horizon Agent
- Integrate Linux with MS Active Directory
- Create Desktop Pool
- Add Domain Group to sudoers
- Mate Desktop and Greeter
Deploy Virtual Machine
Login to vSphere, select the cluster and choose “New Virtual Machine”, Next…
I give the Virtual machine a name, and select the location where the VM should to be placed, Next…
I select FreLab Cluster as my compute resources where the VM will be placed, Next…
Select the Storage on where the VM will be placed, in my case the Datastore Cluster, Next…
Select the compatibility. I have chosen to use the “ESXi 6.7 and later”, Next…
I select Linux as Guest OS Family and Ubuntu Linux (64-bit) as OS Version, Next…
Customize the hardware, in my case I added an extra vCPU, extended the memory to 4GB and hard disk to 50 GB thin provisioned, Next…
Under the second tab VM Options, I disable logging, select Boot Options and enable force BIOS setup. With this option enabled, I go straight into the BIOS of the VM after powering it on.
Check the installation summary and finish.
Configure Virtual Machine
When the VM is created, I first boot into BIOS and make the following modifications.
I launch the Web or Remote Console. In BIOS I disable all features that are unnecessary. In the Main-tab, all Diskette stations are disabled, which is OK.Next, I open the Advanced–tab.
Within the advanced section, select I/O Device Configuration. I don’t need any of the I/O Devices, so we disabled them all. Press ESC to return to the BIOS main screen. Select Boot-Tab
I change the boot-order as follows. When done I press ESC and F10. Save and exit
With the BIOS modifications done, I power off the VM, attach my Ubuntu-ISO and power on the virtual machine
Install Operating System
It is now time to install the Operating System. The ISO with the software is already attached to the VM and connected. The installation screen from Ubuntu is shown, I select “Install Ubuntu“, Enter…
The first thing I do is to select the language to be used during installation, Continue…
I will be doing a normal installation and I will download updates while installing Ubuntu, Continue…
I select “Erase Disk and install Ubuntu”, Install Now and Continue…
I select my location, Continue…
Next, I provide my credentials and computername, Continue…
The operating system is now installed with the settings I provided above
I click Restart Now once the installation is done
As I mentioned to begin with, I’m no Linux expert. Therefore I prefer to take some snapshots during the setup of Linux, which gives me the opportunity to roll back if I run into problems further into the set up. I will document at what point I take the snapshots below. All snapshots are taken with the VM shutdown.
SNAPSHOT: Base-installation complete
Install Open VM Tools
I power on the VM and proceed with installing Open VM Tools, as this is a prerequisite as stated by VMware. I launch Terminal and install Open VM Tools by running the following command: “sudo apt-get install -y open-vm-tools”
After a reboot, I verify the VMware Tools status
SNAPSHOT: Open-vm-tools installation complete
Configure Operating System
Before I continue, I check if there are any updates that I will need to install before I continue, I restart as needed.
After update is complete, disable Automatic Updates
SNAPSHOT: Ubuntu-update complete
As I don’t plan to be using USB redirection, this point don’t apply to me. BUT, for any of you who reads this post, and plan to use USB redirection, be aware that the VHCI Driver for USB redirection has to be installed before the VMware Horizon for Linux agent. A detailed description of the VHCI driver install can be found in VMware’s documentation here: System Requirements For Horizon 7 for Linux
Install and configure VMware Horizon Agent
Prior to downloading and installing VMware Horizon Agent, I must install the dependency packages as documented by VMware here: Install Dependency Packages for Horizon Agent
“sudo apt-get install python python-dbus python-gobject”
Next, I download the correct version of VMware Horizon agent for Linux from My VMware
I extract the downloaded tar file in Downloads
I launch installation of the Horizon Agent running this command: “sudo ./install_viewagent.sh”
During the installation there are several choices that can be made, but I choose to leave all settings default and reboot at the end
SNAPSHOT: Hz-agent-installation complete
Integrate Linux with MS Active Directory
Before I start the procedure to integrate my Ubuntu vm with Active Directory, I install OpenSSH using the following command: “sudo apt install openssh-server -y”. I can now use Putty to do the rest of the configuration.
With the VMware Horizon Agent installed, I proceed with installing PBIS using the following commands:
“sudo chmod 777 pbis-open-188.8.131.525.linux.x86_64.deb.sh”
“sudo reboot now”
SNAPSHOT: PBIS-installation complete
Next, I configure PBIS to access my Active Directory by inputting:
“sudo /opt/pbis/bin/domainjoin-cli join ad.admin.frelab.net administrator”
“sudo reboot now”
“sudo /opt/pbis/bin/config UserDomainPrefix AD”
“sudo /opt/pbis/bin/config AssumeDefaultDomain true”
“sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash”
“sudo /opt/pbis/bin/config HomeDirTemplate %H/%U”
“sudo reboot now”
After rebooting the system and logging back in again, I verify that PBIS is configured correctly by issuing the following commands:
“sudo pbis status”
“sudo /opt/pbis/bin/lwsm list”
Once I’m satisfied that PBIS is working correctly, I check to see if I can log in to my Linux desktop as an active directory user, firstname.lastname@example.org, by entering the following command:
SNAPSHOT: PBIS-config complete
Finally, I need to edit the following files to change some variables within them:
“sudo nano /etc/pam.d/common-session”
I add the following line: “session [success=ok default=ignore] pam_lsass.so”
To inform the VMware Horizon Agent that the Linux VM is domain joined using PBIS, I set the following option in the /etc/vmware/viewagent-custom.conf» file using the following command: «sudo nano /etc/vmware/viewagent-custom.conf»: OfflineJoinDomain=pbis
I can now reboot the VM, shutdown and create a snapshot to be used during the Desktop Pool creation below.
Create Desktop Pool
I login to VMware Horizon Admin Console and starte the Create new Desktop Pool Wizard. For this session it will be An Automated Desktop Pool
I choose Instant Clone, my vCenter, Next…
As I don’t have any way of roaming my users Linux settings, as of yet, I will be using Dedicated Assignment
I enter an ID and a Display name, Next…
I provide the provisioning details, Next…
I detail the vCenter configuration, Next…
I configure the connection settings, Next…
I select my Remote Display settings, Next…
I choose the Domain and Active Directory settings, Next…
I complete the New Desktop Pool wizard and entitle my test users, Submit…
The publishings starts immediately
Once the state changes to “Published”, I can verify that the desktops are available
When I log on with the VMware Horizon Client, I see that I now have access to a Ubuntu 18.04 Desktop Pool. I launch this shortcut
I run through the startup wizard and do a few adjustments to the user experience. When I log out of the desktop, I can now see that I have now been assigned a dedicated desktop from the Ubuntu 18.04 desktop pool instead.
Add Domain Group to sudoers
I will return to this topic at a later point in time.
Mate Desktop and Greeter
After doing some testing, I decided that I wanted to use the Mate desktop environment instead of the Ubuntu Classic. VMware have a good documentation of which desktop environments that are supported here: System Requirements For Horizon 7 for Linux Therefore I started up my template-vm again and made the following adjustments.
I installed the Mate Desktop Environment by running the following command: “sudo apt install ubuntu-mate-desktop”. During the installation I was prompted to select the default display manager, at this point I choose “gdm3” as this is what is supported by VMware.
I also changed the SSODesktopType in the /etc/vmware/viewagent-custom.conf file
I shut down my VM, took a new snapshot, and deployed this to my desktop pool. When I now tested logging back on, I automatically logged into the Mate Desktop.
And with that, I finally have a working Instant Clone Desktop Pool with Ubuntu 18.04 desktops.
Disclaimer: Every tips/tricks/posting I have published here, is tried and tested in different it-solutions. It is not guaranteed to work everywhere, but is meant as a tip for other users out there. Remember, Google is your friend and don’t be afraid to steal with pride! Feel free to comment below as needed.