FOGUserGuide
From FOGWiki
A guide to deployment, management, And concept overview For FOG.
Based on a document by: Thomas J. Munn CISSP
Introduction
Preface
This document is intended to be modified by FOG users, in fact it is based on a document created by a FOG user. If you feel something could be said better or put more clearly, it is encouraged that you make changes to this document. We just ask that you keep it constructive and in good taste. In order to edit the wiki you are now required to create an account, as spamming of the forum has gotten pretty bad recently.
What is FOG?
FOG is a Linux-based, free and open source computer imaging solution for Windows XP, Windows Vista, and Linux (limited) that ties together a few open-source tools with a php-based web interface. FOG doesn't use any boot disks, or CDs; everything is done via TFTP and PXE. Also with FOG many network drivers are built into the kernel, so you don't really need to worry about nic drivers (unless there isn't kernel support for it yet). FOG also supports putting an image that came from a computer with a 80GB partition onto a machine with a 40GB hard drive as long as the data is less than 40GB. FOG supports multi-casting, meaning that you can image many PCs from the same stream. So it should be as fast whether you are imaging 1 PC or 20.
How should FOG be implemented?
FOG is best implemented on a dedicated server, any spare machine you have. We recommend that you have sufficient hard drive space as each image you make is usually between 5 and 10 GB and it's best to have a gigabit NIC with as much processor and RAM you can throw at it.
What features are included with FOG?
FOG is more than just an imaging solution, FOG has grown into a imaging/cloning and network management solution. FOG now performs tasks like installing and managing printers, tracking user access to computers, installing applications remotely via snapins, and automatic user log offs. If a computer is badly infected with a virus or malware, you can boot FOG in AV mode and have it remove the viruses. You can wipe your disks, destroying all information that was on them, you can restore deleted files, or scan the disk for bad blocks.
How much does FOG cost?
FOG is an Open Source project and licensed under the GPL which means that you are free to use FOG on as many computers as you like for free. This also means that if you want to make any changes to the source code you are free to do so.
The creators of FOG make no profits from this project with the exception of donations. FOG comes with absolutely NO WARRANTY and the creators of FOG are in NO WAY RESPONSIBLE FOR ANY DAMAGE OR LOSS CAUSED BY FOG! Please see the license file included with the FOG release for more information. With that being said we attempt to do a very good job of supporting our users, in fact it is one of the goals of FOG to have better support than most commercial products. All support requests should be placed through the FOG's sourceforge forum which is located at:
http://sourceforge.net/forum/?group_id=201099
Thanks for supporting open source software and enjoy!
Background on FOG
Why FOG?
Working in an educational environment our organization's techs very often re-imaged computers in their day to day activities. For a long time we used a commercial product that in many ways didn't meet our needs. It wasn't web based, and you needed to create driver disks, floppys or USB drives. Other things were very difficult, such as searching for a host by MAC address and the product was expensive, even with an educational discount. So we started to investigate ways in which we could do things better, and as our organization struggled to make a commercial product work better by trying to pxe boot dos, and testing it in Windows PE, we, the FOG Team started to build linux based solution on our own time. We finally got a working version and decided to release it as open source since we use many other open source products, and figured we should give back to the community.
Installation
Fedora
Overview
- Note * Please understand that this tutorial will have you destroy all data on your hard disk.
Fedora is a Free Linux based operating system. This installation guide assumes that you have a basic understanding of the Linux command line environment, with using commands like ls, cp, mkdir.
If you wish to use a large storage device to store your images, like a raid array or separate hard disk, it should be mounted during installation as /images.
Known Issues
The FOG installer will only work cleanly on English versions of Fedora. (Fixed with version 0.13 of FOG!)
After you are done installing FOG you are going to need to update / edit a few settings in Fedora before the server is fully working and usable. Please see the links below for configuration changes that will need to take place.
Installing Fedora
The first thing to do is download and burn an ISO image of Fedora 8 or later from http://fedoraproject.org/. You may use either the 32 or 64 bit versions, both have been reported to work without issue.
Next boot off the CD / DVD you just created to start the Fedora installation process. (We do not recommend that you attempt to install the OS that will be running FOG in a VM environment, as many users have reported performance related issues!)
You should see a screen similar to the pictured below, select: Install or Upgrade an existing System and press enter.
You will then be prompted if you would like to test the installation media, choose: Skip and press enter.
If you run into problems with your installation you can start the installation process over and run the media test to check for a bad burn.
Now the graphical portion of the installation will begin. At the welcome screen, press: Next.
Next you will be prompted for the installation language, choose you appropriate language and press: Next.
You will now be asked about disk partitioning. Select Remove all partition on the selected drives and create default layout, then click: Next. If you have a large disk or storage array this is the point where you would manually partition the drive and mount that disk/array as /images.
You will now be asked about network addressing, select the network device you would like to use by putting an check in the box next to the device name then, click on the edit button.
Assign the network device a IPv4 address with subnet mask and disable IPv6 support, then click OK.
Enter a DNS server and gateway address along with a hostname, then click: Next.
Next you will be prompted about you timezone information, select your timezone and click: Next.
The next screen will prompt you to create a root password, enter a password in the textbox and confirm, then press: Next. Remember this password you will need it later.
The next screen will prompt you to select the software groups you would like to install, uncheck Office and Productivity and then click: Next.
Then on the next screen click Next to start the installation. This step will take some time, so please be patient. When installation is complete, remove all disks from the CD/DVD drive and click reboot to restart the computer.
Selecting First Boot Settings
The first time Fedora boots it will load a setup wizard, which allows you select how you would like Fedora to operate. These options have changed in later versions of Fedora, so it options for SELinux and Firewall are not present that will have to be configured after login.
At the first boot welcome screen, click: Forward.
The next screen will ask you to accept the license agreement, do so and click: Forward.
The next screen is about the firewall, change the firewall to: Disabled and click: Forward.
The next screen will ask you about SELinux, set SELinux Setting to: Disabled and click: Forward.
The next screen will prompt you for the date and time settings, click: Forward.
The next screen will ask if you would like to send your hardware profile to Fedora select an option and click: Forward.
You will now be prompted to create a user, create a regular user that can be used after the FOG installation process. For the installation of FOG we will use the root user we created earlier in the installation process. You can proceed by clicking: Forward.
The first boot wizard is now complete and you will be prompted to restart your computer.
Setting up FOG
(health warning: this flash video consumed all 1.5GB of my physical (ram) and virtual (swap) memory while it played, when it was all used up, the video crashed)
If you are running Fedora 9 +, you will need to disable SELinux and IPTables before installing FOG.
Your system is now ready to login to and install the FOG application suite.
Log into Fedora using the root username and password you created during installation.
Now we must download the FOG package from sourceforge. To do this click on
Applications -> Internet -> Firefox Web Browser
and enter the URL http://www.sf.net/projects/freeghost.
Then click on the Download link.
Then click on the latest release to start the download and save the package to the /opt directory. It should be named something like fog_x.xx.tar.gz
Open a terminal
Applications -> System Tools -> Terminal
and type:
cd /opt tar -xvzf fog* cd fog* cd bin ./installfog.sh
You will be prompted for the Linux distro you are installing, enter 1 and press enter.
You will be prompted for the installation mode, either N (Normal Server) or S(Storage Server). If you are not sure which option to select, use N for Normal Installation. (Version 0.24 and up)
The installer will ask you for the IP address of the server, then press enter.
The installer will ask if you would like to enter a router address for DHCP, if you would like to press y and press enter, then enter the address, then press enter.
The installer will ask if you would like to enter a DNS address for DHCP and the boot image, if you would like to press y and press enter, then enter the address, then press enter.
You would then be prompted if you would like to change the default interface from eth0, if you would like press y, press enter and add the interface (if you are unsure, select n).
After the installation has completed open Firefox again and enter the URL: http://[youripaddress]/fog/management. You will then be prompted to install the database schema. Click on the Install/Update Now button.
When the schema is up to date, attempt to go to the URL: http://[youripaddress]/fog/management again. This time you should be prompted to login
username: fog password: password.
Setting up Wake On Lan
If you would like to use wake on lan with FOG, you will have to run the following commands as root:
visudo
Scroll to the line that says
Defaults requiretty
Press i to enter insert mode. Change the line to:
# Defaults requiretty
Hit ESC to exit insert mode. Now type:
:wq
and press the enter key.
Testing your installation
After login, click on the Hosts button (single computer monitor).
Then click on the Add New Host button. Enter at least a MAC address (seperated by :) and a hostname and click the Add button.
Now click on the Tasks button (the star).
Then click on List All Hosts and find the host you just created and click on the Advanced button.
Now under Advanced Actions click on Memtest86+ and confirm that you would like to start the task.
Now click on Active Tasks and you should see the task that you just created listed.
Lastly, start the client computer that you created a task for and ensure that in BIOS, PXE boot has the highest boot priority. If everything worked correctly, you should see memtest86+ load.
Notes
- Be sure to assign a STATIC ip address to your PC or FOG won’t work correctly.
- Be sure to uncheck ‘firewall, selinux’ when creating the initial system. This will prevent problems later in the install.
- Also your computer needs to be working and ‘internet’ functional prior to running the FOG install. FOG goes out to the internet to get the packages necessary for installation. It is a good idea to update your system PRIOR to installing FOG, via the ‘yum update’ command.
- Please be aware of the following prior to reboot following the installation: FOG installs a DHCP server, so if you have another DHCP server, it will conflict with it. Probably a good idea to put the FOG server on a dedicated ‘lab’ network w/o a dhcp server, or that you disable FOG's DHCP server. Also it is CRITICAL that you type in the ‘correct’ ip address for the FOG server, probably the IP that you chose for the initial install.
Ubuntu
Previous Tutorials
Overview
In this tutorial we are using the 9.04 Desktop (live cd) release of Ubuntu, but FOG can also be installed on any later version of the desktop and server edition.
Known Issues
This tutorial will probably only work with the English Installation of Ubuntu.
After you are done installing FOG you are going to need to update / edit a few settings in Ubuntu before the server is fully working and usable. Please see the links below for configuration changes that will need to take place.
Installing Ubuntu
An Ubuntu cd/dvd can be obtained from:
After burning a cd/dvd of the ISO image, we must boot the live cd.
During boot select Install Ubuntu menu item.
The first screen that loads will ask for your language preference, in this example we will select English and click forward.
The next screen will ask you about your time zone settings, in our example we will select Chicago and click forward.
The following screen will ask you for your keyboard layout, in our example we will select U.S. English and click forward.
The next screen will prompt you for partitioning information, we will select to use entire disk, and click forward.
Now you will need to enter some user account information, enter the required information and click, forward.
On the final screen, click install to start the installation process.
At this point the installer will take over, this process may take a long time, so please be patient.
When you are prompted, restart the server.
Ubuntu Configuration
After the computer restarts, login with the user you created during installation.
Settings a static IP Address
Newer versions of Ubuntu use an application called network-manager to manage network connections, which works great with desktops and laptops, but not so well for servers, so we are going to remove network-manager.
Applications -> Accessories -> Terminal
Now type:
sudo apt-get remove network-manager
Now lets setup a static IP address:
sudo gedit /etc/network/interfaces
Enter the following information in the text file:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address [your.static.ip]
netmask [your.net.mask]
network [your.network]
broadcast [your.broadcast.addy]
gateway [your.gateway]
Here is a example:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
Save the file and close it.
Now we will set a name server (dns) address.
sudo gedit /etc/resolv.conf
Add the following line:
nameserver 192.168.0.1
Then also save this file and restart your server. You can confirm your ip address is set by typing the following after your server restart.
sudo ifconfig
Setting up FOG on Ubuntu
Now we must download the FOG package from sourceforge. To do this click on Applications -> Internet -> Firefox Web Browser and enter the URL
http://www.sf.net/projects/freeghost.
Then click on the Download link.
Then click on the latest release to start the download and save the package to the /opt directory. It should be named something like fog_x.xx.tar.gz
or by using command line
cd /opt sudo wget http://downloads.sourceforge.net/freeghost/fog_x.xx.tar.gz
Open a terminal (Applications -> Accessories -> Terminal) and type:
cd /opt sudo tar -xvzf fog* cd fog* cd bin sudo ./installfog.sh
You will be prompted for the Linux distro you are installing, enter 2 and press enter.
You will be prompted for the installation mode, either N (Normal Server) or S(Storage Server). If you are not sure which option to select, use N for Normal Installation. (Version 0.24 and up)
The installer will ask you for the IP address of the server, then press enter.
The installer will ask if you would like to enter a router address for DHCP, if you would like to press y and press enter, then enter the address, then press enter.
The installer will ask if you would like to enter a DNS address for DHCP and the boot image, if you would like to press y and press enter, then enter the address, then press enter.
You would then be prompted if you would like to change the default interface from eth0, if you would like press y, press enter and add the interface (if you are unsure, select n).
Would you like to use the FOG server for dhcp service? [Y/n]
DHCP will not be setup but you must setup your
current DHCP server to use FOG for pxe services.
On a Linux DHCP server you must set:
next-server
On a Windows DHCP server you must set:
option 066 & 067
FOG now has everything it needs to setup your server, but please
understand that this script will overwrite any setting you may
have setup for services like DHCP, apache, pxe, tftp, and NFS.
It is not recommended that you install this on a production system
as this script modifies many of your system settings.
This script should be run by the root user on Fedora, or with sudo on Ubuntu.
Here are the settings FOG will use:
Distro: Ubuntu
Server IP Address: 192.168.0.150
DHCP router Address: 192.168.0.1
DHCP DNS Address: 192.168.0.150
Interface: eth0
Using FOG DHCP: 0
Are you sure you wish to continue (Y/N) Y
During the installation you may be prompted to set a MySQL root password, leave this blank unless you wish to edit the FOG config.php files before the next step (by using sudo vi in the terminal, see file locations below).
/opt/fog/service/etc/config.php and /var/www/fog/commons/config.php
Both of these have to be edited with the MySQL password if you set one, for Fog to function properly.
After the installation has completed open Firefox again and enter the URL: http://[youripaddress]/fog/management. You will then be prompted to install the database schema. Click on the Install/Update Now button.
When the schema is up to date, attempt to go to the URL: http://[youripaddress]/fog/management again. This time you should be prompted to login
username: fog password: password.
Setting up Wake On Lan
No special settings are required for Ubuntu.
Testing your installation
After login, click on the Hosts button (single computer monitor).
Then click on the Add New Host button. Enter at least a MAC address (seperated by :) and a hostname and click the Add button.
Now click on the Tasks button (the star).
Then click on List All Hosts and find the host you just created and click on the Advanced button.
Now under Advanced Actions click on Memtest86+ and confirm that you would like to start the task.
Now click on Active Tasks and you should see the task that you just created listed.
Lastly, start the client computer that you created a task for and ensure that in BIOS, PXE boot has the highest boot priority. If everything worked correctly, you should see memtest86+ load.
CentOS/RHEL
Overview
The Fedora installer works without issue for CentOS install, assuming use of CentOS 5.4 (32 bit only tested). This walkthrough is for CentOS 5.3.
Known Issues
Some packages are unavailable, causing an error during the installer script. Follow the instructions below to install them so the script runs properly.
Installing CentOS
- Download the CentOS 5.3 CD1.
- Boot into graphical install mode
- After the media check, the GUI installer will come up
- Select Language & Keyboard
- Select the desired partitioning configuration
- Setup IP networking.
- Set Timezone
- Select root password
- At the software packages section, you must uncheck Desktop-Gnome, then select "Customize Now".
- Unselect Base/Dialup Networking Support
- Unselect Applications/Text-Based Internet
- Proceed with the install & reboot when prompted.
Post Installation Tasks
On first boot, a setup section appears. Run the Firewall configuration.
- For a basic configuration, set security level to Disabled, and SELinux to Disabled.
Setting up FOG on CentOS
Installing on 0.26
- download/scp the fog installer to the /root folder of your CentOS server.
- Install yum-priorities
yum install yum-priorities
- Download the current RPMForge for your system from http://packages.sw.be/rpmforge-release/ or another repository
- Install rpmforge
rpm -i rpmforge-release-0.3.6-1.el5.rf.i386.rpm
- Extract FOG
tar -xvzf fog_0.26.tar.gz
- Fix the Path to include files used by the FOG Installer
PATH=$PATH:/usr/sbin:/sbin
- launch the installer
cd fog_0.26/bin ./installfog.sh
- Go through the install script, selecting Fedora
- The rest of the install is identical to the Fedora section now.
If you get an error of: * Starting FOG Multicast Management Server...Failed! then just re-launch the installer & it will work the second time through
Installing on 0.27
The installer is more CentOS friendly with 0.27. The only piece missing is RPMForge, so htmldoc can be seamlessly installed.
- Download the current RPMForge for your system from http://packages.sw.be/rpmforge-release/ or another repository
- Install rpmforge
rpm -i rpmforge-release-0.3.6-1.el5.rf.i386.rpm
You can now do a regular install.
VMWare
Overview
With the release of Version 0.19 of FOG we have also released a VMWare image. What we set out to do with this release was to attract new users to FOG by allowing users that may not have much spare time, to run fog without much effort. The image weighs in at just over 600MB zipped, and it based on Ubuntu server 8.04. We do not have plans nor time to release a vm image with every release of FOG, we may release an updated vm somewhere in the ballpark of every 5 to 10 releases. We that being said the VM does allow you upgrade to the latest version of FOG with minimal effort.
It was not our intent with this release to have users run this in a production environment, we would recommend that users wishing to run FOG in production, run it on bare metal whenever possible.
If you wish to set up a FOG server using VMWare please make sure that the host system has plenty of memory available due to the high amount of I/O generated by the server.
VMWare Software
To setup and run VMWare on a host machine you will first need to purchase and install either the VMWare Workstation or Server. Both products can be downloaded with a 30 day trial at VMWares site [7]. I have been informed that you can also run this installation on VMWare player (free) but I have not been able to confirm this. This tutorial will focus on the installation and configuration using the VMWare Workstation, however this can easily be applied to ESX Server or any other virtual appliance.
Known Issues
Running the VMWare image on a Windows operating system is fairly straight forward, however there are a few things you will need to look out for when you are first getting started.
- Network Card Configuration
- IP Configuration
- Editing php.ini in VIM
- Changing the default root password
- TFTP Password Configuration
We will cover the setup and configuration of these items in installation guide. Please note, there are also knowledge base articles that can assist you further with this.
Installation
VMWare takes the least amount of configuration, and is a great way to get started working with FOG.
Start by downloading the latest VMWare image off of Sourceforge's website [8] and saving it to a working directory, in this example I am going to save it to my desktop. Unzip the download and extract it to its own folder.
Open the FOGServer.vmx in the extracted folder and then go to Edit virtual machine settings.
When using VMWare you will want to edit the network configuration settings so other PC's are able to reach the server on your network. I highly suggest that for the inexperienced user that you use a bridged network configuration as shown in the image above.
Let VMWare start up, and then log into the server using the supplied password. (root / password)
FOG will now ask you to input your current networking information. It is important that you take the time to find out what network settings you currently have in place.
- Go to your command prompt and do an ipconfig /all to view your current IP information.
- Enter a new IP address not currently taken by your DHCP server, and match the rest of your networking information (Subnet / DNS / etc.)
- If you are unsure of what type of networking you have in place you can visit our Knowledge Base for further information.[[9]] We have articles on configuring FOG for a home networks as well as Enterprise environments (DHCP server / etc)
Below is an example of how I configured my VMWare image. Your results may vary depending on your networking setup and location.
Now that Linux has your networking information it will not proceed with the installation and configuration of FOG.
FOG will ask you What version of Linux would you like to run the installation for?
- Redhat Based Linux (Fedora, CentOS)
- Ubuntu Based Linux (Kubuntu, Edubuntu)
Choice: [2]
By default the VMWare image is setup to go with Ubuntu, so hit enter [2] and continue with the installation.
Hit [N] for a normal server installation. If you wish to learn more about advanced storage options with FOG please read our knowledge base articles [[10]]
Now FOG will proceed with the installation and configuration. You will be asked some more networking questions. Below is an example of how I set up my own FOG VM server. Please note that this information may be different for you, so check and verify your own networking settings before proceeding further.
FOG now has everything needed to setup and install on your VMWare image. Hit Yes and continue with the installation as shown below.
Please select yes and send some some information off to the FOG developers to know how many active users we currently have with this project. No personal information is retained when doing so, just your IP address.
Testing the Install
Let the FOG server run and go back to your host machine and attempt to log into the web interface. I set my FOG server to be 192.168.1.150 so all I need to do is enter that into the web address line in my browser.
You will need to backup your database prior to using FOG for the first time.
Remember that the default login for FOG is (fog / password )
Your FOG installation is now complete! You can test / verify this by PXE booting a different PC on your network and seeing if it works.
Important please read
Additional DHCP configuration will need to be completed if you are using a Windows Server for DHCP or a router with non standard firmware (DD-WRT / Tomato / etc). Please see our knowledge base articles on this - [[11]]
Additional Configuration
Because the VMWare of FOG is based upon Ubuntu, we will need to perform some additional configuration before FOG is fully functional.
Please note: If you ever re-run the FOG setup (option 2) you will need to modify these settings again.
Root Password
We will need to change the default Root password of the VMWare installation. To do this please type the following.
passwd fog Enter new UNIX password: password Retype new UNIX password: password
Once you type and verify the new password you are finished. Example is shown below
Modifying PHP to allow larger snapins
If you wish to upload snapins larger than 2MB you will need to modify a few php settings in Fog. Please follow the link on how to edit your php.ini file in VIM - [[12]]
Modifying your TFTP Password
You are also going to want to modify your TFTP password so you are able to made additional customizations. Being able to FTP into your FOG server will allow you to modify the pxe boot menu to allow additional software plugins / chang your background image / backing up images / etc.
Please see the following link - [[13]]
Knowledge Base
KB Link for those reading User Guide
Modifying existing DHCP server to work with FOG
If you already have a DHCP server setup on your network you don't want two. So if you chose to not install DHCP during FOG installation you will need to set some options in your current DHCP server to point PXE services to the FOG server.
Windows
To set options 066 and 067 on Windows Server:
- Open DHCP configuration Start > Administrative Tools > DHCP.
- Then expand your server, expand the applicable scope (often only one is there)
- right click on Scope Options
- click Configure Options
- tick 066 and enter the IP Address of the FOG server
- tick 067 and enter pxelinux.0 (thats a zero).
- Make sure that 060 is unticked.
Linux
If you would like to use an existing Linux based DHCPD server you will need to perform the following steps:
- Edit your dhcpd.conf file (ie: vim /etc/dhcpd.conf)
- In the global section or in a subnet declaration add next-server X.X.X.X; and filename "pxelinux.0";
- Restart your dhcpd server (ie: service dhcpd restart)
Cisco
If you would like to use a DHCP-enabled Cisco router you will need to perform the following steps:
- Enter priveleged mode (enable).
- If you don't know your DHCP pool name, enter show running-config and look for ip dhcp pool in the output.
- Enter global configuration mode (configure terminal).
- Enter DHCP scope configuration mode (ip dhcp pool <pool name>).
- Configure the following options:
- next-server <ip address to fog server>
- bootfile pxelinux.0
- Exit configuration mode by entering exit twice.
- Save your configuration (copy running-config startup-config).
DD-WRT
If you would like to use a DD-WRT router for DHCP you will need to perform the following steps:
- Go to the Services tab
- Enable DNSMasq, and Local DNS
- Under Additional DNSMasq Options add the following dhcp-boot=pxelinux.0,,X.X.X.X where X.X.X.X is the IP of your FOG server
- Save/Apply settings
Please see our knowledge base article [14] for more information on this.
Upgrading FOG
It is highly recommended that you backup your data before you perform the upgrade.
Upgrading from one version of FOG to a newer version is as easy as running the installer for the new version of FOG. It will update your system while leaving your data in place.
FOG will NOT modify:
- Any modified reports
- Image Files
- All database settings
FOG WILL modify:
- Any Custom changes to php/init.gz file.
- Any changes to dhcpd.conf.
- Any changes to /etc/xinetd.d/tftp.
- Any changes to /etc/vsftpd/vsftpd.conf.
- Any changes to /etc/exports.
Client Setup
When using FOG all clients should be setup to have PXE boot as the first boot device. This allows imaging tasks to be deployed without visiting the client computer, while only slowing down the boot process by a few seconds.
Foundational Concepts
This section provides some basic concepts that the FOG Project uses.
Unicasting
Unicasting in FOG means sending a single image to a single host. This can mean an upload or a deploy, and is independent of the image type.
Multicasting
Multicasting in FOG uses UDPcast to send a single image to multiple computers using only slightly more bandwidth then sending the image to a single computer or unicast. Multicasting in FOG may require special switch configuration. A multicast will not begin until all members are ready to begin by default. This can be changed by editing UDPSENDER_MAXWAIT in /opt/fog/service/etc/config.php which is in seconds.
Queuing
FOG uses a simple queuing system to prevent its storage severs being overworked. If you have a single FOG storage node in FOG with a queue size of 10, then this means that if you unicast an image to 30 computers, only the first 10 computers will be imaged. The other 20 computers will be waiting "in queue" for an open slot. What will be seen on the client side is the following:
This queue system allows for the IT staff to start tasks for hundreds or thousands of computers and let FOG manage the clients so the servers don't get overwhelmed with client requests.
Menu Bar
This menu appears at the top of every page on Fog's web UI. The icons are, from left to right:
Home/Dashboard - This is the home screen of the FOG management portal.
Users - Individual administrators of the FOG resources.
Hosts - This section houses the hosts, which are the pcs to be imaged or to extract images from.
Groups - This section houses groups, which are similar PCS’ that need tasks done en-masse.
Images - This section allows you to manage the image files stored on the FOG server.
Storage Management - This section allows you to add/remove storage nodes from the FOG system.
Snap-ins - This section provides ways to automate various post-imaging tasks, not covered in this document
Printers' - This section allows for management of printers, allowing you create printer objects that can later be assigned to hosts or groups.
FOG Service Configuration' - This section allows you to control how the client service functions.
Tasks - This section allow you to perform imaging tasks such as acquiring or deploying images.
Reports - Reports let you pull information from the FOG database either as HTML, pdf, or csv.
Info/Misc - The section has the rest of the settings that don't fit anywhere else like the kernel updater and the client service updater.
Logoff - Click this to log off of the Fog web UI.
Note: “Groups” do not control group memberships. Group memberships are controlled via the ‘host’ icon.
High Level FOG functioning
1.FOG requires that all hosts be entered in either a CSV file (described later) or manually via the gui. The most important part is getting the MAC address of the host right. FOG uses the MAC for targeting image installs and acquires. Using the wrong MAC could result in unpredictable results, including the complete erasure of the wrong pc! The IP address isn’t that important, and the ‘name’ field is more for the user. Mac address format is 00:12:3F:C4:57:0C . Using dashes, spaces, or no items at all will result in the GUI not accepting the host.
2.After hosts are entered, it is wise to group them together by function, hardware, or common image. The image will be shared among all members of a particular group. This occurs within the ‘hosts’ screen, and NOT on the groups screen. This is a little confusing, so it helps to think of the ‘groups’ screen as a task generator, rather than controlling group memberships.
3.Hosts are then configured to boot via PXE boot by going into the BIOS. Make sure PXE boot is the FIRST option, NOT the hard disk, or things won’t work.
4.Configure your ‘master’ pc for the first image. Probably a good idea to run ‘sysprep’ prior to imaging, but not necessary. Sysprep will make your imaging life easier, if hardware is different, etc. See Microsoft.com for more details on using sysprep.
5.Assign a ‘task’ to the ‘master’ pc, to ‘upload’ the image to the FOG server.
6.Reboot the master PC, and FOG will acquire the image.
7.Deploy the image to other pcs by deploying to groups etc. Groups also use the ‘multicast’ feature, greatly speeding up imaging time. Tasks must be made before computers will be imaged.
FOG Benchmarks
About FOG Benchmarks
We have done some internal testing of FOG using a flat (no vlans or routing) switched network. For our tests here is the equipment we have used:
- Cisco 3750G Gigabit Series Switches
- HP DL320S Server - Main FOG Server
- Fedora 9
- 2 x Intel Xeon 2.66 GHz
- 4 GB Memory
- 12 x 750GB - Raid 5
- 2 x 1GB NICs (Bonded as a single interface)
- $2,000 Desktop PC With 3Ware Storage Array and Controller - FOG Storage Node
- Fedora 10
- Pentium D 2.8Ghz
- 4 GB Memory
- 1 GB NIC
- 30 Dell GX270 - Desktop Clients
- 30 HP DC7600 - Desktop Clients
Tests Cases
Test 1
Description:
30 Clients with 2 Servers (1 Master & 1 Storage) with a total queue size of 20 (10/10).
| Servers | 2 |
| Client Count | 30 |
| Master Server Queue Size | 10 |
| Storage Server Queue Size | 10 |
| Image Size | 13.23GB |
| First Client Completed | 9 minutes 12 seconds |
| Total Task Completion | 27 minutes 32 seconds |
Test 2
Description:
30 Clients with 2 Servers (1 Master & 1 Storage) with a total queue size of 30 (20/10).
| Servers | 2 |
| Client Count | 30 |
| Master Server Queue Size | 20 |
| Storage Server Queue Size | 10 |
| Image Size | 13.23GB |
| First Client Completed | 12 minutes 42 seconds |
| Total Task Completion | 14 minutes 14 seconds |
Test 3
Description:
60 Clients with 1 Server (1 Master) with a total queue size of 30.
| Servers | 1 |
| Client Count | 60 |
| Master Server Queue Size | 30 |
| Storage Server Queue Size | N/A |
| Image Size | 13.23GB |
| First Client Completed | N/A |
| Total Task Completion | 40 Minutes 3 Seconds |
Test 4
Description:
60 Clients with 2 Servers (1 Master & 1 Storage) with a total queue size of 30 (20/10).
| Servers | 2 |
| Client Count | 60 |
| Master Server Queue Size | 20 |
| Storage Server Queue Size | 10 |
| Image Size | 13.23GB |
| First Client Completed | N/A |
| Total Task Completion | 25 Minutes 57 Seconds |
Managing FOG
Dashboard
Overview
The FOG dashboard is the first page you are presented with after login. This page just gives you an overview of what is happening on your FOG server.
System Overview
The system overview box is the the top left hand box on this page. The information presented in this box is the current user, the server IP addresse or hostnames for your web server, tftp server and storage server (which can all be different). This section also gives you the system uptime or how long the system has been running without restart, the number of users logged into the Linux box, and lastly the system load.
System Activity
The system activity box is in the top row, the middle box. What this section shows is the unicast queue, or the number of unicast downloads that are currently in progress, which on a default setup, the maximum value is 10. This means that after 10 hosts are receiving images (at once) the 11th will wait for one of the hosts in progress to complete before starting. The reason this was created was so that you could queue up 100 machines with different images (all unicast) and still keep the system functional. We have heard of this queue being used to re-image an entire building of computers ( ~ 1000+ ) overnight. This section only updates on page refresh, and not in real time.
Disk Information
The disk information box is the top, right hand section of the dashboard page. This is a semi-realtime display of the storage remaining on the storage server. If you get an error in this box, please see Dashboard Error: Permission denied...
30 Day Imaging History
This image shows your imaging trends for the past 30 days
Hosts
Overview
A host in FOG is typically a computer, but it can be any network device. Hosts are used to identify a computer on the network and are used to manage the device.
Adding a new host
Adding a new host can be done in the hosts section of FOG (the single monitor). Then by clicking on the "Add New Host" button on the left hand menu. At least a hostname and a MAC address must be entered in order to add the host to the FOG database.
A host consists of the required fields:
- Hostname - A string used for the Windows Hostname of client, this must be less than 15 characters long.
- MAC address - This field is used in for for a unique identifier for the host. The string must be separated by : (colon), in the format of 00:11:22:33:44:55.
Hosts can also include, but are not required:
- IP address - Just your typical IP address, in the typical formation of X.X.X.X or 192.168.1.1.
- Description - Information for your own reference.
- Image Assocation - This field is a drop down box that will allow you select an image object created in the Images section.
- Operating System - Drop down box that allow you to select the primary type of operating system running on this host.
- Kernel - This is only used if you want to overwrite the default kernel used for FOG.
- Kernel Arguments - This allow you to add additional kernel arguments for booting the host (ie: vga=6, or irqpoll).
- Primary Disk - This option allows you to force a device to use during imaging if fog fails to detect the correct device node.
This page also allows for configuration of Active Directory integration, but this topic will be covered later. When all settings are added, click on the "Add" button.
Adding a new host via client side tasks
This is the preferred method (as of version 0.12), and maybe the easiest method for getting a host into the FOG database, but it requires you to visit the host. When at the client computer, during the boot up process when you see the Boot: prompt, within 3 seconds you must start typing
fog.reg
or
fog.reginput
For more information on these commands please see:
Uploading Host Information
Overview
When getting started with FOG, you need to enter the host information for the devices on your network. We understand this can be a long difficult process, so in order to make this process easier we created a page that allows you to upload most of the host information from a CSV file.
The CSV file that is uploaded to FOG must be in the following format, and the file should not have a header row.
MAC Address, Host name, IP Address, Description, OSID , ImageID
Other notes
- The MAC Address (required) is the NIC's MAC address seperated by : (colon).
- The Host name (required) is the computer's Host name (must be less than 15 characters, should not include underscores, according to [15]).
- The IP Address is the computer's IP address (format x.x.x.x). This field is currently not used by FOG.
- The Description is any text description you would like associated with the computer.
- The OSID is the number representing the operating system. It can be found in the table "supportedOS" in the field osID.
- The ImageID is the number representing the images file linked to this image. The image definition must already exist and this number can be found in the table "images" in the field imageID.
- The bold fields are required.
- The file must be saved as a CSV without a header row.
Uploading the File
- After the file is prepared and saved, you will need to log into the FOG Management Portal.
- Then click on the Hosts icon.
- On the left-hand menu, click on Upload Hosts.
- Browse for your file, then click Upload CSV.
Managing Hosts
Once hosts have been added to the FOG database you can modify or delete them. Finding a host which you wish to edit can be done in two ways, the first is by listing all the hosts that exist. This is done by clicking on the "List All Hosts" button. The second way to locate a host is to use the search function. To search for hosts click on the "New Search" button, if you would like to search for all hosts you can enter a "*" or "%". The search function will search in the host's name, description, IP and MAC address.
Once a host is located, it can be edited by clicking on the edit button. Clicking on the edit button will display all the properties that were shown during host creation with the addition of snapin, printers, active directory, service settings, hardware, virus history, and login information.
The entire host object can be removed from the FOG system by clicking on the delete option at the bottom of the Host Menu.
Creating Host Groups
FOG allows you to create groups of hosts which then allows you to take action on a whole grouping of hosts. Hosts can be created either on the "List All Hosts" section or by doing a search for hosts. To create a group select the computer you would like to be member of the group by placing a check in the box next to the hostname, or by clicking the check all button in the title row. After the hosts are selected scroll to the bottom of the screen and then enter a name in the create to group box or select a group to add the hosts to. Then click on the "Process Group Changes" button.
Groups
Overview
Groups in FOG are used to organize your hosts into real world logical clusters. This is intended to ease management of the computers. A single host can be a member of infinitely many groups, so if a computer happens to be a member of the group called "Third Floor", it could also be a member of "Math Department", or "Dell PCs." Groups make using FOG possible for organizations with a very large number of PC's.
Creating Groups
Groups are created in the hosts section of FOG based on searches, for information on how to create groups, please see Creating Host Groups.
Managing Groups
After a group has been created, it can be managed from the groups section of FOG. Locating groups is very similar to locating hosts, you can either list all groups or you can search for groups. When searching for groups your search criteria is matched against the group name or the group description. Once a group is located it can be modified by clicking on the "Edit" button on the right hand side of the table.
Under the section "Modify Group [Groupname]" there are options to change the group name, group description or to delete the group. If you wish to update the group name or the group description make your change then click on the "Update" button within that section. If you would like to remove the group then simply click on the "Delete" button within this section.
Group Basic Tasks
This section will allow you to start a task on this group of hosts without going to the tasks section of fog. From this section you can start a unicast deploy to all hosts within the group.
Group Membership Setup
This page allows you to view / delete membership of the group. This section will list all of the members of the group and give you the option to remove members from the group.
Group Image Associations
The groups page also allows you to update the image association for all the members of the group. This can be done in the "Image Association for [groupname]" section. Select the image association from the drop-down box and select "Update Images" and then all your host objects for that group will be modified.
Group Operating System Associations
You can also change the Operating System association for all hosts in the group via the OS Assoc Button in the Group Menu. Clicking the update button will apply the changes to all members of the group.
Group Snapins
You can add or remove snapins to all hosts in a group, but because the nature of groups, it is not possible to see what snapins are currently associated with a group. This is because the snapins are not directly associated with the group, the are associated with the host and it is possible for all members of the groups to have different snapins linked with each host. What fog does allow you to do is batch add a snapin to all the hosts within a group. At the same time you can batch remove a snapin from all the hosts within a group. This functions can be done via the Add Snapins and Remove Snapins button in the Group Menu.
Group Service Settings
The Service Settings page allows you to enable or disable certain service modules on all hosts in the group, as well as change some service settings for group such as screen resolution, and auto log off settings.
Group Active Directory Setup
Active Directory integration settings can also be distributed to all members of a group via this page. The section "Modify AD information for [groupname]" allows you to do so. This section provides the same options as the host screen but allows you to mass update all of your hosts.
Group Printers
The Printers page allows you to add or remove printer associations to all hosts within the group. This page also allows you to set the management level all hosts within the group.
Group Membership Information
The most important thing to remember about groups in FOG is that they do not contain their own properties. When you make changes to a group, you are really make changes to every host object within the group. For example, if you change the OS association for a group, then go back to the one of the host objects that is a member of that group, it will have the new OS association on that object.
Images
Overview
Image objects in FOG are the representation of the physical files that contain the disk or partition images that are saved on the FOG server.
Creating Images Objects
Image objects in FOG are created in the Images section of the FOG management portal. To create a new image click on the "New Image" button on the left hand menu. An image object requires a name and a image file path.
When creating images you have a few choices in how you want that image to 'act'. The possible partition types include:
- Single Partition
- Multiple Partition - Single Disk
- Multiple Partition - All Disks
- Raw Image
Single Partition - Single Partition images support only single NTFS partitions. These partitions are resizable, meaning that an image from a 200GB hard disk can be put on a 10GB hard disk as long as the data is less than 10GB. This image type is destructive, which means that your partitions will be modified, and if the task doesn't finish without error it is possible that your computer may not be bootable.
Multiple Partition - Single Disk - Single Disk will back up all the supported partitions on the first disk drive detected by FOG, but the partitions are NOT resizable by FOG. This means that the image must be restored to a disk of the same or larger capacity. It is possible to backup NTFS drives with vendor specific 'restore' partitions with this type of image.
It is possible to backup Linux systems with this type of image given the following criteria:
- There is a Grub boot loader present.
- LVM is not used.
- The partitions include ext2, ext3, reiserfs, or swap.
- The swap partition should be moved out of the extended partition (for ubuntu 9.04)
Linux support is still pretty primitive, and has only been tested with a default Ubuntu 8.04 Installation.
Multiple Partition - All Disks - All Disks will back up all the supported partitions on all disk drives detected by FOG, but the partitions are NOT resizable by FOG. This means that the image must be restored to a disk of the same or larger capacity.
Raw Image - Raw Image will do a raw sector-by-sector copy of your hard disk, which means that if you have a 80GB hard drive, dd will process 80GB of data, and you will end up with a VERY LARGE image that is VERY SLOW to create and restore.
All of these images can be deployed using multicast or unicast to clients.
Modifying Image Objects
Image object can be located either by a search or by listing all image objects.
Storage Manangement
Overview
The Storage Manager section of FOG was added in version 0.24 of FOG and introduces the concept of Storage Groups. Basically, a storage group is a group of NFS servers that share images and share the load of computers being imaged. Any member of a storage group is referred to as a Storage Node. You may have as many storage groups as you wish and as many storage nodes within those groups as you wish. In each storage group, there is one storage node which is designated as the Master of that group. Basically what this means it that is the node where all image uploads go, this node handle multicasting tasks for the group, and is the image replicator the for the group. This means that whatever images are stored on this node are what gets distributed to the entire group.
What this new system of storage management gives us is a distributed model for FOG which allows for more unicast transfers at a single time. We also gain data redundancy. We also take stress off of the main FOG server.
Below is a brief overview of Storage Groups
This image shows a single Storage Group and the flow of data within the group. The queue size of the system is the sum of the queue size of all the storage nodes within the system. So if you have 4 nodes each with a queue size of 10, then the queue size of the system is 40, which means 40 clients can be imaged (unicast) at one time.
This image shows that it is possible to have multiple storage groups on your network, which are isolated from each other. This image also demonstrates, that uploads always go to the master node and multicast session always send data from the master node. Images are pushed out from the master node of the group to all other members of the group.
Key Benefits
- Increased throughput
- Redundant Storage
- Scalability
Adding a Storage Node
Video Tutorial: http://www.youtube.com/watch?v=X72WthDGwsw&fmt=18
To add an additional storage node to the network, the computer should be prepared in the same way the main FOG server would be prepared (disable firewall, SELinux, etc). You can also safely mix operating systems for the nodes of you storage group, some nodes can be running fedora, and some can be running Ubuntu. It is important to update your storage nodes when you upgrade to a new version of FOG. Installation of a storage node is done with the same installer for a normal FOG server. Installation can be started by running the installer script, the steps are detailed below.
Installing the Node
- Run the installation script, ./installfog.sh
- Select your operating system.
- When prompted for Server Installation Mode, select S, for storage node.
- Enter the IP address of the storage node.
- Confirm you interface
- Then you will need to enter the IP address or host name of the node running the FOG database
- Then you will be prompted for a username (typically fogstorage)
- and a password that is located on the FOG server, that will allow the storage node to access the main FOG server's database. This information is located in the FOG management portal for convenience (on the main for server). It can be accessed via Other Information -> FOG settings -> section FOG Storage Nodes.
- You will then be prompted to confirm your installation settings, if they are correct press Y end hit Enter.
- When installation completes, the install will produce a username and password that will be needed to add the storage node to the FOG management portal.
Adding the Node to the Management Portal
- Log into the FOG Management Portal
- Navigate to the Storage Management section.
- Click on Add Storage Nodes.
- For the Storage Node Name, enter any alpha numeric string to represent the storage node.
- Enter any description you wish
- Enter the IP address of the storage node you are adding. This must be the IP address of the node, DO NOT use a hostname here or the node will not function correctly.
- Enter the maximum number of unicast clients you would like this node to handle at one time. The value that we recommend is 10.
- Is Master Node is a very dangerous settings, but for right now leave it unchecked, for more details please see: #Master Node Status.
- Next, select the storage group you would like this member to be a part of, in our example we will pick Default
- Next, specify the image location on the storage node, typically /images/, your image location should always end with a /.
- Next, you will want to check the box, to enable the node.
- The last two fields take the username and password that are generated during the installation of the storage node.
- Then click Add to have the node join the storage group.
Monitoring The Master Node
On all storage nodes there is a new service (as of version 0.24) called FOGImageReplicator which is a very basic script which, if the node is the master, copies all of its images to all other nodes in the storage group. The coping is done every ten minutes by default, which means your images are NOT instantly duplicated to all nodes.
If you would like to view the status of the image replication, you can do so on the storage node by switching to tty3, by typing ctl + alt + f3. Output is also logged to a file in the /opt/fog/log directory.
Master Node Status
The Master Node in a storage group is the node that distributes images files to all other nodes in the storage group. So, if you have all your images distributed across 3 nodes in a storage group, if you add a new storage node that has no images stored on it, making that node master will cause it to take over and push it's image store of nothing to all other nodes, wiping out all of your images. So it is important to be very careful and backup your images when you change a node's master status.
Users
Overview
FOG has only two levels of users, regular users and mobile users. Regular users have access to the mobile portal and the full management portal. Mobile users have access to only the mobile management portal.
Creating Accounts
All accounts are created under the "Users" section of the FOG portal. To create a new account click on the "New User" button on the left hand side of the page. All accounts must have a unique username, and a password. After filling in the required information click on the "Create User" button.
Modifying Users
FOG accounts can be modified from within the users section. First you must locate the account you wish to modify by clicking on the "List all Users" button on the left hand side of the page. When a user is located, click on the edit button on the right hand side of the table.
Tasks
Overview
Tasks are all the actions that you can take on a computer, and in FOG there a numerous tasks that can be done including:
- Upload - Unicast
- Upload - Unicast (Debug)
- Download - Unicast
- Download - Unicast (Debug)
- Download - Unicast (Without Snapins)
- Download - Multicast
- Debug
- Deploy All Snapins
- Deploy Single Snapin
- Memory Test
- Wake Up
- Fast Wipe
- Normal Wipe
- Full Wipe
- Disk Surface Test
- File Recovery
- Virus Scan
- Hardware Inventory
In the tasks section of FOG you can perform tasks on single hosts or groups of hosts. This section also allows you to monitor selective tasks, and stop/cancel tasks.
General Tasks
The general/common Tasks in FOG include unicast image upload, and unicast image send, as well as a multicast image send. In FOG, sending an image to the server is considered an image upload, and deploying an image to the client is called a send. Both of these tasks can be started directly from the search, list all hosts, and list all groups pages.
To perform a simple image upload, click on the upward facing arrow next to the host. Uploads are only possible on a host, not a group. Uploading an image will also overwrite any image file that may already exist for that host without any notification or confirmation.
For a video demonstration of an image upload, please see: http://www.youtube.com/watch?v=jPPZr0abVfg&fmt=18
To perform a simple image send, click on the downward facing arrow next to the host. An image send can be done on a host or a group. When sending an image to multiple computers FOG works in queue mode, which means that it will only send to 10 (by default) computers at one time. This is done to keep the server from being overworked. As soon as the a machine finishes, another from the queue joins.
To perform a multicast image send you must search for a group of hosts on the "Task Management" page. Multicast tasks can only be performed on a group of hosts. Multicast tasks will send to all the computers in the group at once, and the task will not start sending until all members of the group have connected with the server. After starting a multicast task, status can be view by clicking on [ctl]+[alt]+f2. A log is also kept for multicast transfers which is stored at /opt/fog/log.
Advanced Tasks
The advanced Tasks in FOG include everything that is not a simple upload, simple send or mutlicast send.
Debug
Debug mode boots the linux image to a bash prompt and allows the user to issue all commands by hand.
Upload - Unicast (Debug)
Does the same thing that debug mode does, with the exception that the environment is setup to upload the image. To start the imaging process just type:
fog
Send - Unicast (Debug)
Does the same thing that debug mode does, with the exception that the environment is setup to send the image. To start the imaging process just type:
fog
Send - Unicast (Without Snapins)
This task does a normal send task with the exception that if any snapins are associated with the host, they are not deployed to the host.
Deploy All Snapins
This task will send all the snapins associated with a host to the host without imaging it.
Deploy Single Snapin
This task will send a single snapin that is associated with the host to the host without imaging it. (Note: The snapin must be associated with the host already)
Memory Test
Boots to Memtest86, a memory testing tool. This a task will not exit with out user intervention at the client side. The task must also be manually stopped via the management front end.
Wake Up
Wakes up host or group of hosts using Wake-on-Lan.
Fast Wipe
This task does a quick and dirty wipe of the drive. This task writes zeros to the first ~40MB of the disk. This task should NOT be used if you don't want your data to be recoverable.
Normal Wipe
This tasks writes random data to the entire surface area of the disk.
Full Wipe
This tasks writes random data, multiple times to the entire surface of the disk.
Disk Surface Test
This task will look for bad blocks on the hard disk and report them back to the client console.
File Recovery
This task will load an application that can be used to recover lost files from the hard disk.
Virus Scan
This task will update and load ClamAV and scan the partition for viruses. It will either scan and report or scan and quarantine files, it will also report back to the management portal with the results of the scan.
Hardware Inventory
The hardware inventory task will execute the same task as the fog.reginput client side task. Since the host is already registered, all it will do is update the computers inventory and restart. It is visioned that this task could be run on a regular interval on a group of all computers in your network, or some sub group of computers in your network. Then on the next reboot of those computers an inventory would be performed.
Scheduling
As of version 0.27 of FOG, select tasks can be scheduled using a static date/time combination or using a cron style repetitive task scheduling. Task scheduling can be performed on either single hosts, or on groups of computers. One thing to note about task scheduling that isn't intuitive is that it requires an image to be associated with the host, even for non-image based tasks! The reason for this is because tasks are only run on the master storage node associated with that host, and the only way to tie a storage node to a host is via an image. We did this to prevent multiple storage nodes to try running the same task for a specific host.
Single Execution Scheduling
Single task execution will run a task at a single date and time, then the task will be discarded. To scheduled a single execution task, you would go to the tasks section of fog, then select the host or group you would like to schedule the task, then select the task you would like to schedule. You will then be presented with the screen show below.
To schedule a single execution task, click on white text box below "Schedule Single Task Execution?" and a pop up calendar will load and allow you to select your date and time for the task. Click on the date to close the calendar, then start you task.
Cron Style Task Scheduling
Cron style task execution allows you to do complex repetitive task scheduling. After a cron task executes, it is not removed, as single executions tasks are. Cron style tasks, as the name suggests are similar to the Linux cron task scheduler format. Cron style tasks are created as single execution tasks are, except when presented with scheduling options, select the option "Schedule Cron Style Task Execution". Below that check box are a series of text boxes including:
min -> Minute hour -> Hour dom -> Day of Month month -> Month dow -> Day of Week
To give an example of how this works, if you wanted a upload task to run at 10:00pm everyday you would enter the following:
0 22 * * *
This basically says run the task a 0 minutes into the hour, on the 22nd hour (10:00pm), on every day of the month, on every month of the year, on every day of the week.
To take this example further, lets say you only wanted to upload the image every other day, we could do this by adding:
0 22 */2 * *
The */2 now tells the scheduler to only run on even days of the month.
We could even ask the scheduler to only do a backup on even weekdays by adding:
0 22 */2 * 1-5
The 1-5 we just added says only run on days 1 through 5, which relate to Monday - Friday.
Now we will ask the scheduler to only backup in the month of February.
0 22 */2 2 1-5
Another basic example could be if you wanted to run an inventory update on the first of every month you could use:
30 1 1 * *
This task would then run at 1:30 on the 1st of every month.
The FOG scheduler doesn't support 100% of the operations that cron supports, below are the operations that are supported:
4 - Listing a static number 4,5,6,7 - Listing a group of numbers 4-7 - ranges of numbers 4-7,10 - ranges and lists */5 - * divided by a number * - Wildcard
For more information on cron please see http://en.wikipedia.org/wiki/Cron
Printers
FOG Version
Relates to FOG Version 0.12 or higher.
Known Issues
Setting of the default printer will only work if the fog tray icon is running.
Overview
The printers section of FOG allows you to create printer definitions that you can later associate with hosts. The FOG service looks at these associations and during service it will attempt to install any printers listed. This service has three settings which define how the printers are managed, printer management can be set to:
- No Printer Management
- Add Only
- Add and Remove
All hosts default to No Printer Management which means that the FOG service does nothing to the hosts printers. Add Only does as the name implies, and will only add printers to the host machine, it will not remove any existing printers that may be installed. Add and Remove will take full control of the hosts printing system and only allow for the printers that are specified by the FOG management console to exist on the host.
Adding New Printers
In order for the printer to be added to the host computer, the printer drivers must be stored in a public area, or included on the host computer. This public area can be a Novell Network share where public has read-only access, a Windows share that is public read-only to everyone, or a Samba share (possibly residing on the FOG server) that is public read-only to everyone. This share must be accessible via a UNC path as the service may attempt to install the printers before drive mapping occurs. In this share the printer drives and .inf file must exist. FOG supports install IP based (Jet-Direct) printers, public access NDS printers, Local printers, windows share based printers, (and we think, but could use a confirmation as it hasn't been tested) AD based printers.
If you wish to see what printers are included with Windows XP, navigate to c:\windows\inf\ntprint.inf. Open this file with a text editor and you will be able to install all the printers listed using the ntprint.inf file.
To create a new printer definition click on the Printer icon on the system menu bar. Then on the left hand menu, click on Add New Printer. The form you are presented with will require you to enter:
- Printer Model - This must match the name in the INF file.
- Printer Alias - This can be anything you wish and it is what the end user will see.
- Printer Port - This is something like LPT1:, or IP_1.1.1.2.
- Printer INF File - This is the path to the INF file for the printer driver.
- Printer IP - (optional) This is ip address of an IP based printers only, this can take the form of 1.2.3.4:9100 or 1.2.4.5. If the port doesn't exist already, it will create one named IP_x.x.x.x, where x.x.x.x is the ip address. That is what should be entered in the port field.
After all the required information is entered, click on the Add Printer button.
Linking Printers to Hosts
Linking printers to hosts can be done from either the hosts section or the groups section. In the hosts section find the host you would like to add a printer to, click on the edit button associated with that host. In the host menu, click on the Printers button. First select how you would like the host to be managemed, either No Printer Management, Add Only, or Add and Remove. Then in the section below, select the printer you would like to install from the drop down list and click on the Update button.
Creating a Samba Based Printer Store on FOG
If you do not have a public sever where you can store your printer drivers for the FOG Printer Manager, then it is very easy to set one up on the FOG server using Samba, so all your Windows Clients will be able to connect.
The first thing you must do is to install samba:
yum install samba system-config-samba
Then make samba startup by default:
chkconfig smb on
Create a new Linux user:
System -> Administration -> Users and Groups
Click Add User
Username: printerdrivers
Fullname: Printer Drivers
Password: somepassword
Create a directory to store the drivers:
mkdir /opt/fog/printerdrivers
System -> Administration -> Samba Preferences -> Server Settings... -> Security -> Guest Account
Set guest account to printerdrivers
Change Authentication Mode to Share
Click Add Share
Click browse and navigate to /opt/fog/printerdrivers
Share name: printerdrivers
Place a check mark next to visible and leave writable unchecked.
Click on the Access tab.
Select Allow access to everyone.
Click OK.
You should now be able to access the share (read-only) from a windows computer using the following path:
\\x.x.x.x\printerdrivers
Where x.x.x.x is the ip address of the FOG server.
The FOG Client Service
Overview
The FOG Client Service is a Windows Service that is intended to be installed on the client computers during the image creation process. The FOG service communicates with the FOG server to provide certain service to the client computers including:
- Auto Log Off (0.16)
- Hostname Changes
- Active Directory Integration
- Directory Cleaner (0.16)
- Display Manager (0.16)
- Green FOG (0.16)
- Host registration
- Task Restarting
- Snapin Installation
- User Tracker
- Printer Manager
- User Cleanup (0.16)
- Client Updater
- User Tracker
Module specific configuration settings
The FOG Client Service is very modular in nature, which means you can install portions of the services provided, and leave off others. This also means that it is very easy to create new sub services if you know a little C#. All configuration data is held in a local INI file. Which is typically stored in
c:\program files\fog\etc\config.ini
This file holds, in the general section:
- FOG Server IP address
- FOG Service installation root
- FOG Service working directory
- FOG Log file path
- Flag indicating if GUI messages should be displayed
- The max log file size
Installation
The FOG service should be installed on the computer to be imaged before uploading the image to the FOG Server.
The FOG service is located in the FOG Service/bin directory or if the FOG server is already installed it can be downloaded from:
http://[serverip]/fog/client/
Double-click on the setup.exe to start the installation wizard. At the end of the wizard you will need to enter the IP address or hostname of your FOG server.
Then restart the computer, if you don't restart the computer you will have issues with the service GUI appearing correctly.
Functions and Operation
Auto Log Out
Added in Version 0.16
This module of the FOG Service will log a user off of a client pc after X minutes of inactivity. This module will display a screen saver-like GUI after 3/4 of the inactive time is up. So if the time out value is 40 minutes, the GUI will be displayed at 30 minutes of inactivity. When the time is up, the client computer will reboot. This service module can be configured via the management portal via:
FOG Service Configuration -> Auto Log Out
To enable the module globally, place a check in the box next to Auto Log Out Enabled?. The time to auto log off can changed globally via Default log out time: The minimum recommended value for this setting is 4 minutes.
The background image for the auto log off module can be modified via:
Other Information -> FOG Settings
The settings can be changed by modifying the value for FOG_SERVICE_AUTOLOGOFF_BGIMAGE. This settings will accept a jpg file that is local to the client computer like:
c:\images\image.jpg
This setting will also accept files located on a web server such as:
http://www.somedomain.com/image.jpg
Provided with FOG is a simple php script that will display a random images that is located on the FOG server. To use this option set FOG_SERVICE_AUTOLOGOFF_BGIMAGE to
http://x.x.x.x/fog/public/randomimage.php
Then simply put the images you would like to use in the following directory on the fog server:
/var/www/html/fog/public/imagepool
Images used for the auto log off module must be in jpg format, and must be 300px by 300px.
Hostname Changer
This module of the FOG Service is used to change the hostname of the client computer and to allow the client to (optionally) join a Active Directory Domain after imaging. This process only runs shortly after service startup, which means typically only when you start your computer. The service communicates with the FOG server over port 80 and determines the hostname that is present in the FOG database for the host. The hosts are matched to the FOG database by their MAC addresses. If the hostnames are found to be different, the client changes the computers hostname and restart the computer.
The config.ini file contains configuration options for this module.
netdompath=
Allows you to set the path to the netdom.exe file.
Host Register
This is a very simple module which on service startup will check to see if the client is a member of the FOG database. If it is not, the client will attempt to register the client with the FOG server. This module was created to ease migration to FOG.
There are no configuration settings for this module.
Task Reboot
This module periodically checks in with the FOG server to see if the client has an imaging task assigned to it. It a task is found AND no one is logged into the workstation, then the client will restart and join the task.
The config.ini file contains configuration options for this module. As of version 0.13 of FOG you can change:
forcerestart=0
to
forcerestart=1
This will make the computer restart if a task is found, regardless of whether a user is logged into the computer.
You can change how often the service will check in with the server by changing:
checkintime=xxx
where xxx is the number of seconds the service will wait between check-ins.
Directory Cleaner
Added in version 0.16
This module will clean out (delete) the contents of a directory on user log off. This useful when you don't want any settings cached between users. This module will only delete the contents of a directory and not the root directory itself, so if you specify c:\trash, the service will remove all files and folders located within c:\trash but leave the folder c:\trash.
Display Manager
Added in version 0.16
This module is used to restore screen resolution between clients. This will restore a fixed resolution and refresh rate when a user logs into a computer.
Green FOG
Added in version 0.16
This module will simply shutdown/restart the client computer at a fixed schedule if no user is logged in. The schedule can be defined via the management portal.
Snapin Client
This module periodically checks in with the FOG server to see is the client has an snapin set to be deployed to it. If a snapin is found AND no imaging task is associated with the client, then the client will download the snapin and install it in the background.
The configuration file contains settings for this module including:
checkintime=xxx
where xxx is the number of seconds the service will wait between check-ins.
User Tracker
This module attempts to track user access to the host computer by the Windows user name. It attempts to track logins and logoffs as well as well as the state of the computer at service startup. The service will even attempt to track users when they are not on the network by writing all entries to a journal file, then replying the journal the next time the client is on the network.
There are no configuration settings for this module.
User Cleanup
This module will remove all users not white listed in management portal on log off. This module is useful when using services like dynamic local user. All entries in the management white list are treated as prefixes to usernames, which means that they will white list all users that start with whatever was entered in the management front end. For example, if you enter admin in the management white list, then users admin, and administrator will NOT be removed from the computer.
Printer Manager
This module checks on service startup to see what printers should be installed/removed from the client PC.
There are no configuration settings for this module.
Client Updater
This module waits (randomly) between 60 and 500 seconds after service startup to check the local fog server for client updates, and if any are found the service will download and install them. Updates will NOT take effect until after the service is restarted.
There are no configuration settings for this module.
Keeping Clients up to date
Overview
As of version 0.12 of FOG, we have included a client updater module. This module is no different than any of the other sub service modules. What this service does is waits anywhere between 60 and 500 seconds after the FOG service starts up, and then attempts to check with the server for newer FOG service modules. If new modules are found the client will download them, and they will be active on the NEXT service startup. These modules are controlled from the FOG Management Console.
Only certain modules can be updated, only those that are a sub class of AbstractFOGService. This means you should NEVER attempt to update the FOGService executable (FOGService.exe file), or the AbstractFOGService.dll file. It is recommended that you not update the ClientUpdater.dll, because if the ClientUpdater.dll file becomes corrupt or not functional, your clients will not be able to update from that point on. Below are a list of the .dll files that can be updated.
- UserTracker.dll
- TaskReboot.dll
- SnapinClient.dll
- PrinterManager.dll
- HostRegister.dll
- HostnameChange.dll
- GUIWatcher.dll
- ClientUpdater.dll
- config.ini
Care must also be taken when updating the config.ini file, if the IP address is incorrect or the syntax of the file is incorrect, it could leave the FOG service crippled on the client computers.
Posting Updates
To add new modules that can be pushed down to clients, first install a client with the new service or new module and confirm that it works as you would like. Log into the FOG management console, then go to the Infomation/Misc section (the little "i" icon). Click on Client Updater on the left-hand menu. Now click on the browse button to select the module (.dll) file you would like to post, then click on the upload button. After uploading the file should appear in the table above. If you are adding a new module, you will probably want to upload a new config.ini file to include new configuration settings required by that new module.
FOG Tray
The FOG Tray is a Windows application that runs on user login that docks in the system tray. The FOG Tray, like the FOG service is very modular in nature. New modules can be dropped in the FOG tray directory and on next load they will be loaded. This tray icon has the ability to communicate with the FOG service, this allows fog more interactivity with the end-user.
What happens is that when the FOG service's printer manager module gets a request to set a default printer, the service attempts to contact the FOG Tray. If communication is established, then the service will ask the tray to set the default printer. On the other hand the end user can right click on the "F" icon in the system tray, then select printers, then update my printers. What this will do is attempt to send a request from the FOG Tray to the FOG Service and have the service check for printer updates (new printers or printers to be removed). If one is found the service will install any new printers assigned in the FOG Management portal.
This application is in its very early stages and currently doesn't have a lot of functionality. It is currently only used to allow end users to update their printers and to allow the setting of default printers (from the FOG service). Our vision for the FOG Tray is to add modules that would allow users to installed printers that published as public (via the management portal) without the printer being directly assigned to their host. We would also like to do the same thing for snapins where some of your snapins could be defined as public where anyone could install them on their computer.
Troubleshooting
If you have problems with the FOG Service, please refer to the log file that is located at:
c:\fog.log
Snap-ins
Overview
The FOG Service has the ability to install snapins to the clients. Snapins can be anything from whole applications like Microsoft Office to registry keys or desktop icons. Snapins can even be used to uninstall applications or remove unwanted files. For the end use's point of view, they will not even noticed that a snapin is being installed until it is complete. At this point a message will notify them that a new application has been installed on their computer. Snapins can in MSI (0.17) or EXE formats, and can be created with any snapin creation tool like InstallRite or already packaged MSI files (0.17).
Creating a Snapin
FOG doesn't provide a tool to create snapins, but there are free tools that will do this for you. In this example we will use Epsilon Squared's InstallRite which can be downloaded from http://www.epsilonsquared.com/installrite.htm. This application will package up your snapin as an exe file which will be uploaded to the FOG server.
- To run InstallRite navigate to c:\program files\Epsilon Squared\InstallRite\InstallRite.exe
- Click on "Install new software and create an InstallKit"
- On the Configure screen, click Next.
- On the Snapshot screen click next to create a new system snapshot.
- On the next screen,click the browse button to select the application you wish to install, then click next.
- When installation is complete InstallRite will come into focus, click the next button. InstallRite will scan your system again.
- Enter a name for your snapin.
- Click "Build Install Kit"
- Select "Quiet Installation Mode", Never reboot, even if needed, and "Never prompt the user and only overwrite older files"
- Click OK and it will build your snapin.
Preparing the FOG Server
If your snapin is larger than 2MB you will need to make two changes to the FOG server to allow uploads of larger than 2MB.
Fedora
- On the FOG Server click on Applications -> Accessories -> Text Editor.
- Select Open and navigate to "/etc/php.ini"
- Change UPLOAD_MAX_FILESIZE to 1900MB (On a 32Bit OS don't set this value above 2GB)
- Change POST_MAX_SIZE to the same value.
- Save and close the text editor.
- Click on Applications ->System Tools -> Terminal and type "service httpd restart"
Ubuntu
- sudo gedit /etc/php5/apache2/php.ini
- Change
- memory_limit = 1900M
- post_max_size=1900M
- upload_max_filesize=1900M
- Save Changes
- sudo /etc/init.d/apache2 restart
VMWare
- sudo vim /etc/php5/apache2/php.ini
- Edit the following lines in the document (read below for assistance with working in VIM)
- memory_limit = 1900M
- post_max_size=1900M
- upload_max_filesize=1900M
- To edit content in vim you will need to press the "I" key on your keyboard to enter input mode.
- Hitting the Escape key will bring you out of input mode.
- Once out of input mode type :w and then enter to save the file
- Restart FOG once the file has been saved
Uploading the Snapin
- In the FOG Management Portal click on the Snapin Icon (Puzzle Pieces).
- On the left-hand menu click on the New Snapin Button.
- Enter a Snapin Name and Description.
- Browse to the snapin file you wish to upload.
- If you want the computer to restart after the snapin is installed click on the "Reboot after install"
- Click "Add"
As of version 0.17, fog supports using typical msi files as snapin files.
If the snapin file is a msi file you must perform these additional steps:
- Set Snapin Run With: to the path of msiexec.exe (ie: c:\windows\system32\msiexec.exe)
- Set Snapin Run With Arguments: to /i
- Set Snapin Arguments: to /qn
If the snapin file is a .vb script you must perform these additional steps:
- Set Snapin Run With: to the path of cscript.exe (ie: c:\windows\system32\cscript.exe)
Documentation on list of support snapin's and command line arguments [[16]] There are MANY more supported applications that can be installed via command line arguments. You might have better luck installing them directly via .EXE / .MSI / or scripting them via .VBS . For more info on this consult the forums --Ssx4life 09:04, 8 October 2009 (MST)
Linking the Snapin to Hosts
In order for a snapin to be deployed it must be linked with a host. To do this perform the following:
- In the FOG Management Portal, click on the Hosts Icon.
- Search for and select a host and click on the edit button.
- Scroll down to the snapin section.
- Select the snapin you just created from the drop-down box and click the "Add Snapin" button.
The next time you image the computer the FOG Service will attempt to install that snapin. If you have problems, please see the fog log file located at c:\fog.log on the client PC.
Client Side Tasks
FOG Version
Applies to version 0.12 or higher.
Overview
FOG attempts to keep management centralized, but in an attempt to make deploying machines as easy as possible FOG has added a few basic client side tasks. These tasks can be run from the client computer during the PXE boot process. When the client boots and the FOG banner is displayed the pxe client will display a prompt like boot: or something similar. At this point you have 3 seconds to start typing one of the following commands.
- fog.memtest
- fog.reg
- fog.reginput
fog.memtest
This command will run the memtest86+ on the client computer.
fog.reg
This command will run the basic host registration and inventory process without any user input. It will register any new/unregistered hosts with the FOG server and pull a basic hardware inventory from them. The hostname of the computer will be the same as the MAC address without the ":".
If a host is already registered, then only an inventory will be performed.
fog.reginput
This command will run the full host registration process with user input, inventory and give the option to push down an image, all at the same time. During this process the user registering the host will be prompted for the computer host name, ip address, operating system ID, image ID, Primary User of the computer, asset tag 1, and asset tag 2.
If a valid hostname, os id, and image id are given and the option is selected to image the workstation after registration, the host will reboot and an imaging send will began.
If a host is already registered, then only an inventory will be performed, this prevents end-users from re-registering a machine with a different hostname, etc.
This tasks was designed for institutions that may get shipments of hundreds of computers that need to be deployed very quickly. They can be unboxed, inventoried, imported into FOG and imaged very quickly.
Operating System ID
As of Version 0.17 of fog, you can now enter ? at the Operating System ID prompt to get a listing of the valid operating system id values.
The following are valid values for operating system IDs:
- 1 - Windows 2000 / Windows XP
- 2 - Windows Vista
- 3 - Windows 98
- 4 - Windows (Other)
- 50 - Linux
- 99 - Other
Image ID
Image IDs can be found in the management console, in the Images section. Search for the image, and click on the edit button associated with the image, the image id will be in the Address/url bar in the format of &imageid=xx.
As of version 0.17, you can enter ? at the Image ID prompt to get a listing of all your images and their ID numbers.
Active Directory Integration
Setup
Overview
FOG has the ability to register a host with Active Directory, in a limited sense. FOG relies on the netdom.exe executable that is provided as part the support tools on the Windows installation media. In order for Active Directory integration to function, your image will need to have the FOG service installed, along with the Windows Support Tools. It is also very important that before uploading your image that the computer is NOT a member of any domain.
Security
Important - Please read!
In order to add a computer to a domain, FOG requires a username and password that has rights to the OU where the computer objects are stored in the domain tree. FOG attempts to keep your password secure by encrypting it, but since FOG is open source, it is possible for someone to decrypt your password if you don't change the FOG "Passkey." It is highly recommended that you change this Passkey before implementing the AD integration in a production environment. Changing the Passkey requires you to recompile the FOG Service's Hostname change module, but don't panic this isn't hard and only need to be done one time. Please see the documentation below.
Preparing the Image
Before uploading an image to FOG that you would like to use with Active Directory, please ensure that the image:
- is NOT a member of the domain, change the computer membership to workgroup instead.
- has support tools installed.
- has the FOG service installed.
FOG Setup
To setup a host to use AD, navigate to the hosts section of the FOG management portal.
- Search for, and select a host.
- Click on the Edit button
- Scroll down to the Active Directory section.
- Check the box next to Join Domain after image task
- Enter the domain name.
- Enter the Organizational Unit where you would like to have the computer stored in AD. Leave if blank for the default. (Must be in LDAP format).
- Enter the user name that has access to the computer objects.
- Enter the encrypted password. This password must be encrypted with the FOGCrypt utility. This utility is located in the FOGCrypt folder of the FOG download package. It is a Windows command line application.
- Click Update.
The next time you image that computer the service will attempt to register the host with the domain information provided. If you have problems please refer to the FOG Service log file located in c:\fog.log
Making AD Integration Easier
As of version 0.20 of FOG, we have made it a bit easier to manage AD settings in FOG, by allowing for default settings for AD. This will allow the easy population of the domain, OU, username, and password. To set this feature up perform the following:
- Go to Other Information -> FOG Settings
- Set your default values for the following:
- FOG_AD_DEFAULT_DOMAINNAME
- FOG_AD_DEFAULT_OU
- FOG_AD_DEFAULT_USER
- FOG_AD_DEFAULT_PASSWORD (MUST BE ENCRYPTED!)
To test everything out, go to a host that doesn't have anything setup for AD, and click on the edit button for that host. Go to the host menu, and select Active Directory. Click on the Join Domain after image task: button and all your default values should be populated.
Securing Active Directory Integration
Overview
In order to add a computer to a domain, FOG requires a username and password that has rights to the OU where the computer objects are stored in the domain tree. FOG attempts to keep your password secure by encrypting it, but since FOG is open source and the methods used to encrypt the password are open for all to see, it is possible for someone to decrypt your password if you don't change the FOG "Passkey." It is highly recommended that you change this Passkey before implementing the AD integration in a production environment. Changing the Passkey requires you to recompile the FOG Service's Hostname change module, but don't panic this isn't hard and it only needs to be done one time.
The Development Environment
The hostname change module is written in c#, so in order to recompile it you will need to download Microsoft's Visual Studio Express Edition for C#. This can be downloaded from:
http://www.microsoft.com/express/vcsharp/
Install Visual Studio with the standard options.
Getting the Source
After Visual Studio Express is installed now we need to get the source code for the hostname change module. This is part of FOG download/installation package. This package can be downloaded from:
http://sourceforge.net/project/showfiles.php?group_id=201099
Extract this package, then navigate to "FOG Service\src\FOG_HostNameChanger\"
Double-click on HostNameChange.sln to open the project.
If you are asked to convert the project to the latest version, click the Finish button.
Once the project has opened, on the right-hand panel, in the "Solution Explorer", double-click on MOD_HostNameChanger.cs.
After do so, you should get the source code to display in the main panel, scroll down to the line:
private const String PASSKEY = "FOG-OpenSource-Imaging";
Change FOG-OpenSource-Imaging to anything you like, just remember what you change it to, as you will need it later.
Then click File -> Save All.
Then click Build -> Build Solution.
This will recompile the hostname change module with your unique key.
Now navigate to "FOG Service\src\FOG_HostNameChanger\bin\Release"
Copy only the file HostnameChange.dll to some place safe.
Every time you install the FOG service you must replace the file:
c:\Program Files\FOG\HostnameChange.dll with this File
Encrypting Your Password
Now that we have changed the passkey, we need you update the FOGCrypt ini file to use this new passkey.
Navigate to the FOGCrypt\etc directory from the FOG download package.
Open the config.ini file and change the passkey value to your new passkey, then save the file.
Now open a command window and navigate using the cd command to the FOGCrypt directory.
Type:
FOGCrypt [password]
Where [password] is the AD user's password that has rights to the Computers section of the AD tree.
The output from this command is what you will enter in the FOG management portal.
FOG Reports
FOG Version
Relates to FOG Version 0.12 or higher.
Overview
FOG Reports allow you to export data from FOG in two major formats including CSV, and PDF.
- Snapin Log - This report will report on snapin installation history.
- Imaging Log - This report will report on images deployed to hosts.
- Virus History - This report lists any viruses that were found on locate computers.
- Inventory - This report will report on the inventory information collect for network clients.
- Equipment Loan - This report can be used for equipment loaned to staff members.
- User Login History - This report contains information about user logins.
Running Reports
Running a report can be done from the Reports section of FOG, then by picking a report from the left-hand menu.
Importing User Created Reports
The reporting section of FOG allows for the end user to create and upload custom reports into FOG. A FOG report is a simple php script that is processed by the server. To import a report simply click on the Upload a Report button in the reports section, select the report then click on the upload button. The report will then show up on the left-hand menu.
Please be cautious when uploading reports from an unknown source as the writer of the report has full access to the FOG system and database! Make sure your sources are trustworthy before importing a report!
Creating Custom Report
Custom reports are simple php scripts in FOG. Custom reports can be created based on the following template:
Custom Report Listing
Warning
The reports published in this section may or may not come from the creator of FOG, so please use them at your own risk!
No reports published yet!
Other Settings
Boot Image Key Map
It is possible to change the keymap or keyboard layout of the linux boot image. In order to change the key map, go to:
Other Settings -> FOG Settings -> General Settings -> FOG_KEYMAP
Here are the possible values for this setting, if left blank it will default to us.
azerty be-latin1 fr-latin0 fr-latin1 fr-latin9 fr fr-old fr-pc wangbe2 wangbe ANSI-dvorak dvorak-l dvorak dvorak-r tr_f-latin5 trf bg_bds-cp1251 bg_bds-utf8 bg-cp1251 bg-cp855 bg_pho-cp1251 bg_pho-utf8 br-abnt2 br-abnt br-latin1-abnt2 br-latin1-us by cf cz-cp1250 cz-lat2 cz-lat2-prog cz defkeymap defkeymap_V1.0 dk-latin1 dk emacs2 emacs es-cp850 es et et-nodeadkeys fi-latin1 fi-latin9 fi fi-old gr gr-pc hu101 hypermap.m4 il-heb il il-phonetic is-latin1 is-latin1-us it2 it-ibm it jp106 ko la-latin1 lt.baltic lt.l4 lt mk0 mk-cp1251 mk mk-utf nl2 nl no-latin1.doc no-latin1 no pc110 pl2 pl pt-latin1 pt-latin9 pt ro ro_win ru1 ru2 ru3 ru4 ru-cp1251 ru ru-ms ru_win ru-yawerty se-fi-ir209 se-fi-lat6 se-ir209 se-lat6 se-latin1 sk-prog-qwerty sk-qwerty sr-cy sr-latin sv-latin1 tralt tr_q-latin5 trq ua ua-utf ua-utf-ws ua-ws uk us-acentos us croat cz-us-qwertz de_CH-latin1 de-latin1 de-latin1-nodeadkeys de fr_CH-latin1 fr_CH hu sg-latin1-lk450 sg-latin1 sg sk-prog-qwertz sk-qwertz slovene
Mobile Management Interface
Overview
The FOG Mobile web interface is a very basic, stripped down interface for FOG. It is designed to be given to lower level technicians using low powered, mobile devices such as iPod touches, iPhone, PDAs, and internet tablets. The idea behind this interface is to make it easy for techs to re-image a computer while making the rounds at a site.
Using the mobile Interface
The mobile interface can be access via:
The portal requires a valid user name in password, which can be created via the FOG portal.
Once logged into the portal, users can search for hosts and image them, and view/cancel active tasks.
They can not change image associations, nor modify any properties of a host.
Backing up FOG
Overview
Backing up FOG is pretty simple, there are a few directories that need to be backed up, plus the mysql database. The following sections give you an overview of how to backup your FOG system. The following should include everything you should backup/save in order to be able to restore FOG. When backing up the directories below it is recommended that you use cp -a to ensure that all the rights are maintained.
As of version 0.14 a script is provided with FOG to make backups easier. The script is located at:
utils/FOGBackup/FOGBackup.sh
To use this script run:
./FOGBackup.sh [directory]
With this script you must pass an directory that exists to the script as an argument. This directory is where your backups will be stored. This script can be run as a cron job to make daily backups of your FOG data.
Original Installation Tar File
You should save a copy of the original tar.gz file that was downloaded from FOG/sourceforge.
Web Directory
The web directory is the directory that contains all the php pages for the FOG management portal. The only reason this directory really should be backed up is because it contains the reports directory which may contain custom reports. We recommend that you save the entire web directory because in the future we may add new sections that may have custom, or user data.
OPT Directory
The /opt/fog directory contains the directory that holds snapins, The /opt/fog directory should be backed up along with all its sub directories.
Images Directory
This is the tough one, the images directory located at /images. This holds the partition images and it could be VERY large.
MySQL Database
MySql holds all the data for FOG, like all your host, image, printer, snapin and inventory information. You can backup your mysql data with the following command:
mysqldump --allow-keywords -x -v fog > fogbackup.sql
Restoring FOG
Restoring a FOG installation requires essentially the opposite actions as taken above. This section assumes you backed your installation up manually. This section will assume that your backup is in /opt/fog_backup. Also, you may need to be root for some of these actions.
First, go to your backup directory:
# cd /opt/fog_backup # ls fogopt fog.sql web
As you can see, I have named my /opt/fog into fogopt, and my /var/www/fog into web. I chose not to backup my /images directory due to some issues copying such large files.
Web Directory
Restoring your web directory will take two steps. First, remove the current one, if it exists, then copy the backup over to the appropriate location.
# rm -rf /var/www/fog # cp -a /opt/fog_backup/web /var/www/fog
OPT Directory
Restoring the /opt directory is just about the same as the web directory above.
# rm -rf /opt/fog # cp -a /opt/fog_backup/fogopt /opt/fog
MySQL Databse
In order to restore the database, you should first drop the current one (if it exists), then create a blank fog database, then import your backup.
# mysql -u root -p Enter password: mysql> DROP DATABASE fog; mysql> CREATE DATABASE fog; mysql> exit # mysql -D fog -u root -p < fog.sql
That should do it!
Advanced Installations
Overview
This section gives a rough overview of how to perform advanced installations of FOG.
Separate TFTP and DHCP Server
In this setup, the TFTP server and the DHCP server are hosted on a separate server. The TFTP server holds the PXE boot files including the Linux Kernel, boot file system image, and pxe config files. The DHCP server is the server that assigns the clients with IP addresses and network connection information.
In this setup we will have two servers:
- Server A: This is the 'Master' server which will host Apache, MySql, NFS and HTTP
- Server B: This server will host TFTP and DHCP
In our example, both of these servers need to have a fresh install of Fedora. They will both need static IP addresses, in our example we will use:
- Server A: 192.168.1.50
- Server B: 192.168.1.51
On both nodes, download the FOG installation package from:
http://sourceforge.net/project/showfiles.php?group_id=201099
On Server A install FOG, when you are prompted with:
Would you like to use the FOG server for dhcp service? [Y/n]
Select "n" to not start DHCP on that server.
After installation is complete navigate to:
http://localhost/fog
and install the FOG schema.
On server A go to:
System -> Administration -> Services
Uncheck and Stop the following Services:
- dhcpd (should already be stopped.)
- xinetd
- vsftpd
On Server B install FOG, but this time install the dhcp service.
On server B go to:
System -> Administration -> Services
Uncheck and Stop the following Services:
- FOGMulticastManager
- httpd
- mysqld
On server B open:
/var/www/html/fog/commons/config.php
Copy the value from TFTP_FTP_PASSWORD
Then open
/tftpboot/pxelinux.cfg/default
Replace all instances of web=x.x.x.x/fog/ with the the ip address of Server A.
Now on Server A, open:
/var/www/html/fog/commons/config.php
Replaced the value from TFTP_FTP_PASSWORD on Server B.
To test your configuration, navigate to
http://192.168.1.50/fog
login as:
Username: fog Password: password
Create a host and then attempt to create a task, if everything works correctly you should see a file created on Server B in the directory /tftpboot/pxeconfig.pxe/ name with the mac address of the host.
Separate NFS Server
No Content yet.
Other Advanced Topics
Building a Custom Kernel
Overview
In FOG the kernel and the boot file system are separate and interchangeable, this makes it easier to upgrade a kernel without modifying the boot file system. This also means that all drivers in the kernel are build into the kernel instead of being compiled as modules. In our example we will be compiling the kernel on Fedora 9.
Build Process
- Install the required packages to build the kernel with: Yum groupinstall "Development Tools" (need confirmation that this is all the packages required?!?, may also need qt-devel and a few others)
- Now open a web browser and navigate to http://www.kernel.org/pub/linux/kernel/v2.6/
- Download the latest kernel source which in this case is: linux-2.6.26.2.tar.gz
- Save this file to /usr/src
- Open a terminal and navigate to /usr/src
- Extract the tar file with tar -xvzf linux-2.6.26.2.tar.gz
- Now we need to copy the .config file from the fog release package which is located in the ./kernel directory
- Copy the file kitchensink.config to /usr/src/linux-2.6.26.2 and rename the file to just .config
- Now we are ready to start configuring the kernel, but running make xconfig (I used make menuconfig on Fedora 11)
- This will run the kernel configuration tool, you will need to navigate around it a little to get a feel for it as there are many options. Placing a check mark in a box will include it in the kernel, and unchecking an item will remove it from the kernel.
- To add or remove drivers from the kernel you will need to go to Device Drivers, and network drivers are in Network Device Support.
- All settings required by fog are already in the kernel, when you are done making changes click save and close the application.
- Now you need to build the kernel by running make bzImage, this will probably take at least 10 minutes to build.
- When the kernel is complete it is located at .../arch/x86/boot/bzImage
- Copy this file to your /tftpboot/fog/kernel, and you may want to backup your original kernel first
- Try booting a client with your new kernel
If you are happy with your configuration, you can save the configuration by backing up the .config file located in the boot of the kernel source directory.
Creating Custom FOG Service Modules
Overview
Creating custom FOG Service modules are pretty easy to do if you know a little c# and have access to Visual Studio (or Visual Studio Express). Below we will attempt to walk someone through the process of creating a custom fog service module. You will also need the fog installation download package from sourceforge located at:
http://sourceforge.net/project/showfiles.php?group_id=201099
Building a test module
In this example, I am using Visual Studio 2005, but these directions should work for nearly any version.
- Start Visual Studio, then do a File -> New -> Project
- In the New Project dialog, select Visual C# -> Windows -> Empty Project
- Select a project name and a location to save the project, then click OK
- Copy FOG Service\src\AbstractFogService\bin\Release\AbstractFOGService.dll from the download package to your project directory.
- Copy FOG Service\src\AbstractFogService\bin\Release\IniReaderObj.dll from the download package to your project directory.
- In the Solution Explorer Window right-click on References and select Add Reference
- On the browse tab locate the two files copied to your project directory and add the reference.
- Right-click on your project and select Add -> New Item
- Select Class and give your class a name, then click Add
- Replace everything in that class with this template
using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Net; using System.Collections; using System.Runtime.InteropServices; using Microsoft.Win32; using IniReaderObj; using System.IO; using FOG; namespace FOG { public class MOD[yourmodulenamehere] : AbstractFOGService { private int intStatus; private String strFOGServerIP; private const String MOD_NAME = "FOG::MOD[yourmodulenamehere]"; public MOD[yourmodulenamehere]() { intStatus = STATUS_STOPPED; log(MOD_NAME, "MODDEBUG constructed"); } private Boolean readSettings() { if (ini != null) { if (ini.isFileOk()) { // Get the FOG Server IP Address or hostname strFOGServerIP = ini.readSetting("fog_service", "ipaddress"); return true; } } return false; } public override void mStart() { try { // write something to the fog.log file log(MOD_NAME, "Start Called"); intStatus = STATUS_RUNNING; log(MOD_NAME, "Sleeping for 100 Seconds"); try { System.Threading.Thread.Sleep(100000); } catch { } log(MOD_NAME, "Reading config settings..."); if (readSettings()) { log(MOD_NAME, "Reading of config settings passed."); doWork(); } else { log(MOD_NAME, "Failed to read ini settings."); } } catch ( Exception e ) { log(MOD_NAME, e.Message); log(MOD_NAME, e.StackTrace); } } public override string mGetDescription() { return "Your module name here - A short discription here."; } private void doWork() { try { log(MOD_NAME, "Starting module processing..."); // get the mac addresses on the client box String strMACAddress = ""; ArrayList alMACs = getMacAddress(); if ( alMACs != null ) { for (int i = 0; i < alMACs.Count; i++) { if (alMACs[i] != null) { // we take the first MAC address and use it strMACAddress = (String)alMACs[i]; break; } } } if (strMACAddress != null ) { // detect if a user is currently logged in Boolean blLgIn = isLoggedIn(); if (blLgIn) { // get the users name log(MOD_NAME, "Username: " + getUserName()); } else log(MOD_NAME, "No user is currently logged in"); // get the computers hostname log(MOD_NAME, "Hostname: " + getHostName()); } else { log(MOD_NAME, "Unable to continue, MAC is null!"); } } catch (Exception e) { pushMessage("FOG error:\n" + e.Message); log(MOD_NAME, e.Message); log(MOD_NAME, e.StackTrace); } finally { } intStatus = STATUS_TASKCOMPLETE; } public override Boolean mStop() { log(MOD_NAME, "Shutdown complete"); return true; } public override int mGetStatus() { return intStatus; } } } - Change the two instances of MOD[yourmodulenamehere] to something that makes sense like MODMyModule make sure both instances match.
- Now we need to change a few properties of your project before it will compile, so right-click on your project in the Solution Explorer and select properties
- In the application tab, change Assembly name to your module name, change the default namespace to FOG, and change Output type to Class Library
- We can now compile the application by clicking on Build -> Build Solution
- Your dll file will now be waiting for you in [your project folder]/bin/debug directory
- Copy only the new dll module (not the AbstractFOGService.dll, or IniReaderObj.dll) to a client computer running the fog service in the directory c:\program files\fog\, then restart the fog service and your new module will run.
OK, we have a working module, but it really doesn't do anything yet, so lets break down the code so it can be changed to fit your needs. The first thing you will want to change when creating a new module is the module name, and this has to be changed in two places and it they must match. To change the module name module the line:
... public class MOD[yourmodulenamehere] : AbstractFOGService ...
to something like:
... public class MODMyModule : AbstractFOGService ...
You will also need to change:
... public MOD[yourmodulenamehere]() ...
to
... public MODMyModule() ...
When a fog module runs, the first thing that happens is that the module is constructed, then when the FOG Service master process is ready to start running the modules, the function mStart() is called. This is basically the entry point of your module. During the course of execution of your module there is a state variable that you should keep up to date called, intStatus. This is used by the master service thread to determine what is happening with the sub services. If they are running or stopped. The valid states for this flag are:
- STATUS_RUNNING
- STATUS_STOPPED
- STATUS_TASKCOMPLETE
- STATUS_FAILED
One of the first things we try to do in mStart is to sleep for a fair amount of time if the process we are doing does not need to run right at service startup. The idea behind this is that the Windows startup process can be very slow in the first place, so we don't want the fog service to break the proverbial "Camel's Back".
After sleeping we call the function readSettings which pulls settings from the fog configuration file which is local to the client computer. If read settings returns true, then we call the function doWork. This is where you should do the bulk of the processing for your module should occur.
AbstractFOGService.dll
There are a few functions that are build into the AbstractFOGService.dll file that are also at your disposal. These include:
- log() - This function takes two arguments, the first being the module identifier, which is typcially MOD_NAME, and the last argument being the message you want to log. The entry is written to a simple test file typically located at c:\fog.log.
- getHostName() - This will return the computers hostname as a string.
- getMacAddress() - This function takes no arguments, and just returns an ArrayList of all the MAC addresses present on the client computer.
- getIPAddress() - This function will return an ArrayList of IP addresses for the workstation.
- isLoggedIn() - This function will let you know if any use is logged into the workstation.
- getUserName() - This function will return the username of the current user on the workstation.
- getDateTime() - A simple method that just provides a common date time string to all modules using the following: DateTime.Now.ToShortTimeString() + " " + DateTime.Now.ToShortDateString()
- restartComputer() - Does as the name says and tries to restart the computer using the Microsoft recommended method using WMI (doesn't work on every host)
- shutdownComputer() - This will shutdown the computer using the WMI call (doesn't work on every host)
- unmanagedExitWindows() - This method is the unmanaged code call to restart/shutdown the workstation
- pushMessage() - This method takes a single string as its argument, which is the message that should be pushed to a GUI window that will pop up in the upper right hand corner of the screen and remain active for 10 seconds. This is a good way to get information to the end user. This module requires the GUIWatcher module to be installed and active.
Building custom ramdisk/init
If you wish to modify the way that the pxe/tftp works files in the /tftpboot directory can be edited. This example will show how to automatically authenticate users when they select Quick Image. If you are happy to allow anybody to deploy an image to a hardrive this is for you.
cd /tftpboot/fog/images
gunzip init.gz
mkdir initmountdir
mount -o loop init initmountdir
cd /tftpboot/fog/images/initmountdir/bin/
edit fog.quickimage
Comment out the followig lines by putting a # in front
#echo " Enter a valid FOG username and password."; #echo ""; #echo -n " Username: "; #read username; #echo "" #echo -n " Password: "; #stty -echo #read password; #stty echo; #echo ""; #echo ""
Replace with:
username="a valid username" password="a valid password";
Save the modification
cd ..
cd ..
umount initmountdir/
rmdir initmountdir
gzip init
Your done now users can image without the need for a username and a password.
Caveats and Other Tips
- Prior to imaging the master pc, it is a good idea to disable hibernation, and swap file. This greatly reduces the size of the image. (no longer needed as of version 0.12 of FOG)
- Defrag the disk prior to imaging
- Run chkdsk prior to imaging
- Have at least 2gb free on the disk, or NTFSresize will fail.
- For importing hosts in a .csv file follow the format below: 1 line per host
"00:c0:4f:18:62:63","Hostname","1.1.1.1","Your description","XP/Vista","Image filename to use"
Troubleshooting and Debugging
Troubleshooting an image push to a client
To make this process easier, we are going to use a Windows XP image. Please also note that this process will wipe out whatever is currently present on the client computer. This tutorial assumes that your disk is /dev/sda1.
- In the management portal, start a debug task for the client computer in question. Allow the client to boot and at the bash prompt type the following commands.
- mkdir /images
- mount -o nolock x.x.x.x:/images /images (where x.x.x.x is the server ip, you may try also mount -t nfs -o nolock x.x.x.x:/images /images )
- cd /images
- dd if=/usr/local/fog/mbr/xp.mbr of=/dev/sda1 bs=512 count=1
- fdisk /dev/sda (No 1 at the end of the device name)
- Press "d", then "Enter"
- Press "w", then "Enter"
- fdisk /dev/sda
- Press "n", then "Enter"
- Press "p", then "Enter"
- Press "1", then "Enter"
- Press "1", then "Enter"
- Press "Enter"
- Press "t", then "Enter"
- Press "7", then "Enter"
- Press "a", then "Enter"
- Press "1", then "Enter"
- Press "w", then "Enter"
- partprobe
- /usr/local/sbin/partimage restore /dev/sda1 /images/[imagename] -f3 -b
- /usr/local/sbin/ntfsresize /dev/sda1 -f -b -P
Troubleshooting an image upload
To make this process easier, we are going to use an Windows XP image. Please also note that this process will wipe out whatever is currently present on the client computer. This tutorial assumes that your disk is /dev/sda1.
- In the management portal, start a debug task for the client computer in question. Allow the client to boot and at the bash prompt type the following commands.
- mkdir /images
- mount -o nolock x.x.x.x:/images/dev /images (where x.x.x.x is the server ip)
- cd /images
- dd if=/dev/sda of=/mbr.backup count=1 bs=512
- /usr/local/sbin/ntfsresize -f -i -P /dev/sda1
Look for You might resize you will need this number, so write it down. We will call this number NTFSSize. - Take NTFSSize and divide it by 1000
- Now add 300000 to that number and write down as N
- Now take NTFSSize again and multiply it by 1.1 and then round that to the nearest whole number and write it down as F
- /usr/local/sbin/ntfsresize -f -n -s Nk /dev/sda1
(where N is the value calculated above with a k after it. - If the test above ends successfully then run:
/usr/local/sbin/ntfsresize -f -s Nk /dev/sda1 - fdisk /dev/sda
- Press "d", then Enter
- Press "w", then Enter
- fdisk /dev/sda
- Press "n", then Enter
- Press "p", then Enter
- Press "1", then Enter
- Press "1", then Enter
- Press "+FK", then Enter (where F is the value calculated above; K must be capital)
- Press "t", then Enter
- Press "7", then Enter
- Press "a", then Enter
- Press "1", then Enter
- Press "w", then Enter
- partprobe
- /usr/local/sbin/partimage save /dev/sda1 /images/[somefile] --volume=9900000000 -z1 -o -d -f3 -b
- dd if=/mbr.backup of=/dev/sda
- Press "w", then Enter
- partprobe
- /usr/local/sbin/ntfsresize /dev/sda1 -f -b -P
Troubleshooting Driver Issues
Method 1
The first step to troubleshooting driver related issues with FOG clients is to download a live CD such as Fedora, or Ubuntu. Boot up the CD and see if the device that wasn't functional under FOG is working with the live CD.
If it is we just need to know the kernel driver name. This can be listed by issuing the following command:
lspci -k
The output will look something like this:
...
03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5754 Gigabit Ethernet PCI Express (rev 02)
Kernel driver in use: tg3
Kernel modules: tg3
...
In this case we know the driver required in the tg3 driver for network. You can either submit a request to the forum/feature requests section of sourceforge for this driver to be included, or see the section on building a kernel.
Method 2
The first step to troubleshooting driver related issues with FOG clients is to download a live CD such as Fedora, or Ubuntu. Boot up the CD and see if the device that wasn't functional under FOG is working with the live CD. If it is then:
- Go to http://cateee.net/sources/lkddb/
- Download the latest version of lkddb.list.bz2
- Go to http://cateee.net/sources/autokernconf/
- Download the latest version of autokernconf
- Copy both files to a directory and extract them
- Copy lkddb.list, kdetect.sh, and autokernconf.sh to a common directory
- cd to the common directory where the three files listed above are located.
- run ./kdetect.sh
- run ./autokernconf.sh
- Then post the contents of the auto.config to the FOG Forum, along with the model of computer or the device you are having issues with. It would also be helpful to post a link to the manufactures spec page for that device.
- If a driver exists for this device we will attempt to post an updated kernel to the kernel updates section of the FOG Management portal.
Booting/Imaging a computer without PXE capable Network Card
Not all Computers can Networkboot. So the guys from http://www.etherboot.org compiled a tool called gPXE for that reason.
Its very handy to use:
- Just download the actual version.
- Run the Make program and use 'dd' to copy it to a floppy.
For our Workgroup here in University it works with every old PC. You find a HowTo for creating disks and usb-sticks at http://etherboot.org/wiki/removable
If you plan on making a boot CD, on fedora you will need to install the following: syslinux mtools
yum install syslinux mtools
Bottleneck
To determine why a server is not performing as well as expected a program called atop if very useful. On Ubuntu apt-get install atop, this program will give you CPU, net card and disk information. Generally FOG does not require much CPU but requires great amount of disk and net card resources whilst imaging machines.
Taming The Beast
As FOG is so quick this can also cause huge problems for networks that aren't so fabulous. In some instances deploying an image to a single machine can bring down a whole network. One of a handful of solutions is to slow down the speed of the servers network card. Here is an example of a command that might take a little speed off your imaging.
ethtool -s eth0 speed 100 duplex half autoneg off
About the Developers
Chuck Syperski
Chuck Syperski is the lead software developer for FOG computer imaging solution. He is a software developer and network integration specialist for a public school district outside of Chicago, IL. Chuck Syperski has a Bachelor of Science in Computer Science from the University of Illinois. He specializes in Java, objective C, C, C++, C#, perl and php. You can contact Chuck Syperski directly via sourceforge as the following link:
http://sourceforge.net/users/microleaks/
Jian Zhang
No content
Appendix C: Alternative Resources
For Microsoft sysprep information, see this page: http://vernalex.com/guides/sysprep/video.shtml
FOG install HOWTO: http://www.howtoforge.com/installing-fog-computer-imaging-solution-on-fedora8
FOG sourceforge page: http://freeghost.sf.net/









































