FOG
Initial Setup
Format and install Ubuntu 17.04 on the computer that will be hosting the FOG Server (or whatever version of Linux you prefer). You can download it here.
Installing FOG
Download FOG (it is recommended that you get the latest version from here).
Run these commands in the download directory (this requires an internet connection): tar -xzvf FOG_FILENAME_HERE.tar.gz && cd FOG_FILENAME_HERE/bin && sudo ./install.sh
TIP: After starting the install command (sudo ./install.sh)
, don’t cancel while the installation is in progress as some files will remain and may cause issues when trying to install later.
TIP: If you need some help with the early steps that are not mentioned here go to this video - https://www.youtube.com/watch?v=uleFAPmCo7Y
Configuring Your FOG Installation
The last command will initialize the install process, which is fairly straightforward. If you need help with the install process, or are using a different OS, visit the FOG wiki: [1]. Some of the settings require you know the basics of your network setup, so it will vary depending on the network.
More info on installation specifically can be found here: FOG Official Install Guide
Setting up FOG to be Used on Another Network
FOG when installing will automatically pull the network information from the network adapter you tell it that you would like to use. To configure FOG to be used on another network, during the start of the install your network adapter will need to be configured with the settings of the other network. It will seem wrong, as you will have no internet (or limited access) but it is the only way to trick FOG.
Then once you reach the point to where you have configured all of your settings, it will show all of the settings and ask if you'd like to continue the installation with those settings. Before typing y to continue you must have internet access. So you must set your network adapter to work with your current network, as the rest of the install will be pulling necessary files and programs from the internet. Even if the dependencies are already installed you must have internet and follow all the way through the install, as it does internet connectivity tests and does not create all of the necessary FOG, MySQL, and database files until the very end.
If you have installed before, and now want to move to a new network you need to remove the /opt/fog folder. Do so by running the command: sudo rm -r /opt/fog
this will remove the old installation configuration information, but will keep all important things like your images, just follow the directions for setting up FOG for another network if you want to set it up for a different network you are not on, or do the normal installation on the new network.
Access the FOG GUI
This can be done by opening a browser tab on any computer on the same network by typing the IP of the FOG server and ending it with /fog. There you can access the settings and manage images and accounts.
For example: 10.21.25.29/fog
DHCP Setup
In order for Fog to work correctly you will need to make some adjustments to the Scope Options in DHCP. You will need to do two settings for both BIOS and UEFI machines using scope options 66 and 67. I have included a picture of the scope settings on our server.
Here are some helpful links from the Fog Wiki to assist you.
PXE Booting Your Computer
You will need to access the BIOS and turn on network boot if not already enabled, and enable legacy network boot if available for better compatibility. You may need to turn off the secure boot setting depending on the device.
Registering
To register computers, you must PXE boot them into FOG, and it recommended that you use full host registration. Then follow the on screen steps to register your device. The registration process itself remains the same across all devices, but PXE booting will be different across devices.
Updating a FOG Imaging Server
This will be a quick rundown of how to update a FOG imaging server, and how to fix some common issues you may run into while doing so. This was written for the Linux version of FOG (specifically Ubuntu) it may be different on other Linux distros and is very different. If you are running a Windows version of FOG, at the time of writing that is not officially supported by FOG Project, so you are pretty much on your own for now.
The Initial Steps
If you are updating to a newer FOG version, you need to download the appropriate fog_x.x.x.tar.gz file (if you are new to Linux tar.gz files are basically a .zip, .rar, or .7zip in Windows). You will the need to run this set of commands to unzip it and run the install script inside of it. If you have installed FOG before, this is the same process and doing an installation, just the install file uses your existing FOG server settings and only changes the files that it needs to (so don't worry it's not a total reinstall everything will still be there).
(this requires an internet connection and must be run in the Downloads directory):
tar -xzvf fog_x.x.x.tar.gz
cd fog_x.x.x/bin
sudo ./install.sh
The install.sh file as you can see must be run as sudo or root to be able to properly install, so you will need the password for that level of access if necessary.
The script will run, and may ask you to confirm your current settings, and will update FOG and it's dependencies to the latest version accordingly. A restart of the host afterwards is recommended.
More info on an initial install can be found here: FOG Official Install Guide
Kernel Updates
After you update FOG you will need to update the kernel that fog uses for the bzimage and bzimage32. These files are what the computers and devices PXE booting from the server will use to boot, and the newer versions add compatibility for newer devices (such as ones with finicky UEFI BIOS'). To update the kernel you will need to open the FOG management console (either by localhost/fog on the host machine or by the IP address you set to it on another machine with /fog). You will then click on the wrench in the top right to get to the FOG Configuration page. On the right there is a kernel update link you need to click on. Then there will be a list of kernels available if your kernel is not up to date. You will need to install two kernels, both the latest version. The ones at the top will be the latest, so click download button (big green downward arrow) below the first kernel labeled x86_64. You can rename the kernel, but for most instances that is unnecessary so click next and it will update. Repeat this for a x64 kernel.
More info on kernel updates can be found here: Official FOG Kernel Update Guide
Imaging Microsoft Surfaces (Surface Pro 2) with FOG
Here are the details for making a FOG server work with Surface Pros and other devices that might be particular in the same way:
PXE Booting Your Surface Pro 2
To PXE boot a Microsoft surface you must first disable secure boot. This can be done by holding the volume up button and holding power, and releasing the power button when the Surface screen is displayed. Then click on the secure boot option and click disable then save and exit.
To PXE boot the Microsoft surface, you then hold down the volume down button and power at the same time. Once the Surface screen is displayed, release the power button. Then the PXE boot screen will come up. (make sure it is connected to a network via ethernet adapter before PXE booting)
When the FOG menu pops up, you can capture an image to use for the rest of the surfaces.
More Information on Surfaces and Other Special Device Booting
The IPXE protocol version used by Microsoft surfaces is only supported by the latest versions of FOG. Version 1.4.4 (September 2017) is what was used for this, along with the surface pro 2 tablets, and this used a windows 8 Pro installation (as windows 10 is not natively supported by the original surfaces). FOG was installed on a small computer inside of the Ubuntu 17.04 OS. If you are going to use computers such as these (ones with UEFI or very custom BIOS') then you must use the latest version possible of FOG.
If you have any errors with DHCP and UEFI, I recommend looking here.
Troubleshooting
Here are different solutions we have found to various FOG problems that you may encounter:
"What if FOG is blocked?" (During Installation)
If the download fails during the install process, check your proxy settings on your network or ask your network administrator if it is blocked. If so, have the admin allow access, use a VPN (with proper permission), or take it to another network.
(If installed on another network, once it is moved to another network all IP settings for the server will need to be reconfigured. If it is installed on the same network it is being used on, then skip the next step)
(only do this if installed on a different network than it will be used on, or if there are IP configuration errors.) Look through all of the settings in the FOG server gui, and make sure all things that reference IP addresses are properly configured for your network. This varies by FOG version and type of install, so it is a tedious but necessary process. Then, you will need to edit the fog configuration file, which you can find by checking the wiki as it’s location varies by OS and FOG version. You will also need to edit the dhcpd.conf file and the network config settings of the Ubuntu operating system to have the correct IP config settings. (This may vary by Ubuntu version, or linux version, so check the wiki and the proper documentation for that OS).
TFTP Errors
The error looks like this or something similar depending on configuration:
If you get a tftp or ftp_put() error when trying to update the kernel, these are the solutions we've found:
Solution 1: Credentials
There are a few different places where FOG uses credentials to manage different files using the fog user account. If the credentials mismatch in any of the places, some functionality will not work. In total there are four different places where those credentials should match (on a standard installation at least, if you need it different you know what you are doing and probably don't need this). The places where credentials need to match can be found in these places:
- Web Interface -> Storage Management -> [Your storage node] -> Management Username & Management Password
- Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_USERNAME & FOG_TFTP_FTP_PASSWORD
- The local 'fog' user's password on the Linux FOG server
- Server file: /opt/fog/.fogsettings -> username and password settings (For recent FOG Trunk versions only. 1.2.0 does not have this setting. 1.3.0 and newer versions at the time of writing will contain this.)
The first two are easy to check, just use the FOG web interface using a web browser on the host or a machine on the same network.
The fog user password can be changed by using the command:
sudo passwd fog
The server file can be edited using vim in the Linux terminal:
vi /opt/fog/.fogsettings
(More info on vim or vi can be found here.
Official FOG documentation on this issue can be found here.
Solution 2: Use a Kernel Install Script
If the first solution doesn't fix the problem, then this probably will. This solution is to manually install the kernel update through a script in the terminal, and as long as you have the correct permissions and a somewhat new version of Linux (CentOS 7+, Fedora 19+, RHEL 7+, Debian8+, and Ubuntu14+) this should work fine.
This script will backup the old kernel versions you already have installed in case of emergency, and will update to the newest ones. It has comments within it to make it easy to understand exactly what each step does.
#Delete previous backed up kernels & inits.
rm -rf /var/www/html/fog/service/ipxe/old
#Make a directory to put old kernels & inits into.
mkdir /var/www/html/fog/service/ipxe/old
#Move old inits, get new ones.
mv /var/www/html/fog/service/ipxe/init.xz /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/inits/init.xz -O /var/www/html/fog/service/ipxe/init.xz
mv /var/www/html/fog/service/ipxe/init_32.xz /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/inits/init_32.xz -O /var/www/html/fog/service/ipxe/init_32.xz
#Move old kernels, get new ones.
mv /var/www/html/fog/service/ipxe/bzImage /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/kernels/bzImage -O /var/www/html/fog/service/ipxe/bzImage
mv /var/www/html/fog/service/ipxe/bzImage32 /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/kernels/bzImage32 -O /var/www/html/fog/service/ipxe/bzImage32
#Reset Ownership:
#Fedora, CentOS, RHEL:
chown -R fog:apache /var/www/html/fog/service/ipxe
#Ubuntu, Debian:
chown -R fog:www-data /var/www/html/fog/service/ipxe
#Set permissions:
chmod -R 775 /var/www/html/fog/service/ipxe
#Script complete.
echo DONE!
The official FOG documentation can be found here at the bottom of the page.
Multicast Not Working
If after an update Multicast stops functioning, or you find it stops working at some point, this is what has worked in the past.
Please note this will not fix any and all Multicast problems, but it did fix our issue where it would open partclone and not start the cast itself, and it showed the error This is not the master node
in the logs for multicast
Multicast Repair Step One
This first step may seem scary, but it will not damage any of the FOG images or files.
We are going to delete the directory /opt/fog
sudo rm -r /opt/fog
(The -r is necessary to delete directories)
Then rerun the installer by downloading the version of FOG you were using (or the latest one available if you're not using it). Then try running a multicast and see if it works. If not, move on to step two.
Multicast Repair Step Two
This step will require us to modify the MySQL tables by running some commands in the terminal. You should run sudo su
before running the script to make things easier.
Below are the commands you will need to run:
mysql
use fog
DELETE FROM `multicastSessions` WHERE 1;
DELETE FROM `multicastSessionsAssoc` WHERE 1;
DELETE FROM `tasks` WHERE `taskTypeID` = 8;
quit
This will clear the MySQL tables. After this you will need to rerun the installer and everything should work fine from there.
The official Multicast FOG Documentation can be found Here.
For Issues You Can't Solve with This Page
Check the FOG Project Wiki and the FOG Project Forums. These pages should solve any other issues you have, and any issues you solve that aren't on here should be properly documented here to help future 24PinTechs.
The Sanders-Cure-All
If there is an issue with FOG that is not easily solvable, you can follow these steps and 9/10 times it will fix it. All of these steps are found in different solutions for other problems, but done in this order can solve many common problems that seemingly can't be explained. Trust me. I've tried.
When we run commands, they are run in the Linux terminal, and run them as sudo (that means do the command sudo su
before running them to make it easier, if it throws an error saying not to run as sudo, then open a new terminal and don't run the sudo command first.
Step One
First we run the manual kernel update script, to ensure that all our kernels aren't broke and are the latest version:
#Delete previous backed up kernels & inits.
rm -rf /var/www/html/fog/service/ipxe/old
#Make a directory to put old kernels & inits into.
mkdir /var/www/html/fog/service/ipxe/old
#Move old inits, get new ones.
mv /var/www/html/fog/service/ipxe/init.xz /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/inits/init.xz -O /var/www/html/fog/service/ipxe/init.xz
mv /var/www/html/fog/service/ipxe/init_32.xz /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/inits/init_32.xz -O /var/www/html/fog/service/ipxe/init_32.xz
#Move old kernels, get new ones.
mv /var/www/html/fog/service/ipxe/bzImage /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/kernels/bzImage -O /var/www/html/fog/service/ipxe/bzImage
mv /var/www/html/fog/service/ipxe/bzImage32 /var/www/html/fog/service/ipxe/old
wget https://fogproject.org/kernels/bzImage32 -O /var/www/html/fog/service/ipxe/bzImage32
#Reset Ownership:
#Fedora, CentOS, RHEL:
chown -R fog:apache /var/www/html/fog/service/ipxe
#Ubuntu, Debian:
chown -R fog:www-data /var/www/html/fog/service/ipxe
#Set permissions:
chmod -R 775 /var/www/html/fog/service/ipxe
#Script complete.
echo DONE!
Step Two
Now we delete everything that has to do with FOG from the MySQL server. Cause MySQL hates us so we fight fire with fire.
mysql
use fog
DELETE FROM `multicastSessions` WHERE 1;
DELETE FROM `multicastSessionsAssoc` WHERE 1;
DELETE FROM `tasks` WHERE `taskTypeID` = 8;
quit
Step Three
Now we need to delete most of the FOG files that are on the server, cause FOG itself hates us to. Don't worry, it's not you, it's them.
sudo rm -r /opt/fog
(This doesn't delete any settings or images don't worry
Step Four
Now we start to reinstall FOG, because a lot of it is no longer there. IF THERE IS A NEWER VERSION, THIS IS A GOOD TIME TO UPGRADE. IT'S ALREADY BROKEN, AND NEWER VERSIONS HAVE GOTTEN A LOT MORE STABLE PLEASE
Download FOG (it is recommended that you get the latest version from here).
If there isn't a new version and the FOG files are still in the downloads folder, then you can skip this step.
Step Five
Run these commands in the download directory (this requires an internet connection): tar -xzvf FOG_FILENAME_HERE.tar.gz && cd FOG_FILENAME_HERE/bin && sudo ./install.sh
TIP: After starting the install command (sudo ./install.sh)
, don’t cancel while the installation is in progress as some files will remain and may cause issues when trying to install later.
PPS: It should find the old settings and try and pull some of the config. It might not. Verify all settings while running the installer.
Step Six
Now FOG may have changed some passwords. Yeah, it can do that.
There are a few different places where FOG uses credentials to manage different files using the fog user account. If the credentials mismatch in any of the places, some functionality will not work. In total there are four different places where those credentials should match (on a standard installation at least, if you need it different you know what you are doing and probably don't need this). The places where credentials need to match can be found in these places:
- Web Interface -> Storage Management -> [Your storage node] -> Management Username & Management Password
- Web Interface -> FOG Configuration -> FOG Settings -> TFTP Server -> FOG_TFTP_FTP_USERNAME & FOG_TFTP_FTP_PASSWORD
- The local 'fog' user's password on the Linux FOG server
- Server file: /opt/fog/.fogsettings -> username and password settings (For recent FOG Trunk versions only. 1.2.0 does not have this setting. 1.3.0 and newer versions at the time of writing will contain this.)
The first two are easy to check, just use the FOG web interface using a web browser on the host or a machine on the same network.
The fog user password can be changed by using the command:
sudo passwd fog
The server file can be edited using vim in the Linux terminal:
vi /opt/fog/.fogsettings
(More info on vim or vi can be found here.
Official FOG documentation on this issue can be found here.
If you need to run as sudo and it says the password has already changed (like you can't run sudo) look at the .fogsettings file and it will contain the *new* password in plaintext. It is gonna be long and is gonna suck. If you are logged out and need to get back in, log in as guest or as another user, or boot off of a bootable linux live usb, and go to the file and take a picture of the password.
Step Seven
The FOG Server may be fixed at this point, and if so yay! You're done. If it is still acting up there is more to do.
Run steps two through six again and it should work, it usually is always good after a second try. If that doesn't work you'll have to do more than the cure-all, cause every time it's gone more than two it was a more in depth issue.
xRDP
This is a very useful tool that is currently installed on our FOG server. This allows for any Windows user to use remote desktop to remotely control the host Linux system with full GUI support. To connect just use the FOG IP, and when prompted type in the login.
To learn more about xRDP, go to the wiki page: xRDP
FOGBANK SERVER
the fogbank server is the server that runs our fog server for our classroom, this computer cannot be accessed via remote desktop, you need to go into the back in order to access the computer.
- Processor: Intel Xeon CPU @2.80 CPU
- Memory:
- Storage: Samsung SSD 850 GB
- System: