Machine Imaging With Fog – Setup

One of the best things you can probably do to help yourself as a System Administrator in the SMB space it to implement some way to do machine imaging.  This will save you hours whenever you have to order a new machine and set it up or if you want to wipe a badly infected machine.  Through the years, I have used a handful of products to accomplish this.  A couple of years ago, I came across a fantastic open source project that for me has been the best I’ve used.  Fog is an imaging solution that utilizes PXE to network boot the machines and image them over your network.  This will be the first article of a series on the installation and use of Fog.

First thing is first.  There are a few assumptions that I am making.

  1. You only have a single subnet you will be servicing.
  2. The machines you will be imaging are located on your live network.
  3. A local windows server is handling DHCP(typically the domain controller).

I will be using Ubuntu Server 14.04.  Install Ubuntu using all default options.  You do not need to install any additional packages during the OS install(I typically install Open SSH just for ease of administration).

Once the server reboots, login using the account you setup during the installation process.  The first thing we need to do with our new server is to give it a static IP address.  I personally use vim but any editor will get the job done to update the configuration file.  Type the following command into the command prompt to open the interfaces configuration file using vim.  This will ask you for your password for security reasons.

sudo vim /etc/network/interfaces

With a fresh installation of Ubuntu server, the interfaces configuration file will look like this:

# This file describes the network interfaces available on your system.
# and how to activate them.  for more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

You will make your changes to the primary network interface section.  To make changes to the file in vim, press “i” to enter into insert mode.  When finished editing, press the Esc key to exit insert mode.  Press “:” to enter command mode and type “wq” and press enter.  This will (w)rite the file and (q)uit vim.  Keep in mind to use information that is applicable for your own network.  Below are the setting in my lab.

# This file describes the network interfaces available on your system.
# and how to activate them.  for more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.100.20
netmask 255.255.255.0
network 10.0.100.1
broadcast 10.0.100.255
gateway 10.0.100.1

# DNS Information
dns-nameservers 10.0.100.10
dns-search ad.testlab.com

While it isn’t necessary to add the comment “# DNS Information”, I like to do that to keep everything documented as I go and make it as obvious as possible what something is.

After saving the file, you will need to restart networking for the changes to take effect.  Issuing the following command should accomplish this.

sudo /etc/init.d/networking restart

Verify that you are able to ping out to the internet.  I will typically try to ping http://www.google.com as a test.  Once verified, we want to update the server.  Run the following to accomplish this.

sudo apt-get update
sudo apt-get upgrade

Now that we are all up to date at the OS level it’s time to download and install Fog.  Run the following to download, unzip, and start the installer.

sudo wget http://downloads.sourceforge.net/freeghost/fog_1.2.0.tar.gz
sudo tar -xvzf fog_1.2.0.tar.gz
cd fog_1.2.0/bin
sudo ./installfog.sh

Since we are using Ubuntu server, we will keep the default.

Fog Step 1

Again, we will be using the default option to install a “Normal Server”.

Step 2

Verify that the IP address to be used is the address the you assigned to your fog server previously.  We will not be using this server for DHCP, so be sure to answer no to the questions pertaining to DHCP.  We do not want to change the default network interface so leave that default.  I don’t need the additional language packs and I personally select no on the donation of computer resources, but those are up to you and your needs.

Step 3

You will now presented with a summary of the settings that will be used.  Respond with “Y” to continue the installation.

Once the installation gets to the SQL configuration, you will be asked to provide a password for the SQL root account.  Remember that password as you will need it later in the installation.

Step 4

When asked, enter the password you setup for the SQL root user during the previous section.

When the install gets to a certain point, it will ask that you open the management site in a browser to setup the database.

Step 5

Go to the site and click on the blue “Install/Upgrade Now” button(it should be the IP address of your fog server).

Step 6

When that finishes, you will be presented with a link to the login page.  Before going there, go back to the server and finish the installation.

Step 7

At the end of the installation, you will be asked if you want to notify the Fog group about the install.  Again, up to you.  Finally, you will be presented with “Setup Complete!” and you are are ready to login to your new Fog server.  The default username is “fog” and the default password is “password”.  I very strongly recommend changing the password.

Step 8

The last step we will need to take is to add two options to the DHCP scope to tell the PXE clients where it needs to go.  Since we are using DHCP on our domain controller, go ahead and open the DHCP MMC module.  Once you drill into the scope, and scope options, right click and select “Configure Options”.

DHCP Scope Options Location

This will bring up the scope options dialog.  The two options you will be adding are “066 Boot Server Host Name” and “067 Bootfile Name”.

For 066, the string value will be the ip address of your Fog server.  In our case, that is 10.0.100.10.  For 067, the string value will be “undionly.kpxe”.  This is the default boot file for Fog.

Scope Options

Well, now we have our imaging server setup.  Congratulations you made it.  This is yet another step to a better life as a System Administrator.  In the next article, I will be going through some system configuration of the Fog server and how to get it ready to start cranking out those images.

Stay tuned and thanks for visiting.

Machine Imaging With Fog – Setup

Something New

First off, welcome.  Somehow you ended up here to find the fresh beginnings of a potentially interesting blog.  Why am I starting this?  Well, I’m a Systems Administrator in the SMB space.  An army of one if you will.  Generally, in a small to medium sized company, there is typically only one IT person.  This presents some pretty interesting opportunities and challenges.  I am the help desk, printer tech, server admin, network engineer, and anything else that has to do with the technology in the office.  Because of this, I have a breadth of knowledge that I can share.

I don’t claim to be an “expert” in anything and if this is what you are looking for, then I apologize now.  My goal here is to simply share some tips, tricks, and possibly some insight into the things that I have found to work well in an SMB environment.  From networking, virtualization, AD and GPO design, all the way to what hardware seems to work well for me.  Little tidbits of things that I have picked up over the years or cool things that I have come across and learned to make things easier.  Really, that is what it is all about.  Learning new things to make your job easier.

Things will start out fairly slow, so please try to be patient.  I’m not entirely sure where I want to go with this or how well it will do.  Here’s to things to come and thank you for visiting.

Something New