Deploy Ubuntu 18.04 from Template

In a previous post we created an Ubuntu 18.04 template. When that template is deployed, we need to make a few changes to customize the VMs personality. To assist with that we’ll create a customization specification from Menu > Policies and Profiles > VM Customization Specifications.

  • Select New VM Customization Specification for Linux.
  • Use the virtual machine name for the computer name, and enter a domain name for the lab — I’ll use the same as my AD domain name
  • Select a time zone
  • We can use standard network settings (DHCP) or configure common network properties (like subnet mask and gateway) and prompt for IP address. If needed, we can make multiple customization specs depending on our needs.
  • Enter DNS server & search path settings

Deploy from the previously created temlate. Ensure that the VM name is unique, as it will be the computer name, and joined to AD. For this example, I’ll use: ubuntu1804e

  • Select compute/storage appropriate for the infrastructure
  • Check the box for customize the operating system
  • Check the box to Customize VM hardware if needed, for example if we need to change to a different network port group or would like to add additional RAM when deployed
  • Check the box to power on VM after creation

After a few minutes, the VM will be deployed, powered on, and we can see the name we entered and a DHCP assigned address exposed by VMware Tools:

Login as the template-admin user, then switch to root using su –. Enter the root password when prompted. In the template creation process, we added a script named joinad to the root users profile, so we could easily add this machine to the domain. To execute that script, simply run ./joinad.sh.

We are prompted to reboot, but before we do that, we should disable that template-user. The quickest way to make that happen is with:

usermod -L template-admin

Once that is complete, reboot. We now have a Ubuntu 18.04 image, supporting Active Directory authentication, ready to use.

This entry was posted in Virtualization. Bookmark the permalink.

One Response to Deploy Ubuntu 18.04 from Template

  1. Pingback: Setting up Pi-hole DNS | Enterprise Admins.org

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.