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!
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.
You should be kind of familiar with the use of VirtualBox, but I will guide you through each step anyway (except the installation of VirtualBox itself)
Part 1: Creating a Virtual Hard Disk (VDI) for our Ubuntu Server 16.04 LTS
Start up your VirtualBox Manager and click on New.
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).
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.
We want to Create a Virtual Hard Disk now.
I choose for VDI and click on Next.
I opt for Dynamically allocated.
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.
Now Ubuntu Server 16.04 will be installed on your VDI. Refill your coffee, we’re getting there.
Choose a Proxy Server if you have one, if not leave it empty.
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.
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.
Part 3: Preparing Ubuntu Server 16.04 LTS for the FOG Server installation
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:
So we don’t always need to put sudo in front of our commands for now.
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.
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:
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:
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.
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.
I call it something like: “Before FOG Installation, everything prepared”. Simple.
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:
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
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:
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:
On your FOG Server.
After the Server is back up, log in with the default credentials again via your Web Browser.
Navigate to your User Manager and change the default credentials of your fog user.
Congratulations, you just successfully installed your first FOG Server.
THE NEXT PART ONLY APPLIES IF YOU USE pfSENSE FIREWALL
Part 5: Setting up a DHCP forwarder in pfSense
This will be very quick.
Log in to your pfSense Firewall and Navigate to Services / DHCP Server
Scroll down until you find Network Booting and click on Display Advanced.
Tick Enable Network booting and Enter your FOG Server IP Address as the Next-Server Address.
Set the Default BIOS file name to undionly.kpxe
What this does is, every time pfSense recognizes a device that wants to PXE Boot over Network, it forwards the request to our FOG Server.
End of Part 1 and Final Words:
I really do hope that I included every single step. This is by far the longest tutorial yet.
The next part, which will hopefully be released by the end of this week, will cover how to create your generalized Windows 10 Image and how to capture your first Host in FOG and deploy your Image.
I use the Server for several weeks now and it’s a blast. It works like a charm.