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 (http://www.ubuntu.com/download/server/thank-you?version=16.04.1&architecture=amd64), 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 - passwd
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:
wget http://download1.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/pbiso/850/pbis-open-126.96.36.199.linux.x86_64.deb.sh chmod +x pbis-open-188.8.131.52.linux.x86_64.deb.sh ./pbis-open-184.108.40.206.linux.x86_64.deb.sh 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:
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 address 192.168.0.100 netmask 255.255.255.0 gateway 192.168.0.1 dns-search lab.enterpriseadmins.org dns-nameservers 192.168.0.20
Verify that the hostname is properly set:
Join the Linux VM to the domain and create a DNS record:
domainjoin-cli join lab.enterpriseadmins.org 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" /opt/pbis/bin/update-dns
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.