How to Create a Ubuntu 18.0 VM Template for VMware Automation?

How to Create a Ubuntu 18.0 VM Template for VMware Automation?

Summary: This technical write-up discloses simple steps for creating a Ubuntu 18.04 VM Template to automate your VMware vSphere virtual machine.

Introduction

Creating a VMware vSphere template for Ubuntu server 18.04 allows a super-fast deployment of Virtual Machines. Also, it enables you to add or update custom software to create the best server for your business environment.

However, before getting started with the creation of Ubuntu 18.0 VM Template* you need to create a VM, add required VMware tools, and extract unique data (if any).

VM Template*
A VM template is a master copy of Virtual Machine that includes virtual devices, VM disks, guest OS, multiple applications, a specific VM configuration, and settings. VM templates are basically used while deploying multiple VMs and for VM cloning. Using a VM from a template decreases the provisioning times and helps you maintain the standards. 

WGS VMware WHMCS Module


Prerequisites

        • Download the ISO file of Ubuntu-18.04 on your local PC.
        • Go to your VMware ESXI Server

    • Create Ubuntu 18.0 VM Template For VMware Automation

      In the subsequent section we will disclose the steps to Create Ubuntu 18.0 VM Template For VMware Automation:

      Step 1. Download The ISO File

      1. Click on the official website of Ubuntu:-

      Link : – https://releases.ubuntu.com/18.04/

      ubuntu VMware

       

      • Step 2. Now, Login into your VMware ESXi

        ubuntu VMware

      • Step 3. Upload the ISO Image to VMware ESXi Datastore

        1. Click on the Storage button, then click on the Datastore browser.

        ubuntu VMware
        2. Click on the Create Directory and create the folder with the name of iso

        ubuntu VMware

        3. Click on the Upload button

        ubuntu VMware

        4. Then, choose the Ubuntu-18.04 ISO image from your local computer and click on the Open button.

        ubuntu VMware

      • Step 4. Create a VMware ESXi Virtual Machine for Ubuntu 18.04 Installation

        1. Click on the created /RegisterVM

        ubuntu VMware

        2. Then select the option:- create a new virtual machine and click on Next.

        ubuntu VMware

        3. Enter VM name and select the Guest OS family to Linux and Guest OS version to Ubuntu Linux (64-bit). Then, click on Next.

        Guest OS family

        4. Select the datastore and click on Next.

        datastore

        5. Configure the virtual machine hardware and click on CD/DVD Drive 1 and browse the Ubuntu-18.04 ISO file from the datastore then click on Next.

        ubuntu vmware

        6. Then choose the ISO file..

        ISO file

        7. Once it is done then click on Next and click on Finish button.

        Now the new VM should be created on your VMware ESXI. Click on Virtual Machine.

      • ubuntu vmware

      • Step 5. Installation of Ubuntu 18.04 operating system

        1. For starting the installation of OS, click on the VM or Power on button.

        ubuntu vmware

        2. Now installation is initialized, then only select language and press Enter.

        press Enter

        3. Press Enter on interface ( ens160 ) to configure the IP address.

        interface

        4. Then click on the Edit IPv4 option.

        5. Choose the manual option under IPv4 Method:-

        IPv4 Method

        6. Now configure the IP addressing according to your network. click on the Save button.

        IP addressing

        7. Then click on the Continue option.

        Continue option

        8. Now configure the Storage Configuration. Select the option Use an entire disk and
        Press Done option.

         Use an entire disk

        9. Press enter on the Done option.

        Done option

        10. Select the username and password for Profile Setup and press the Done option.

         username and password

        11. For SSH access, press the space button on the Install OpenSSH server and press enter on the Done option.

        Install OpenSSH

        12. Now installation is complete, press the Reboot Now option.

        After all steps, the Virtual Machine is ready to boot Ubuntu 18.04 from the virtual hard drive. After that, Enter the username and password.

        ubuntu vmware

      • Step 6. Installation of VMware Tools on Ubuntu 18.04 VMware Virtual Machines

        1. On VMware ESXI, click on the Action button > Guest OS > Install VMware Tools. After the Install VMware Tools option, CD-Drive is automatically connected with your OS.

        Guest OS

        2. Confirm the CD-Drive is connected properly. Run the below command:-

        # lsblk

        CD-Drive

        3. After confirmation, run the below command:-
        # mount /dev/sr0 /mnt
        # lsblk

        After confirmation

        4. After the CD-Drive is mounted on /mnt directory. Run the below command:-

        # cp -rv /mnt/VMwareTools-10.3.23-17030940.tar.gz /tmp
        # ls /tmp

         Run the below

        5. Extract the VMwareTools-10.3.23-17030940.tar.gz file in /tmp directory.
        Run the below command.

        # cd /tmp
        # tar -xvzf VMwareTools-10.3.23-17030940.tar.gz

        tmp directory

        6. After extracting the file. We need to run the script under /tmp/vmware-tools-distrib
        directory. Execute the command that are mentioned below:-
        # cd /tmp/vmware-tools-distrib
        # ./vmware-install.pl

        vmware-tools-distrib

        7. Check whether VMware tools are installed or not. Run the below command:-

        # systemctl status vmware-tools
        OR
        # systemctl status open-vm-tools
        # systemctl start vmware-tools
        # /etc/init.d/vmware-tools status
        # /etc/init.d/vmware-tools start
        !!!!! Reboot the Virtual Machine by running the command > init 6 !!!!

      • Step 7. Convert the Virtual Machine to Template

        After the installation of the virtual machine and VMware tools on it. We are going to convert the virtual machine to a template.

        1. Go to your Vcenter server.

        2. After login you can see your virtual machine under the Vmware-ESXi (host).

        Right-click on the virtual machine, then go to the Template option and choose the Convert to Template.

        ubuntu vmware


Recommended Reading

Looking for Something More? We can help!

Our WHMCS experts are ready to accept your custom requirements.

Your questions, our answers

A VM template is a preconfigured and pre-installed virtual machine that can be used as a starting point for creating new virtual machines. It includes the base operating system and any additional software or configurations required for a particular environment.   

Ubuntu 18.04, also known as Ubuntu Bionic Beaver, is a long-term support (LTS) release of the Ubuntu operating system. It was released in April 2018 and has been supported with security updates and bug fixes for five years.

The steps outlined above are specific to creating a VM template for Ubuntu 18.04. If you want to create a template for a different version of Ubuntu, you will need to follow a similar process but ensure that you select the appropriate guest operating system and installation method for that version. 

Have more questions?
Our support team loves answering questions