Preparing Ubuntu template virtual machines - Virtxpert

Home

About About Jonathan Frappier Disclaimer VMware vSphere Resource Management Essentials by Jonathan Frappier and Packt Publishing A page for aspiring VMware admins who cant balance a checkbook, hate grocery shopping, dont know whether to buy a condo or know how to use Twitter

About Jonathan Frappier

Disclaimer

VMware vSphere Resource Management Essentials by Jonathan Frappier and Packt Publishing

A page for aspiring VMware admins who cant balance a checkbook, hate grocery shopping, dont know whether to buy a condo or know how to use Twitter

@jfrappier

Free Tools Free Infrastructure Resources – Host, Network, Storage and more Flat Virtualization Icons for PowerPoint or Documentation

Free Infrastructure Resources – Host, Network, Storage and more

Flat Virtualization Icons for PowerPoint or Documentation

PowerCLI Hacks

VMware

VMware vRA Series

Bob Plankers has a great post over at lonelysysadmin.net for preparing CentOS based virtual machines for being a template . As I’ve started working with Ubuntu more I decided to take that list and Ubuntu-ize it (mostly from proding by Sarah Zelechoski – one of the smartest people I’ve ever had the privilege to work with…so many thank you’s). Anyways here is that guide… Ubuntu-ized.

Stop logging services ( auditd and rsyslog ):

Check for, and remove old kernels

Check your current kernel by running

Then run

If additional images are listed, remove them by running

You can remove multiple images all on the same line just by listing them one after another.

Clean out apt-get

Force the logs to rotate & remove old logs we don’t need

Truncate the audit logs (and other logs we want to keep placeholders for)

Remove the udev persistent device rules

Well, saved a step here – there are rules which exclude creating files that match MAC addresses for VMware, Hyper-V, KVM, Xen, and virtualbox (see /lib/udev/rules.d/75-persistent-net-generator.rules). So long as your MAC matches this, nothing to clean up. Otherwise

It will be recreated on the next boot, so any time you power on this VM (updates maybe?) you’ll need to delete this file again so it is not saved in the template.

Remove the traces of the template MAC address and UUIDs.

Here is another step you shouldn’t need to do, however you may want to check /etc/network/interfaces to verify

Clean /tmp out

Remove the SSH host keys

Update network config

If you have set /etc/network/interfaces, make sure to reset for cloning purposes. For example as I wrote this it had a static IP address which I changed to DHCP before shutting down and converting to a template.

Remove hostname

If you have named your virtual machine anything other than localhost, and want the template to spin up with a generic name, versus say “ubuntu-template” remove entry from /etc/hostname

Remove the user’s shell history

If you have switched to root at any point, do this as root and individual user accounts

That should about do it, depending on where this template is going, make sure any ISOs attached to the CD-ROM or networks for the NIC’s are adjusted properly. While many of the steps were the same there were a few differences to be aware of. Anything else you like to clean out? Comment below please!

Preparing vSphere Templates – vRealize Automation Series Part 13

VMware Application Services Linux deployment hangs at agent_bootstrap node setup

Creating Entitlements – vRealize Automation Series Part 15

Deploy an Application Blueprint – Application Services Series Part 5

Video: Prepare CentOS 6.x virtual machine for cloning

Create an Application Blueprint – Application Services Series Part 4

About

Latest Posts

vRealize Application Services Home Lab Upgrade - May 28, 2015

vRealize Automation Home Lab Upgrade - May 27, 2015

Home Lab – $1250 8-Core / 32GB / 750GB Flash / 2TB HDD 2015 Edition - May 26, 2015

Email

Twitter

LinkedIn

Google

Pocket

Reddit

Tumblr

Facebook

StumbleUpon

vRealize Application Services Home Lab Upgrade

vRealize Automation Home Lab Upgrade

Home Lab – $1250 8-Core / 32GB / 750GB Flash / 2TB HDD 2015 Edition

Preparing Ubuntu template virtual machines

Hands on with Microsoft Visual Studio Code @code

RSS - Posts

RSS - Comments

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Email Address