Do you want to up your image management game? Then, this tutorial is made for you. I will show you how to install FOG Server on Ubuntu Server 16.04 LTS step by step. Read on!

This Guide was Updated on Feb 21, 2019

Introduction

Just to warn you beforehand – This Guide will be a behemoth. I was thinking about writing up the whole thing in just one article, but I felt it would be a bit overwhelming so I want to split it up into two parts:

Part 1 will cover everything from installing Ubuntu Server 16.04 LTS on Virtual Box and installing & configuring FOG Server on the same server.

Part 2 will cover everything about generating your Generalized Windows 10 Image and capturing and deploying it with FOG.

Part 3 will be an enormous YouTube Video about the whole process. As soon as I can manage to shuffle some time aside to record it. (Find it below the article!)

There are a few guides out there but none of them (at least none that I found) were a 100% complete walkthrough, always minor things missing or not covered. This is about to change.

So without further ado, grab a kettle full of Coffee (Yes, a kettle.) and let’s get started!

Regarding the DHCP Server

Also, an important factor to consider is the DHCP situation you are in. If you want to Network PXE boot into your FOG Server, the Network has to somehow know how to handle this PXE Boot Request coming from a client.

I use pfSense as a router and it is no problem whatsoever to set it up to cooperate with FOG. You simply need to add a forwarder to your FOG Server in your pfSense DHCP Settings that point clients to your FOG Server IP for PXE requests. I will show you exactly how to do that in this tutorial.

But what I want to say is, find out how to do it with your DHCP Server, if you don’t use pfSense yourself. I will just cover the combination with pfSense and no other DHCP Servers. So make sure you know how to add a DHCP Server forwarder on your DHCP Server before starting, as this could throw you off.

What you need

Before we start, make sure you’ll have everything ready. I’m a big fan of open source software, so everything you need for this is completely free.

Make sure you are in the Guided and not in the Expert mode for this Tutorial.

Give your Host System a Name, I go for fog-host for the Ubuntu Server because the fog-server that will be installed on the machine will be named fog-server.

Don’t wonder about the X I put behind my names, it’s because I already got a Fog-Host and Fog-Server up and running 🙂

Select Linux and Version Ubuntu (64-bit).

Click Next.

I run my Server on 2048MB of Ram without a problem. You probably could go with only 1024, but let’s give it a bit of space.

Click Next.

We want to Create a Virtual Hard Disk now.

Click Create.

I choose for VDI and click on Next.

I opt for Dynamically allocated.

Hit Next.

Choose a location where you want to Save your VDI file and allocate Disk Space.

Now, this is entirely up to you and what your goals are. If you just want to have 1 single Windows 10 Image on your FOG Server, around 40 GB would probably be enough. I choose for 80 to have a little more room if I want to use more images later. The Disk Space is allocated dynamically anyway, which means that just the amount of space that is used on the Virtual Machine is actually subtracted from your physical Hard Drive.

Click on Create once you decided.

Part 2: Installing Ubuntu Server 16.04 LTS

So now that we have created our VDI, we can fire up that VM and get started with installing our Ubuntu Server.

Click on Start to Start our fog-host.

Find the Ubuntu Server Image you downloaded earlier and hit Start.

Select a Language and select Install Ubuntu Server.

By the way, if you are stuck with your mouse inside of your VM, press your Right CTRL Key to release it 😉

Select your Language, Location, and Locales next.

Select a Keyboard Layout of your choice.

Once you are done with all of that and your Server got an IP Address from your DHCP Server (Or you configured one manually) we give it a hostname.

Give the New Admin a Full Name (Might be yours) and a Username.

That Username will be used instead of the root user.

After you choose a safe password to decide whether or not to encrypt your Home Directory. I won’t do that for this installation.

When we come to partitioning Disks, we will use Guided – Use Entire Disk.

Finally, agree that you accept that all Data on the selected Hard Drive will be erased in the installation process.

Next, you can choose if you want Updates to be automatically installed. I never want this.

We want to make sure to install the following Software:

OpenSSH Server

Standard System Utilities

Next, we want to Install the GRUB boot loader to the master boot record.

After confirming to remove the Installation Media and clicking on continue, your new Ubuntu Server will boot up.

Enter the Username and the Password you created earlier and log in.

The absolute first thing we want to do is to shut our Server down again.

Type:

sudo shutdown now

We do this to take a Snapshot of our fresh installation in case we mess things up. We will take more snapshot as we proceed but this will be the first one. If you completely mess your installation up, you can always go back to a working state without having to install everything again.

Select your VM, click on the little Camera Symbol in the upper right corner and Create a fresh Snap. Give it a descriptive name.

After you have taken your Snapshot, start-up the machine again and login with your credentials.

Now we are going to update our system to make sure everything is on the latest patch level.

sudo apt-get update
sudo apt-get dist-upgrade -y

After you finished the update, let’s run:

sudo -i

So we don’t always need to put sudo in front of our commands for now.

cd /opt/

First, navigate to the /opt/ folder so we are not using the root home for downloading and unzipping our FOG Server.

Now we are going to download FOG. As of 20.02.2019, the newest Version is 1.5.5

You can check which version is the newest here and adjust your git clone command accordingly.

Now run:

git clone https://github.com/fogproject/fogproject.git fog_stable/

Now before we are going to Install FOG Server, we are going to change our IP Address, because it gets significantly harder to do that after FOG is installed. Way more things you need to change. If we do it now, we just do it once and the FOG Installation takes over the IP.

We do this by typing:

nano /etc/network/interfaces

If you have DHCP activated, you should see something along those lines:

Which we are going to change to look like this:

Of course, adjust according to whatever IP Addresses you are using. Change all the stuff in yellow.

Now press CTRL + O and confirm with Enter to save the file, hit CTRL + X to leave the editor.

Now reboot the Server by typing:

reboot now

I know you could just restart the networking services, but that failed on me a few times so let’s restart to be sure.

After logging back in with your credentials type:

sudo -i
cd /opt/fog_stable/bin

Check if your new IP Configuration was adopted.

ifconfig

If all is good, we are now ready to Install our FOG Server.

I recommend you to take another Snapshot of your VM now while it’s running. Just to be sure. Follow through the Snapshot process we covered earlier again and take a new one.

Part 4: Installing FOG Server

So let’s get going. As I mentioned in the beginning, our FOG-Server will NOT be installed as a DHCP Server, because our pfSense Firewall will still handle DHCP for us. The setup routine will ask you a few questions and I will exactly tell you what to choose. Follow along carefully as this is a crucial step.

Inside of your /opt/fog_1.4.4/bin folder type:

./installfog.sh

On the first prompt you make the obvious choice: 2 – for Debian Based Linux – Hit Enter.

Next, in my case, I will follow the need of potential reinstall of Apache and PHP files. So agree with Y.

Stopping Web Services will likely fail, don’t worry about it now.

Now I’ll give you a list of questions and answers that the routine will ask you.

What type of installation would you like to do? [N/s (Normal/Storage)]

Choose: N

What is the IP address to be used by this FOG Server? [TheIpYouSetUpEarlier]

Confirm with Enter

Would you like to change the default network interface from [YourNetworkInterfaceName]?

Choose: N

Would you like to setup a router address for the DHCP Server? [Y/n]

Choose: Y and enter the IP Address of your Router / DHCP Server

Would you like DHCP to handle DNS?

Choose: Y

What DNS address should DHCP allow? [IP of your Router or DNS Server you use]

Confirm with Enter or Change the IP Accordingly

Would you like to use the FOG Server for DHCP Service? [y/N]

Hell NO! Choose: N

This version of FOG has internationalization support, would you like to install the additional language packs? [y/N]

Choose: N, or Yes if you need it.

Are you sure you wish to continue (Y/N)

Check if everything is correct and confirm with Y

Double Check:

In some older versions of Ubuntu Server, you will get asked to set a MySQL password in the installation process. I wasn’t asked for it in Ubuntu 16.04 LTS. In case, you can leave it empty and just hit enter without a security risk. You can still change it later, too.

Next, before everything is finished, you get asked to update your Database.

For this you navigate to your FOG Server via a Web Browser of your choice:

http://192.168.1.40(or your FOG SERVER IP)/fog/management/

Log in with the default credentials:

fog//password

Confirm any prompts to Update the Database before or after logging in. After this is done, confirm that the installation is finished on your FOG Server by pressing Enter.

To give it a fresh start type:

reboot now

On your FOG Server.

After the Server is back up, log in with the default credentials again via your Web Browser.