If you’re working with VMware 6.7 and want to create a template for Ubuntu 22.04 without using vCenter, you’re in the right place. Follow these steps to set up a VMware template efficiently. (The process is similar with other versions and if you have vCenter.)

Prerequisites

Before we begin, make sure you have the following:

  1. VMware ESXi 6.7 installed and running.
  2. ESXi web client ready

Step 1: Download Ubuntu 22.04 ISO

Go to the official Ubuntu website and download the ISO file for Ubuntu 22.04 LTS. You can find the ISO at https://releases.ubuntu.com/22.04/.

As of Jan-2024 22.04 was the LTS (Long-term Support) release. Download a newer one if it is available.

Step 2: Create a New Virtual Machine

  1. Open the VMware vSphere Client via Chrome to connect to your ESXi host.
  2. Navigate to the host where you want to create the template.
  3. Right-click on the host and select “New Virtual Machine.”
  4. Choose “Custom” and click “Next.”
  5. Select the compatibility for the virtual machine. Choose “ESXi 6.7 and later” and click “Next.”
  6. Specify a name for your virtual machine and choose a storage location. Click “Next.” Name is something like Ubuntu-2204-Template
  7. Select the guest operating system as “Linux” and version as “Ubuntu 64-bit.” Click “Next.”
  8. Allocate the desired resources (CPU, memory, and disk space) for your virtual machine. Click “Next.” These can be changed when we create a VM from the template.
  9. Configure networking settings. Click “Next.”
  10. Choose “Use an existing virtual disk” and select the Ubuntu ISO you downloaded earlier. Click “Next.”
  11. Review your settings and click “Finish.”

Step 3: Install Ubuntu 22.04

  1. Power on the virtual machine.
  2. Follow the Ubuntu installation wizard to install the operating system.
    • Use a DHCP address
  3. When prompted, choose “Install OpenSSH server” during the installation process.
  4. Once the installation is complete, log in to the Ubuntu system.

Step 4: Customize the Template

  1. Install VMware Tools on the Ubuntu virtual machine for better integration.
   sudo apt update
   sudo apt install open-vm-tools
  1. Configure the system as needed, install any additional software, and perform optimizations.
  2. Clean up unnecessary files and logs.

Step 5: Sysprep (For Windows Hyper-V hosts only and Optional)

If you plan to deploy multiple virtual machines from this template, consider running sysprep to generalize the system. However, note that Ubuntu doesn’t have sysprep like Windows. You may need to handle customization manually.

Step 6: Copy Template Files to Create a new VM

Now, because we don’t have vCenter, all we have to do to create a new Ubuntu VM using this “template” is copy the existing “Template VM” files to a new directory, and then register the new VM, rename it, and then boot it and when prompted, select “I copied it”.

  1. Power off the virtual machine template.
  2. In the vSphere Client, navigate to the host where the virtual machine is located.
  3. Open the “Datastore Browser.”
  4. Browse to the datastore where the virtual machine files are stored.
  5. Locate the folder containing your virtual machine files. This folder includes the virtual disks (VMDK files) and the configuration file (.vmx).
  6. Right-click on each virtual disk file (.vmdk) and the configuration file (.vmx) and choose “Copy.”
  7. Navigate to the destination datastore where you want to store the template.
  8. Click on the “Create Directory” button in the Datastore Browser to create a new directory for your template.
  9. Enter a name for the new directory and click “Create.”
  10. Open the newly created directory and paste the copied virtual disk files and the .vmx file.
  11. Once the copy is complete, go to the destination directory, right-click on the virtual machine’s .vmx file, and choose “Register VM.”
  12. Follow the prompts to register the virtual machine.
  13. With the registered virtual machine selected, right-click and choose “Edit Settings.” Remove unnecessary hardware and make any adjustments if needed to the CPU/Memory.
  14. Power on the virtual machine.
  15. When prompted, select “I copied it”

Now, you have successfully created an Ubuntu 22.04 VMware template on VMware 6.7 without using vCenter by manually copying the virtual disks and .vmx file, and creating a new destination directory in the Datastore Browser.

Step 6: Convert to Template (If you have vCenter)

  1. Power off the virtual machine.
  2. In the vSphere Client, right-click on the virtual machine, go to “All vCenter Actions,” and select “Convert to Template.”

Now you have successfully created an Ubuntu 22.04 VMware template on VMware 6.7 without using vCenter. You can use this template to deploy consistent virtual machines in your environment.

Happy virtualization!