Updates from QA Training

Automating VM guest installation

Our UNIX and Linux courses are deployed automatically, using a Ubuntu PXE boot server (setup with tftpd, dhcpd and lighttpd and some scripting). However, for a particular event, I needed to install CentOS into VM rather than directly dropping it onto the hardware.


Alina Swietochowska | 14 March 2013

Our UNIX and Linux courses are deployed automatically, using a Ubuntu PXE boot server (setup with tftpd, dhcpd and lighttpd and some scripting). However, for a particular event, I needed to install CentOS into VM rather than directly dropping it onto the hardware.

We already use an Ubuntu PXE boot server, setup with tftpd , dhcpd and lighttpd , in conjuction with kickstart scripts to deploy our UNIX and Linux courses.

At a particular event, however, we needed to install a different instance of CentOS into VMPlayer , rather than directly dropping it onto the hardware.

Since the VMPlayer itself was running on a Red Hat machine, the detailed steps below are correct for a Red Hat style Linux. Having said that, VM configuration is similar on any platform, so the principle should apply to Windows-based hosts (though I haven't tested it there).

The trick of installing a guest automatically from a remote server is to realise that vmware runs its own dhcpd , which dishes out its own IP addresses. I just needed to redirect vmware's dhcp to my Ubuntu PXE boot server (which then takes over to complete the automatic installation). The solution is relatively simple, but remember: it assumes that you have all PXE boot aspects already configured on the server.

Step (1)

Stop the vmware service:

$ sudo service vmware stop


Step (2)

Edit vmware's own dhcpd configuration file, to point at your server (here: 192.168.1.242) and its PXE boot file. Below is a snippet of the content. Notice the normally included lease information is now commented out, and the two additional lines point at my server.

Leave the remainder of the file 'as is'.

$ sudo vi /etc/vmware/vmnet1/dhcpd/dhcpd.conf
[...]
allow unknown-clients;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
subnet 172.16.141.0 netmask 255.255.255.0 {
   range 172.16.141.128 172.16.141.254;
   option broadcast-address 172.16.141.255;
   option domain-name-servers 172.16.141.1;
   option domain-name localdomain;
# default-lease-time 1800;           # default is 30 minutes
# max-lease-time 7200;               # default is 2 hours
filename "pxelinux.0";
   next-server 192.168.1.242;
}


Step (3)

Start the vmware service:

$ sudo service vmware start

You are now ready to start VMPlayer , create a new disk for a new OS (if you haven't done it already) and start the installation. Your VM should redirect to the server, obtain the IP address and continue with the installation.

 

Alina Swietochowska

Principal Technologist

Alina is an authority on UNIX and Linux systems. She is responsible for the development and management of QA’s multi-vendor UNIX and generic Linux training portfolio, writes white papers on the subject and delivers training at all levels. Alina works closely with clients to develop customised UNIX and Linux training solutions for their employees. She also supports organisations that are going through process of consolidation and UNIX/Linux integration. Alina is a Senior Member of the Institute of IT Training. She is also a Member of BCS and a PPL(A) holder. Alina’s professional certifications include Novell CLP 10, CompTIA CTT+, CompTIA Linux +, Sair Linux/GNU CP and LPIC.
Talk to our learning experts

Talk to our team of learning experts

Every business has different learning needs. QA has over 30 years of experience in combining the highest quality training with the most comprehensive range of learning services, ensuring the very best fit for your organisation.

Get in touch with our learning experts to talk about how we can help.