... Matthew Drummond

Adventures in FOSS: FOG Deployment

Preamble

This is a tutorial to instruct a user on the deployment of a FOG imaging server on a preexisting Linux server.

EDIT (2018-11-13):

Updated documentation to reflect Ubuntu 18.04.1 & FOG version 1.5.4

Required:

  • Server w/ Linux (Debian, fedora, and Arch based all supported at time of writing tutorial)
    • Ubuntu 16.04/18.04.1 used in this documentation
  • A method of handling DHCP for PXE booting
    • DHCP forwarding through a pfSense router will be used in this tutorial

Prerequisite work

As a prerequisite, it is always important before large deployments to ensure software, and potential dependencies are up to date.

An example of a ubuntu MOTD notifying you of available updates

On a Ubuntu 18.04.1 system this can be accomplished by opening a terminal, and entering:

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

Depending on the packages updated during the upgrade, the final output will vary. At the time of writing this tutorial (09/11/2017), you should have no prompts post- update/dist-upgrade

Assuming there’s no issues with the updates, we now need to enter a terminal with root privilege by entering the following in a terminal:

sudo -i

Once in an elevated terminal, we need to retrieve the latest tar.gz of fog (In this example; version 1.5.4), and extract it within /opt/

cd /opt/
*wget https://github.com/FOGProject/fogproject/archive/1.5.4.tar.gz

An example screenshot of a terminal after a succesful wget

You can now extract the tar.gz by entering:

tar -xzf fog_1.4.4.tar.gz

And that’s it, most of the prep work has been completed.

Network interfaces

At this stage, the FOG server is almost ready, but just needs a static IP address in order to be reliably pointed to it from our DHCP server.

In this tutorial the network interface will be configured by using Nano as the root user by entering the following commands:

Sudo -i
nano /etc/netplan/net-conf.yaml

Example Config:

network:
    version: 2
    renderer: networkd
    ethernets:
        enp3s0:
            addresses:
                - 192.168.1.128
            gateway4: 192.168.1.16
            nameservers:
                addresses: [192.168.1.16]

Your interface may not be enp3s0. If so, the interface can be determined by typing ip a in a terminal

Note that this example uses 192.168.1.16 as a gateway. This is our router, which will handle DHCP. This address will need to be remembered for future steps.

Once completed you can save and exit the config by pressing ^X (*Ctrl

  • X) and *Y to confirm your edits.

And now to ensure the IP is applied, you can reboot your server with the command: reboot now while acting as root.

The static IP has been set, and can be confirmed by entering :

ip a | grep 'inet' into the terminal and making sure the IP set in the earlier config file is seen.

Example output of `ip a |grep 'inet'`

Installing FOG

Now that all the prerequisite work is done, we need to start the FOG installation via the installation bash script.

The installation can be started by entering the following commands into a terminal:

sudo -i
cd /opt/fog_1.4.4/bin
./installfog.sh

FOGs install script will attempt to auto-detect your distribution of Linux. For this tutorial it successfully did.

Once the bash script begins it will ask a series of questions relevant to this installation, and the network setup, the following is the configuration used for this tutorial:

What type of installation would you like to do? [N/S (Normal/Storage)]
N
What is the IP address to be used by this FOG Server? [192.168.1.128]
Select enter
Would you like to change the default network interface from [Eth0]?
N
Would you like to setup a router address for the DHCP Server? [Y/N]
Y
192.168.1.16
Would you like DHCP to handle DNS?
Y
What DNS address should DHCP allow? [IP of your Router or DNS Server you use]
Select enter
Would you like to use the FOG Server for DHCP Service? [Y/N]
N
This version of FOG has internationalization support, would you like to
install the additional language packs? [Y/N]
N
Are you sure you wish to continue (Y/N)
Y

And now FOG has been successfully installed to the server. All that is left to do is solve the issue of DHCP

DHCP / Router configuration

This stage will not be the same for any two networks, and because of such should be noted on for concepts, not verbatim instructions.

For pfSense, to configure DHCP, you’ll need to enter the DHCP Server menu, located from the top drop down panel under: Services -> DHCP Server

Underneath the Network Booting section of this page, click on the “Enable Network Booting” tick box, enter under “Next Server” the IP of the newly created FOG server, and under “default BIOS file name” undionly.kpxe

Once these modifications have been made, click save at the bottom of the screen, and the installation of the new FOG server is complete.

In Conclusion

The FOG server has officially been installed, and is ready for configuration.

From here on, configuration is case specific given the needs of the server, and the clients who will use it.

For information on further configuration read the user guide on the official wiki

And in case of future changes to the installation process, read the official installation instructions.