Linux-optimize4vdi is a simple Ansible playbook which performs basic configuration steps like updating OS, uninstalling/installing packages, setting GNOME desktop parameters, etc. Ubuntu 22.04 /20.04 / 18.04 are supported.
This playbook performs multiple optimizations:
- Remove unnecessary Ubuntu apps (games, usb creator utility and transmission app).
- Update and upgrade packages with apt update && apt upgrade.
- Update installed apps with snap refresh.
- Install the latest version of Open-VM-Tools.
- Install new apps via apt (chromium, 7zip, vlc, telegram desktop client, and zoom client).
- Disable apt automatic updates and upgrades.
- Enable GRUB quiet boot.
- Disable system hibernation and sleep.
- Disable unnecessary services (bluetooth, thunderbolt, firmware update service).
- Join to the domain.
- Compile VHCI driver for Horizon USB redirection.
- Compile V4L2Loopback driver for Horizon RTAV.
- Install Horizon Agent with Audio redirection, USB redirection, and RTAV.
- Enable SSO for Horizon.
- Optimize GNOME desktop (disable animation, set default background to single color).
- Clean bash history.
- Reboot the virtual desktop.
- Install Ubuntu 22.04/20.04/18.04 Guest OS on a virtual desktop VM with default parameters. Set the default user account with 'user' as username and sudoer permissions. If you use another username, please update ansible.cfg accordingly.
- Install OpenSSH server on the virtual desktop:
sudo apt get install openssh-server
- Install Ansible on your workstation / client computer.
- Generate ssh keys on your workstation with default settings:
ssh-keygen
- Copy public key from your workstation to the virtual desktop:
ssh-copy-id -i ~/id_rsa.pub user@virtual_desktop_ip_address
- Modify inventory file and specify virtual desktop IP address, modify required variables if needed.
- Download and place required installation packages and archives to the /files folder.
- Run Ansible playbook with:
ansible-playbook --ask-become-pass optimize.yml
If you want to run only certain optimization you can run ansible-playbook with --tags "tag1, tag2, tag3"
parameter. Currently this playbook supports tags:
- horizon - install and configure VMware Horizon Agent on the virtual desktop.
- domain - join to the domain with the parameters specified in inventory files.
- gnome - perform GNOME desktop tweaks and optimizations.
- reboot - reboot the virtual desktop after completing optimizations. For example to run playbook with horizon and domain join optimization only enter:
ansible-playbook --ask-become-pass --tags "horizon, domain" optimize.yml
Inventory file contains variables, which are necessary to run the playbook:
- horizon_agent - archive name with the horizon_agent installation package
- vhci_driver - vhci driver archive name
- v4l2loopback_driver - archive name with the v4l2loopback driver
- domain_name - domain name to join
- domain_user - domain account name to join to the domain
- domain_password - password for domain-entry account
- debug - set to True to display extended information from the commands that have been executed