Lab template: Ubuntu 16.04

Recently I’ve been working in a couple of different / disconnected labs. This means I’m managing a couple copies of all my templates manually. Sometimes its hard to find the right section of my notes depending on when/where I’m working on the lab, so I decided to post a couple quick blog posts so I can always find them. The following notes are for creating a template based on Ubuntu 16.04.1, and include notes on setting a static IP and joining to the domain with pbis-open (formerly likewise-open).

Install Ubuntu 16.04.1 Server from ISO image (, accepting all defaults. When prompted for an admin user, use the name hostadmin.

Once the install is complete, login as hostadmin. Switch to root and set a password for the root user.

sudo su -

Apply updates and install the packages openssh-server and ntp:

apt-get update && apt-get upgrade
apt-get install openssh-server ntp -y

Get the template ready for PowerBroker Identity Services (formerly likewise-open) domain joins:

chmod +x
cd /opt/pbis/bin/ 

At this point, I shutdown the VM and convert it to a template. When I’m ready to use the VM, I deploy a copy from template and follow the remaining steps.

If needed, set a static IP by updating the following file:

nano /etc/network/interfaces

The important sections to include in the iface settings are address, netmask, gateway, dns-search, and dns-nameservers. An example has been included below:

iface eth0 inet static

Verify that the hostname is properly set:

nano /etc/hostname

Join the Linux VM to the domain and create a DNS record:

domainjoin-cli join adminbw
/opt/pbis/bin/config AssumeDefaultDomain true
/opt/pbis/bin/config LoginShellTemplate /bin/bash
/opt/pbis/bin/config HomeDirTemplate %H/%U
/opt/pbis/bin/config RequireMembershipOf "lab\\domain^users"

Once I reach this point, I kick off a quick reboot (just to make sure the domain join took) and am now free to use the VM.

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.