Fog

Tutorials >
Fog is a server that can make images of any harddrive and then download them to other, multiple, computers, thus cloning an entire system in a very speedy way.  Computers are booted by the LAN connected to the FOG server and are registered with Fog.  Then any task is set for a computer or a group of them, and when they are rebooted they and woke by the LAN again the tasks are performed - such as Data wipe, upload an image, deploy an image.

Fog Wiki https://wiki.fogproject.org/wiki/index.php/FOGUserGuide

Installing FOG

1. Install Debian with LXDE desktop from a Live CD and install a Gigabit LAN card on the PCI card slot of the PC to become the server.

2. Set up the interfaces file, but check that the Gigabit card is actually eth0 with:


/sbin/ifconfig -a
ip link show

will show which adapter is UP – ie the one plugged in to a cable

/etc/network/interfaces will look like:


# The loopback network interface
auto lo
iface lo inet loopback

auto eth0 eth1
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0

where eth0 is the Gigabit network card we want for the server, it has a fixed IP

and eth1 is the on-board ethernet card that can receive internet connection (DHCP IP address)


!! you wil need a firewall running when you connect to the outside world, such as firestarter – see extra installs at the end.


the FOG dependencies

(the FOG install script will download them anyway, but it will not show you the download progress, so it's helpful to have them pre-installed)

sudo apt-get install apache2 php5 php5-json php5-gd php5-cli php5-mysql php5-curl mysql-server tftpd-hpa tftp-hpa nfs-kernel-server vsftpd net-tools wget xinetd sysv-rc-conf tar gzip build-essential cpp gcc g++ m4 htmldoc lftp openssh-server php-gettext clamav-freshclam


3. mysql will not start for some crazy reason...

and the packages (mysql-server-5.5) will not be configured when running the FOG install - fix with:

sudo nano /etc/mysql/my.cnf

put a comment “#” in front of the line "bind-address" and save the file with Ctrl-X, y, Enter

then reconfigure with

sudo aptitude install mysql-server


5. download FOG from www.fogproject.org

> unpack the zipped folder (easy with Ranger, just highlight, press 1 and Enter)

> enter the Fog folder, then to the bin/ folder, and run install tool with

sudo ./installfog.sh

Answer the questions:



2 Debian
N normal server
Enter the IP address 192.168.1.1
DNS address? N
change default from eth0? N
use FOG for DHCP? N
Lang packs? N
Donate? N
Continue? Y Enter
MySQL password? Enter (leave blank)
Storage /images? Enter
MySQL password blank? Y

....

Press Enter when database updated


6. To enable the image storage, possibly need to run

sudo chown -R fog:root /images

and check in the file /etc/default/tftpd-hpa there is:

TFTP_DIRECTORY="/tftpboot"

not TFTP_DIRECTORY="/srv/tftp"


7. the desktop shortcut can be made made with

nano ~/.local/share/applications/fog.desktop

[Desktop Entry] 

Version=1.0
Name=FOG Server
Exec=chromium http://192.168.1.1/fog/management/
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=computer
Categories=System;


FOG is ready to roll!

Login at 192.168.1.1/fog/



Uploading an image

Log in with the FOG username and password
> Go to Image Management >Create

New Image

  • Enter new image name, like the next Lubuntu image e.g. Lubuntu-10 etc

  • Operating System, Linux

  • Image Type, Single Disk - Resizable (Note: multiple partition would be nice, to upload root and home partitions, but the image will be deployed exactly the same size as it was imaged, say 160Gb or whatever, and that will be impossible for an 80Gb PC, or missing a lot of space for a 250Gb PC. So Single Disc Resizable is the easiest and fastest for deploying to hundreds of PC's)

  • click Add

> plug in a LAN cable to the Lubuntu laptop and boot with network (PXE)

  • when FOG menu appears, select Quick Registration

> Go to Host Management in FOG > List all hosts

  • click on the new Lubuntu host

  • on Host Image, select the new image name you just made

  • click Update

  • select Basic Tasks at the side

  • select Upload

  • Create Upload Task

> reboot the laptop with Ctrl-Alt-Del, then boot with LAN again

  • the upload task will start, it will first resize the harddisk

  • with a slow switch it takes over 1 hour to upload, fast switch, 12 min, for a system with 6Gb data



Download an image to clients

> boot computers with LAN and Quick register them > Host Management > List all

  • enter a new group name and Process group changes

> Group management > List all groups

  • select the group

[for junk computers]

  • Basic Tasks, select Advanced, Fast wipe, Create Fast wipe task

  • reboot the PC's to start the data wipe

[for old Lubuntu computers, and junk PC's after data wipe]

  • Basic Tasks, Download (or click on download arrow next to group name)

[multicast should be faster, but all the computers must be ready to start at once, and they must all be of same spec, so it often doesn't work]


When done with a task or group..

> List all groups, click delete next to the group

  • check the remove hosts with group, then Remove

Removing the hosts is recommended so that new hosts won't get confused.


The max no. of PC's that can download at one go is set in Storage Node > Max Clients

  • if set to a low number, like 1, then only one computer will process and the others will wait in queue

  • It's not a good idea to upload twice onto the same image, you should make a new image every upload

  • delete the image that's not needed anymore so that people don't download old images to the computers


The storage node you use must be set Master Node and the password must match the FOG user password!

If you change the FOG user password you would need to change it in Storage Node so that an image can upload - if the password is wrong, the upload will nearly complete but get stuck at the end, unable to transfer the uploaded data from /tmp into the node in /images (though it should be able to be copied from there).


The IP address of the server is 192.168.1.1

This is set in /etc/network/interfaces file in order for clients to successfully make DHCP sign up with the server (get an IP address)

The server IP is in three places in Fog Configuration > Fog Settings

-General Settings

-TFTP Server

-Web Server

It is set there by the FOG install script and they don't need changing, so long as you enter it correctly when installing FOG.