This guide details the steps you need to take when preparing remote access to virtual desktops using technology offered by Citrix.
It will be useful for those who have recently become familiar with desktop virtualization technology, as it is a collection of useful commands collected from ~ 10 manuals, many of which are available on the sites of Citrix, Nvidia, Microsoft, after authorization.
This implementation contains the steps for preparing remote access to virtual machines (VMs) with Nvidia Tesla M60 graphics accelerators and the Centos 7 operating system.
So, let's begin.
Preparing a Hypervisor for Hosting Virtual Machines
How to download and install XenServer 7.4?
How to add XenServer to Citrix XenCenter?
How to download and install Nvidia driver?
How to change Nvidia Tesla M60 mode?
How to mount storage?
Xen Server 7.4
Download Link
Let's install XenServer.iso on a server with 4x NVIDIA Tesla M60 in the regular way. In my case iso is mounted via IPMI. For Dell servers, the BMC is managed through IDRAC. The installation steps are almost the same as installing Linux-like operating systems.
My address for XenServer with GPU is 192.168.1.100
Install XenCenter.msi on the local computer from which we will manage hypervisors and virtual machines. Let's add a server with a GPU and XenServer there by clicking on the "Server" tab, then "Add". Enter the username and password root, specified during the installation of XenServer.
In XenCenter, after clicking on the name of the added hypervisor, the "Console" tab will be available. In the menu, select "Remote Service Configuration" and enable SSH authorization - "Enable / Disable Remote Shell".
Nvidia driver
I will give vent to my emotions and say that for all the time I have been working with vGPU, I have never visited the site
Download zip from vGPU, as well as GPUMode Change Utility:
NVIDIA-GRID-XenServer-7.4-390.72-390.75-391.81.zip
NVIDIA-gpumodeswitch-2020-01.zip
We follow the versions. The name of the downloaded archive indicates the version of the appropriate NVIDIA drivers that can be installed on virtual machines in the future. In my case it is 390.72.
Transfer zips to XenServer and unpack.
Change the GPU mode and install the vGPU driver
$ cd NVIDIA-gpumodeswitch-2020-01
$ gpumodeswitch --listgpumodes
$ gpumodeswitch --gpumode graphics
$ cd ../NVIDIA-GRID-XenServer-7.4-390.72-390.75-391.81
$ yum install NVIDIA-vGPU-xenserver-7.4-390.72.x86_64.rpm
$ reboot
Mount storage
Set up a shared directory using NFS on any computer on the network.
$ yum install epel-release
$ yum install nfs-utils libnfs-utils
$ systemctl enable rpcbind
$ systemctl enable nfs-server
$ systemctl enable nfs-lock
$ systemctl enable nfs-idmap
$ systemctl start rpcbind
$ systemctl start nfs-server
$ systemctl start nfs-lock
$ systemctl start nfs-idmap
$ firewall-cmd --permanent --zone=public --add-service=nfs
$ firewall-cmd --permanent --zone=public --add-service=mountd
$ firewall-cmd --permanent --zone=public --add-service=rpc-bind
$ firewall-cmd --reload
$ mkdir -p /nfs/store1
$ chmod -R 777 /nfs/store1
$ touch /nfs/store1/forcheck
$ cat /etc/exports
...
/nfs/store1 192.168.1.0/24(rw,async,crossmnt,no_root_squash,no_all_squash,no_subtree_check)
$ systemctl restart nfs-server
In XenCenter, select XenServer and on the "Storage" tab, select "New SR". Specify the type of storage - NFS ISO. The path must point to an NFS shared directory.
Citrix Master Image based on Centos 7
How to create a virtual machine with Centos 7?
How to prepare a virtual machine to create a directory?
Centos 7 image
Using XenCenter, we will create a virtual machine with a GPU. In the "VM" tab, click "New VM".
Select the required options:
VM template - Other install media
Name-template
Install from ISO library - Centos 7 (
Number of vCPUs - 4
Topology - 1 socket with 4 cores per socket
Memory - 30 Gb
GPU type - GRID M60-4Q
Use this virtual disk - 80 Gb
Network
Once created, the virtual machine will appear in the vertical list on the left. Click on it and go to the "Console" tab. Let's wait for the Centos 7 installer to load and perform the necessary steps to install the OS with the GNOME shell.
Preparing the Image
Preparing the image with Centos 7 took me a long time. Subsequently, a set of scripts was obtained that facilitates the initial configuration of Linux and allows you to create a catalog of virtual machines using Citrix Machine Creation Services (MCS).
The DHCP server installed on ws-ad assigned the new virtual machine an IP address of 192.168.1.129.
Below are the basic settings.
$ hostnamectl set-hostname template
$ yum install -y epel-release
$ yum install -y lsb mc gcc
$ firewall-cmd --permanent --zone=dmz --remove-service=ssh
$ firewall-cmd --permanent --zone=external --remove-service=ssh
$ firewall-cmd --permanent --zone=home --remove-service=ssh
$ firewall-cmd --permanent --zone=home --remove-service=mdns
$ firewall-cmd --permanent --zone=home --remove-service=samba-client
$ firewall-cmd --permanent --zone=home --remove-service=dhcpv6-client
$ firewall-cmd --permanent --zone=internal --remove-service=dhcpv6-client
$ firewall-cmd --permanent --zone=internal --remove-service=samba-client
$ firewall-cmd --permanent --zone=internal --remove-service=mdns
$ firewall-cmd --permanent --zone=internal --remove-service=ssh
$ firewall-cmd --permanent --zone=public --remove-service=ssh
$ firewall-cmd --permanent --zone=public --remove-service=dhcpv6-client
$ firewall-cmd --permanent --zone=work --remove-service=dhcpv6-client
$ firewall-cmd --permanent --zone=work --remove-service=ssh
$ firewall-cmd --permanent --zone=public --add-service=ssh
$ firewall-cmd --complete-reload
In XenCenter, in the "Console" tab, mount guest-tools.iso to the virtual machine's DVD drive and install XenTools for Linux.
$ mount /dev/cdrom /mnt
$ /mnt/Linux/install.sh
$ reboot
When setting up XenServer, we used the NVIDIA-GRID-XenServer-7.4-390.72-390.75-391.81.zip archive downloaded from the NVIDIA website, which, in addition to the NVIDIA driver for XenServer, contains the NVIDIA driver we need for vGPU clients. Download and install it on the VM.
$ cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rhgb quiet modprobe.blacklist=nouveau"
GRUB_DISABLE_RECOVERY="true"
$ grub2-mkconfig -o /boot/grub2/grub.cfg
$ wget http://vault.centos.org/7.6.1810/os/x86_64/Packages/kernel-devel-3.10.0-957.el7.x86_64.rpm
$ yum install kernel-devel-3.10.0-957.el7.x86_64.rpm
$ reboot
$ init 3
$ NVIDIA-GRID-XenServer-7.4-390.72-390.75-391.81/NVIDIA-Linux-x86_64-390.75-grid.run
$ cat /etc/nvidia/gridd.conf
ServerAddress=192.168.1.111
ServerPort=7070
FeatureType=1
$ reboot
Download Linux Virtual Delivery Agent 1811 (VDA) for Centos 7. Download Link
$ yum install -y LinuxVDA-1811.el7_x.rpm
$ cat /var/xdl/mcs/mcs.conf
#!/bin/bash
dns1=192.168.1.110
NTP_SERVER=some.ntp.ru
AD_INTEGRATION=winbind
SUPPORT_DDC_AS_CNAME=N
VDA_PORT=80
REGISTER_SERVICE=Y
ADD_FIREWALL_RULES=Y
HDX_3D_PRO=Y
VDI_MODE=Y
SITE_NAME=domain.ru
LDAP_LIST=ws-ad.domain.ru
SEARCH_BASE=DC=domain,DC=ru
START_SERVICE=Y
$ /opt/Citrix/VDA/sbin/deploymcs.sh
$ echo "exclude=kernel* xorg*" >> /etc/yum.conf
Let's create a Machine Catalog and a Delivery group in Citrix Studio. Before doing this, you must install and configure Windows Server.
Windows Server with Domain Controller
How to download and install Windows Server 2016?
How to install Windows Server components?
How to set up Active Directory, DHCP and DNS?
Windows server 2016
Since a Windows Server virtual machine (VM) does not need a GPU, we will use a non-GPU server as a hypervisor. By analogy with the description above, we will install another XenServer for hosting system virtual machines.
After that, we will create a virtual machine for Windows Server with Active Directory.
Download Windows Server 2016 from the site
Let's create a virtual machine using XenCenter. In the "VM" tab, click "New VM".
Select the required options:
VM template - Windows Server 2016 (64-bit)
Name - ws-ad.domain.ru
Install from ISO library - WindowsServer2016.iso, select from the mounted NFS ISO storage.
Number of vCPUs - 4
Topology - 1 socket with 4 cores per socket
Memory - 20 Gb
GPU type - none
Use this virtual disk - 100 Gb
Network
Once created, the virtual machine will appear in the vertical list on the left. Click on it and go to the "Console" tab. Let's wait for the Windows Server installer to load and perform the necessary steps to install the OS.
Install XenTools in the VM. Right-click on the VM, then "Install Citrix VM Tools ...". After that, the image will be mounted, which you need to run and install XenTools. At the end of the installation, you will need to reboot the VM.
Let's configure the network adapter:
IP address - 192.168.1.110
Mask - 255.255.255.0
Gateway - 192.168.1.1
DNS1 - 8.8.8.8
DNS2 - 8.8.4.4
If Windows Server is not activated, then we will activate it. The key can be taken in the same place where the image was downloaded from.
[PowerShell]$ slmgr -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Let's set the computer name. In my case it is ws-ad.
Installing components
In Server Manager, select "Add Roles and Features". Note the DHCP Server, DNC Server, and Active Directory Domain Services to install. Check the "Restart automatically" checkbox.
Configuring Active Directory
After rebooting the VM, click "Raise this server to the level of a domain controller" and add a new domain.ru forest.
Setting up a DHCP server
On the top panel of the Server Manager, click on the exclamation mark to save the changes when installing the DHCP server.
Let's move on to the DHCP server settings.
Let's create a new area 192.168.1.120-130. We don't change the rest. Select "Configure DHCP settings now" and enter the IP address ws-ad (192.168.1.110) as the gateway and DNS, which will be specified in the settings of the network adapters of the virtual machines from the catalog.
Setting up a DNS server
Let's move on to the DNS server settings.
Let's create a new forward lookup zone - primary zone, for all DNS servers in the domain.ru domain. We don't change anything else.
Let's create a new reverse lookup zone by selecting similar options.
In the properties of the DNS server, in the "Advanced" tab, check the "Disable recursion" checkbox.
Create a test user
Let's go to the "Active Directory Administration Center"
In the "Users" section on the right, click "Create". Enter a name, for example test, and click "OK" at the bottom.
Select the created user and select "Reset password" in the vertical menu on the right. Leave the "Require password change at next login" checkbox.
Windows Server with Citrix Delivery Controller
How to download and install Windows Server 2016?
How to download and install Citrix Delivery Controller?
How to install and configure Citrix License Manager?
How to install and configure NVIDIA License Manager?
Windows server 2016
Since a Windows Server virtual machine (VM) does not need a GPU, we will use a non-GPU server as a hypervisor.
Download Windows Server 2016 from the site
Let's create a virtual machine using XenCenter. In the "VM" tab, click "New VM".
Select the required options:
VM template - Windows Server 2016 (64-bit)
Name-ws-dc
Install from ISO library - WindowsServer2016.iso, select from the mounted NFS ISO storage.
Number of vCPUs - 4
Topology - 1 socket with 4 cores per socket
Memory - 20 Gb
GPU type - none
Use this virtual disk - 100 Gb
Network
Once created, the virtual machine will appear in the vertical list on the left. Click on it and go to the "Console" tab. Let's wait for the Windows Server installer to load and perform the necessary steps to install the OS.
Install XenTools in the VM. Right-click on the VM, then "Install Citrix VM Tools ...". After that, the image will be mounted, which you need to run and install XenTools. At the end of the installation, you will need to reboot the VM.
Let's configure the network adapter:
IP address - 192.168.1.111
Mask - 255.255.255.0
Gateway - 192.168.1.1
DNS1 - 8.8.8.8
DNS2 - 8.8.4.4
If Windows Server is not activated, then we will activate it. The key can be taken in the same place where the image was downloaded from.
[PowerShell]$ slmgr -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Let's set the computer name. In my case it is ws-dc.
Let's add a VM to the domain domen.ru, reboot and log in under the domain administrator account DOMENAdministrator.
Citrix delivery controller
Download Citrix Virtual Apps and Desktops 1811 on ws-dc.domain.ru. Download link
Mount the downloaded iso and run. Select "Citrix Virtual Apps and Desktops 7". Next, click "Get started". A reboot may be required.
In my case, it is enough to select the following components for installation:
Delivery Controller
Studio
License Server
StoreFront
We do not change anything else and click "Install". A reboot will be required more than once, after which the installation will continue.
As soon as the installation is completed, Citrix Studio, the Citrix entire household management environment, will launch.
Configuring Citrix Site
Let's select the first section of the three - Site setup. When configuring, specify the Site Name - domain.
In the "Connection" section, specify the data for connecting a hypervisor with a GPU:
connection address -
Username - root
Password -yourpassword
Connection Name - m60
Store management - Use storage local to the hypervisor.
Name for these resources is m60.
select networks.
Select a GPU type and group - GRID M60-4Q.
Configuring Citrix Machine Catalogs
When setting up the second section - Machine Catalogs, select Single-session OS (Desktop OS).
Master Image - select the prepared image of the virtual machine and the version of Citrix Virtual Apps and Desktops - 1811.
Select the number of virtual machines in the directory, for example 4.
Specify the scheme by which virtual machines will be named, in my case it is desktop##. In this case, 4 VMs named desktop01-04 will be created.
Machine Catalog name - m60.
Machine Catalog description - m60.
After creating a Machine Catalog with four VMs, they can be found in the XenCenter vertical list on the left.
Citrix Delivery Group
The third section starts by choosing the number of VMs to grant access to. I will list all four.
In the "Desktops" section, click "Add" to add a group of VMs to which we will provide access. Display name - m60.
Delivery group name - m60.
After setting up the three main sections, the main window of Citrix Studio will look something like this
Citrix license manager
Download the license file through your personal account on the site
In the vertical list on the left, select All Licensing Tools (Legacy). Let's go to the "Activate and Allocate Licenses" tab. Select Citrix VDA licenses and click Continue. Let's specify the name of our Delivery Controller - ws-dc.domain.ru and the number of licenses - 4. Click "Continue". Download the generated license file to ws-dc.domain.ru.
In the left vertical list of Citrix Studio, select the "Licensing" section. In the right vertical list, click "License Management Console". In the browser window that opens, enter the data for authorization of the domain user DOMENAdministrator.
In Citrix Licensing Manager, go to the "Install License" tab. To add a license file, select "Use downloaded license file".
Installing Citrix components involves using multiple virtual machines, one component per VM. In my case, all Citrix system services operate within the same VM. In this regard, I will note one bug, the correction of which was especially difficult for me.
If after rebooting ws-dc there are problems of a different nature, then I recommend that you first check the running services. Here is a list of Citrix services that should start automatically after the VM is rebooted:
SQL Server (SQLEXPRESS)
Citrix Configuration Service
Citrix Delegated Administration Service
Citrix Analytics
Citrix Broker Service
Citrix Configuration Logging Service
Citrix AD Identity Service
Citrix Host Service
Citrix App Library
Citrix Machine Creation Service
Citrix Monitor Service
Citrix Storefront Service
Citrix Trust Service
Citrix Environment Test Service
Citrix Orchestration Service
FlexNet License Server -nvidia
I ran into a problem that occurs when installing different Citrix services on the same VM. After the reboot, not all services start. It was too lazy to launch the entire chain one by one. The solution was hard to google, so I bring it here - you should change two parameters in the registry:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControl
Name : ServicesPipeTimeout
Value :240000
Name : WaitToKillServiceTimeout
Value : 20000
Nvidia license manager
Download the NVIDIA license manager for Windows through your personal account on the website
Let's install it on ws-dc. To do this, you first need to install
We will create a server, generate and download a license file in your personal account on the site
Using a browser, log in to the NVIDIA license manager web interface, available at
Active sessions using vGPU can be viewed in the "Licensed Clients" section.
Remote access to Citrix machine catalog
How to install Citrix Receiver?
How do I connect to a virtual desktop?
On a working computer, open a browser, in my case it is Chrome, and go to the address of the Citrix StoreWeb web interface
http://192.168.1.111/Citrix/StoreWeb
If Citrix Receiver is not installed yet, then click "Detect Receiver"
Read the license agreement carefully, download and install Citrix Receiver
After installation, return to the browser and click "Continue"
Next, a notification opens in Chrome browser, click "Open Citrix Receiver Launcher" and then "Detect again" or "Already installed"
When connecting for the first time, we will use the data of the test user test. Change the temporary password to a permanent one.
After authorization, go to the "Applications" tab and select the "M60" directory
Download the proposed file with the .ica extension. After double clicking on it, a window will open in Desktop Veiwer with the Centos 7 desktop
Source: habr.com