To support the Real-Time Audio-Video feature on a Linux machine, you must install the V4L2Loopback driver. The Real-Time Audio-Video feature redirects locally connected webcam and audio devices from the client system to the remote session.
You must install the V4L2Loopback driver on the Linux machine either before or after installing Horizon Agent, depending on the format of the Horizon Agent installer that you use. For more information, see Install the Real-Time Audio-Video Feature.
First, download the latest version of the V4L2Loopback source code package from https://github.com/umlaeute/v4l2loopback/tags. The follow the installation procedure for your Linux distribution.
Install V4L2Loopback on an Ubuntu Machine
- Install the required dependency packages.
sudo apt-get install make sudo apt-get install gcc sudo apt-get install libelf-dev
- Compile and install the V4L2Loopback driver from the source code package. For example, the following command sequence uses version 0.12.5 of the V4L2Loopback package.
unzip v0.12.5.zip cd v4l2loopback-0.12.5 # For tarball installer, the [agent patch path] is the installer package path such as /root/VMware-horizonagent-linux-x86_64-2206-8.6.0-19639256 # For RPM installer, the [agent patch path] is /usr/lib/vmware/viewagent patch -p1 < [agent patch path]/resources/v4l2loopback/v4l2loopback.patch make clean && make && make install # Install v4l2loopback-ctl make install-utils depmod -A
- (Ubuntu 22.04) Modify the configuration to override the invalid V4L2Loopback driver installed by default on the Ubuntu 22.04 machine with the valid V4L2Loopback driver that you just installed.
- Append the following line to the end of the /etc/depmod.d/ubuntu.conf configuration file.
override v4l2loopback * extra
- Regenerate the modules.dep file.
depmod -a
- Append the following line to the end of the /etc/depmod.d/ubuntu.conf configuration file.
- If you have enabled the Extensible Firmware Interface (EFI) and UEFI Secure Boot on the virtual machine, configure signing settings for the V4L2Loopback driver.
- Create an SSL key pair for the V4L2Loopback driver.
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive name/" -addext extendedKeyUsage=1.3.6.1.5.5.7.3.3
- Sign the V4L2Loopback driver.
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der /lib/modules/$(uname -r)/extra/v4l2loopback.ko
- Register the key for UEFI Secure Boot.
sudo mokutil --import MOK.der
Note: This command issues a request to set a Machine Owner Key (MOK) password for UEFI Secure Boot. - To set up UEFI Secure Boot in the vSphere console, reboot the system. For more information, see https://sourceware.org/systemtap/wiki/SecureBoot.
- Create an SSL key pair for the V4L2Loopback driver.
Install V4L2Loopback on a RHEL Machine
- Install the required dependency packages.
sudo yum install gcc-c++ sudo yum install kernel-devel-$(uname -r) sudo yum install kernel-headers-$(uname -r) sudo yum install patch sudo yum install elfutils-libelf-devel
- Compile and install the V4L2Loopback driver from the source code package. For example, the following command sequence uses version 0.12.5 of the V4L2Loopback package.
unzip v0.12.5.zip cd v4l2loopback-0.12.5 # For tarball installer, the [agent patch path] is the installer package such as /root/VMware-horizonagent-linux-x86_64-2206-8.6.0-19639256 # For RPM installer, the [agent patch path] is /usr/lib/vmware/viewagent patch -p1 < [agent patch path]/resources/v4l2loopback/v4l2loopback.patch make clean && make && make install # Install v4l2loopback-ctl make install-utils depmod -A
- (RHEL 8.x) Configure signing settings for the V4L2Loopback driver.
- Create an SSL key pair for the V4L2Loopback driver.
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive name/" -addext extendedKeyUsage=1.3.6.1.5.5.7.3.3
- Sign the V4L2Loopback driver.
sudo /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der /lib/modules/$(uname -r)/extra/v4l2loopback.ko
- Register the key for UEFI Secure Boot.
sudo mokutil --import MOK.der
Note: This command issues a request to set a Machine Owner Key (MOK) password for UEFI Secure Boot. - To set up UEFI Secure Boot in the vSphere console, reboot the system. For more information, see https://sourceware.org/systemtap/wiki/SecureBoot.
- Create an SSL key pair for the V4L2Loopback driver.
Install V4L2Loopback on a SLED/SLES Machine
- Find the version of the current kernel package.
rpm -qa | grep kernel-default-$(echo $(uname -r) | cut -d '-' -f 1,2)
The output is the name of the kernel package currently installed. If, for example, the package name is kernel-default-4.4.21-90.1, then the current kernel package version is 4.4.21-90.1.
- Install the kernel-devel, kernel-default-devel, kernel-macros, and the patch packages. For example, if the kernel package version is 4.4.21-90.1, use the following command.
zypper install --oldpackage kernel-devel-4.4.21-90.1 kernel-default-devel-4.4.21-90.1 kernel-macros-4.4.21-90.1 patch
- Compile and install the V4L2Loopback driver from the source code package. For example, the following command sequence uses version 0.12.5 of the V4L2Loopback package.
unzip v0.12.5.zip cd v4l2loopback-0.12.5 # For tarball installer, the [agent patch path] is the installer package such as /root/VMware-horizonagent-linux-x86_64-2206-8.6.0-19639256 # For RPM installer, the [agent patch path] is /usr/lib/vmware/viewagent patch -p1 < [agent patch path]/resources/v4l2loopback/v4l2loopback.patch make clean && make && make install # Install v4l2loopback-ctl make install-utils depmod -A
- (SLED/SLES 15.x) Configure signing settings for the V4L2Loopback driver.
- Create an SSL key pair for the V4L2Loopback driver.
openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive name/" -addext extendedKeyUsage=1.3.6.1.5.5.7.3.3
- Find the path to the signing file for the V4L2Loopback driver.
find / -name sign-file
This command returns the paths to all the signing files located on the system. The signing file path for the V4L2Loopback driver resembles the following example.
/usr/src/linux-5.3.18-24.9-obj/x86_64/default/scripts/
- Sign the V4L2Loopback driver. In the following command sequence, <sign-file-path> is the path to the signing file that you found earlier.
sudo /<sign-file-path>/sign-file sha256 ./MOK.priv ./MOK.der /lib/modules/$(uname -r)/extra/v4l2loopback.ko
- Register the key for UEFI Secure Boot.
sudo mokutil --import MOK.der
Note: This command issues a request to set a Machine Owner Key (MOK) password for UEFI Secure Boot. - To set up UEFI Secure Boot in the vSphere console, reboot the system. For more information, see https://sourceware.org/systemtap/wiki/SecureBoot.
- Create an SSL key pair for the V4L2Loopback driver.