VMware Horizon – Ubuntu 18.04 Linux Instant-clone Desktop-pool

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
  • Test
  • Add Domain Group to sudoers
  • Mate Desktop and Greeter

 

Deploy Virtual Machine

Login to vSphere, select the cluster and choose “New Virtual Machine”, Next…

Ubuntu-IC-01

 

I give the Virtual machine a name, and select the location where the VM should to be placed, Next…

Ubuntu-IC-02

 

I select FreLab Cluster as my compute resources where the VM will be placed, Next…

Ubuntu-IC-03

 

Select the Storage on where the VM will be placed, in my case the Datastore Cluster,  Next…

Ubuntu-IC-04

 

Select the compatibility. I have chosen to use the “ESXi 6.7 and later”, Next…

Ubuntu-IC-05

 

I select Linux as Guest OS Family and Ubuntu Linux (64-bit) as OS Version, Next…

Ubuntu-IC-06

 

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…

Ubuntu-IC-07

 

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.

Ubuntu-IC-08

 

Check the installation summary and finish.

Ubuntu-IC-10

 

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 Advancedtab.

Ubuntu-IC-11

 

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

Ubuntu-IC-12

Ubuntu-IC-13

 

I change the boot-order as follows. When done I press ESC and F10. Save and exit

Ubuntu-IC-14

Ubuntu-IC-15

 

With the BIOS modifications done, I power off the VM, attach my Ubuntu-ISO and power on the virtual machine

Ubuntu-IC-16

 

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…

Ubuntu-IC-17

 

The first thing I do is to select the language to be used during installation, Continue…

Ubuntu-IC-18

 

I will be doing a normal installation and I will download updates while installing Ubuntu, Continue…

Ubuntu-IC-19

 

I select “Erase Disk and install Ubuntu”, Install Now and Continue…

Ubuntu-IC-20

Ubuntu-IC-21

 

I select my location, Continue…

Ubuntu-IC-22

 

Next, I provide my credentials and computername, Continue…

Ubuntu-IC-23

Ubuntu-IC-24

 

The operating system is now installed with the settings I provided above

Ubuntu-IC-25

Ubuntu-IC-26

 

I click Restart Now once the installation is done

Ubuntu-IC-27

 

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”

Ubuntu-IC-28

Ubuntu-IC-29

 

After a reboot, I verify the VMware Tools status

Ubuntu-IC-30

 

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.

Ubuntu-IC-31

Ubuntu-IC-32

 

After update is complete, disable Automatic Updates

Ubuntu-IC-32_1

 

SNAPSHOT: Ubuntu-update complete

 

USB Redirection

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”

Ubuntu-IC-33

 

Next, I download the correct version of VMware Horizon agent for Linux from My VMware

CenOS-IC-51

I extract the downloaded tar file in Downloads

Ubuntu-IC-35

 

I launch installation of the Horizon Agent running this command: “sudo ./install_viewagent.sh”

Ubuntu-IC-36

 

During the installation there are several choices that can be made, but I choose to leave all settings default and reboot at the end

Ubuntu-IC-37

 

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 wget https://github.com/BeyondTrust/pbis-open/releases/download/8.5.7/pbis-open-8.5.7.385.linux.x86_64.deb.sh”

“sudo chmod 777 pbis-open-8.5.7.385.linux.x86_64.deb.sh”

“sudo ./pbis-open-8.5.7.385.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, hztest01@ad.admin.frelab.net, by entering the following command:

“su hztest01@ad.admin.frelab.net

 

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”

Ubuntu-IC-38

 

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

Ubuntu-IC-39

 

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

Ubuntu-IC-40

 

I choose Instant Clone, my vCenter, Next…

Ubuntu-IC-41

 

As I don’t have any way of roaming my users Linux settings, as of yet, I will be using Dedicated Assignment

Ubuntu-IC-42

 

I enter an ID and a Display name, Next…

Ubuntu-IC-43

 

I provide the provisioning details, Next…

Ubuntu-IC-44

 

I detail the vCenter configuration, Next…

Ubuntu-IC-45

 

I configure the connection settings, Next…

Ubuntu-IC-46

 

I select my Remote Display settings, Next…

Ubuntu-IC-47

 

I choose the Domain and Active Directory settings, Next…

Ubuntu-IC-48

 

I complete the New Desktop Pool wizard and entitle my test users, Submit…

Ubuntu-IC-49

 

The publishings starts immediately

Ubuntu-IC-50

Ubuntu-IC-51

 

Once the state changes to “Published”, I can verify that the desktops are available

Ubuntu-IC-52

Ubuntu-IC-53

 

Testing

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

Ubuntu-IC-54

 

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.

Ubuntu-IC-55

 

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.

Ubuntu-IC-57

Ubuntu-IC-58

 

I also changed the SSODesktopType in the /etc/vmware/viewagent-custom.conf file

Ubuntu-IC-59

Ubuntu-IC-60

 

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.

Ubuntu-IC-61

 

And with that, I finally have a working Instant Clone Desktop Pool with Ubuntu 18.04 desktops.

 

VMware Horizon View planning, deployment etc.

VMware’s official documentation: Setting Up Horizon 7 for Linux 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.