Creating a Virtual FOG Server 1.5.3 on Linux Mint 18.3
I have created a tutorial for newcomers to FOG. The FOG 1.5.3 Server is installed on Linux Mint 18.3 in a VirtualBox environment on a laptop.
PLEASE LET ME KNOW IF ANY CHANGES SHOULD BE MADE OR IF ANY CLARIFICATION IS NEEDED.
LESSON 1 - CREATING A VIRTUAL FOG SERVER FOR TESTING OS AND APPLICATION DEPLOYMENT
My Testing Environment
A) Dell Latitude E7400 running Linux Mint 18.3 with Lan and Wireless connections – this is the Host
B) Oracle Virtualbox installed on the Dell Latitude E7400. You may use other Virtual environments like VirtualPC or Vmware or QEMU or Parallels or Zen Server. I chose Virtualbox because it is free.
C) FOG Server running on Linux Mint 18.3 in a Virtual Machine on Oracle Virtualbox – this is the VM that will deploy OS’s (Win 7, Win 8.1, Win 10, OS X, Linux), software (snapins), printers and much more…
D) Windows 10 running in a Virtual Machine on Oracle Virtualbox – this is the VM used to capture and deploy Windows 10.
This testing environment can be emulated on any computer with 2 network cards – either wireless or lan based network cards and with either Windows, OS X or Linux (Ubuntu, Linux Mint, RedHat, CentOS) as the host operating system.
Verify that both network cards are working properly before starting STEP 1. (i.e. you are able to access the internet either via wireless or via the lan connection).
Hardware Requirements –
Laptop or Desktop computer running either Windows, OS X or Linux (Ubuntu, Linux Mint, RedHat, CentOS) with 2 network cards (wireless or lan).
Software Requirements – download the following and save to your desktop
Linux Mint Mate 18.3 in ISO format from - https://www.linuxmint.com/edition.php?id=248
Oracle Virtualbox for Windows if using Windows as your host Operating system at https://download.virtualbox.org/virtualbox/5.2.8/VirtualBox-5.2.8-121009-Win.exe
Oracle Virtualbox for Linux if using Linux as your host Operating system at https://www.virtualbox.org/wiki/Linux_Downloads. Please click on the link for your specific version of Linux. i.e Ubuntu, CentOS, RedHat etc.
Oracle Virtualbox for OS X if using OS X as your host Operating system at https://download.virtualbox.org/virtualbox/5.2.8/VirtualBox-5.2.8-121009-OSX.dmg
Oracle Virtualbox Extension Pack at
STEP 1 – INSTALL AND CONFIGURE LINUX MINT ON ORACLE VIRTUALBOX – 12 mins
(a) Make sure that your computer is connected to the Internet at this time and you are able to browse the Internet before proceeding. On my setup, I am connected to the Internet via my Wireless card. Verified Internet connection by going to www.google.com on my Firefox browser.
(b) Install Oracle Virtual box –
i. for Windows double click on the VirtualBox-5.2.8-121009-Win.exe file that you saved on your desktop. Follow all prompts to install it.
ii. for OS X double click on the VirtualBox-5.2.8-121009-OSX.dmg file that you saved on your desktop.
iii. For Linux Mint or Ubuntu run virtualbox-5.2_5.2.8-121009~Ubuntu~bionic_amd64.deb.
For RedHat or CentOs run VirtualBox-5.2-5.2.8_121009_el6-1.x86_64.rpm
iv. Enter your password and follow the prompts. Reboot the computer.
( c ) Open Oracle Virtualbox, click on the New Icon and Enter the following:-
(d) Name: FOG on Linux Mint. Type: Linux Version: Ubuntu (64bit)
(e) Click Next, then next, then create, then VMDK, then next, click dynamically allocated and split into files of less than 2GB, then next, then 200GB for the max VM space then next. Double Click on FOG on Linux Mint.
(f) Search for the linuxmint.iso file you downloaded to the desktop and select it. Click Start to begin booting Linux Mint from the iso file. When the desktop completes loading, double Click on Install Linux Mint, click continue, then continue. Click Install Now, click continue, select city and click continue, select language and continue.
(g) Enter your name, Computer Name as fogserver, username and password. Make note of the username and password. Click log in automatically, click continue. Click Restart Now when completed. Press Enter at prompt to remove the install medium. Click Show this dialog at startup to disable and close the window.
(h) Click on the Devices menu and click Insert Guest additions CD image. At the installation prompt press OK then Run. Enter your password. When the install is completed press Enter. Restart the Linux Mint VM by clicking Menu button, Quit, Restart. Click Machine, then take a snapshot, name the snapshot Basic Linux Mint Installation then click OK. Doing this will enable you to go back to this point if you make any mistakes going forward and you will not have to install Linux Mint again from scratch. Right-Click on the network connection icon near the clock at the bottom of the screen. Click on connection information. Record the following:-
IP address – 10.0.2.15 Subnet mask - 255.255.255.0
Default route - 10.0.2.2 DNS – 10.0.2.3
Currently the network connection is configured as DHCP but we need to configure it as Static. Click on the network connection again and click Edit connections. Click Wired Connection 1 and click on edit. Click on the drop down icon on Device and select the device with eth? Or enp?s?. Make note of the device name eg enp0s3 or eth0. This will be your external network device (EXT) that will be used later on in the tutorial at STEP 3. Record the value of EXT = enp0s3 (This is my device info. Yours may be different)
(i) Click on the IPv4 Settings tab. On method change from Automatic (DHCP) to Manual. Click Add and type IP Address, netmask, gateway, and dns server you recorded in STEP 1(h) above. Click Save after entering all information.
(j) Open a terminal prompt and type sudo service networking restart and press enter. Enter your password. Click on the network connection icon and click on connection information and verify that all the information is the same as recorded in sTEP 1 (h). Verify that you can connect to the Internet. Click Menu button, Quit, Shutdown.
STEP 2 - CONFIGURE A SECOND NETWORK CARD TO BE USED BY FOG SERVER – 8 mins
a) Select FOG on Linux Mint by clicking once only. Click the Settings icon from the toolbar, click on Network, Click the Adapter 2 tab, click enable network adapter, click the drop down icon to the right of Attached to and click Internal Network, click ok. Double click on FOG on Linux Mint to start Linux Mint. Right-Click the network connection icon and click edit connections. Double-Click on wired connection 2, click drop down to the right of Device and select the device with eth? Or enp?s?, make note of the new device eg enp0s8 or eth1. This will be your internal device (INT) that will be used later on in the tutorial. Make a note that INT = enp0s8 or eth1 etc. Record the value of INT = enp0s8 (This is my device. Yours may be different)
b) Click on IPv4 settings tab. On method change from Automatic (DHCP) to Manual. Click Add and type
IP address – 192.168.1.10 then press TAB
Netmask – 255.255.255.0 then press TAB
Gateway – 192.168.1.10 then press Enter
DNS server – same as you recorded on STEP 1 (h) - My DNS was 10.0.2.3.
Click the Routes button and click the check box by Use this connection only for resources on its network. Click ok. Click save when completed. Click Close.
c) Right-Click on network connection icon and click on connection information. Verify that the information for Wired connection 2 and Wired connection 1 are correct. If they are not please make the needed changes, then reboot by clicking Menu button, Quit, Restart. Verify that you are still able to browse the Internet from the FOG Server on Linux Mint VM before continuing.
d) Create another snapshot by clicking on Machine, take snapshot, snapshot name is Linux Mint with 2 network cards
e) Before moving forward, we must enable Shared Folder Access on the FOG Server VM so that we can copy the drivers and scripts from the Host computer to the FOG Server VM. From the Oracle VirtualBox Manager click on the FOG Server VM once and click the settings icon from the menu. Click Shared Folder and click on the + sign. Click on the drop down icon for folder path and select Desktop folder and click choose, click auto-mount and OK. Click on Menu button and type users. Click on Users and Groups. Click Manage Groups and double-click vboxsf and click the Add button, enter your password and click the check box next to your login name and click OK then Close and Close.
f) Also you must enable Shared Clipboard to cut and paste from this document to the FOG VM Server. Click Devices, Shared Clipboard, Bi-directional to enable cut and paste to and from the FOG Server VM. Reboot the FOG Server so that these features will be enabled.
STEP 3 – CONFIGURE ROUTING FROM INTERNAL NETWORK TO EXTERNAL NETWORK – 7 mins
This will enable your FOG VM clients (running Windows, OS X or Linux) connected to the Internal Network on the INT network card (lan connection on my laptop) to access the internet through the FOG Server via the EXT network card (wireless connection on my laptop).
a) Open a terminal window and cut and paste the following in bold and press enter. sudo xed /etc/sysctl.conf
and enter your password. Goto the line with #net.ipv4.ip_forward=1 and remove the # from the line and save the file then close the file.
b) Enter the following 4 commands replacing INT and EXT with the network connections that you saved in STEP 1(h) and STEP 2 (a) that you recorded earlier. Eg on my laptop
EXT = enp0s3 and INT = enp0s8. Press Enter after each command. Note: Please cut and paste each line individually replacing the values of EXT and INT with your values.
sudo iptables -t nat -A POSTROUTING -o EXT -j MASQUERADE
sudo iptables -A FORWARD -i EXT -o INT -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i INT -o EXT -j ACCEPT
sudo ip addr show INT
c) Record the IP address (IPinfo)on the line that says inet after the last command and use it in the next command. Replace IPinfo with the value recorded in the next command IPinfo is 192.168.1.10
sudo ip route add default via IPinfo
d) Enter the following commands and press Enter after each:-
Temporarily disable Wired connection 2 (INT) by clicking on the devices menu in Virtualbox and clicking on network then click on Connect Network Adapter 2. Cut and paste the following in terminal.
sudo apt-get install iptables-persistent
press y and enter when prompted. Press y to save IPv4 rules. Press y to save IPv6 rules.
Re-enable Wired connection 2 (INT) by clicking on the devices menu in Virtualbox and clicking on network then click on Connect Network Adapter 2. Cut and paste the following in terminal.
press y and enter when prompted. Press y to save IPv4 rules. Press y to save IPv6 rules.
sudo sysctl -p
sudo /etc/init.d/dns-clean start
e) Take a snapshot. Name of Snapshot is - Routing configured
STEP4 – DOWNLOAD FOG SOFTWARE AND INSTALL AND CONFIGURE – 12 mins
a) If you have closed the FOG Server VM, double click on it to start it. Open Firefox in the VM and copy and paste the following in the browser. https://github.com/FOGProject/fogproject/releases/download/1.5.0/fog_1.5.0.tar.gz Save the file fog_1.5.0.tar.gz to the Downloads folder. Goto the Downloads folder and right click on the file and click extract here. Make another snapshot. Snapshot name – FOG downloaded but not installed. Again this will allow you to go back to this point if you make any mistakes in the following steps.
b) Open terminal and cut and paste the following lines, one at a time and pressing enter
c) Enter your password. Press 1, 2 or 3 depending on the version of Linux (Choose 2 for Linux Mint because it is Debian based) then Y then N. At the following prompt enter the information listed:-
IP address for FOG server - 192.168.1.10
Change default network interface - y
network interface – value for EXT which is enp0s8 in my setup
Setup a router address - y
Router IP address - 192.168.1.10
DHCP to handle DNS - y
DNS address – value of DNS from STEP 1 (h) – my DNS was 10.0.2.3
Fog DHCP service – y
Additional language packs – n
Wish to continue – y
MySQL password blank – y
Open a firefox and goto http://192.168.1.10/fog/management
Click on the Install/Update Now button at the bottom of the screen. Then click on “click here to login”. Go back to the terminal and press Enter. Close the terminal when you see Default User Information, Username: fog Password: password. Go back to Firefox and login with the user: fog and password: password
The FOG server is now configured and ready to register a host, capture and deploy an image, create a snapin, create default printers, create user groups etc. etc.
d) Make a Snapshot again.
Snapshot Name - FOG server Installed then Click on Menu then Quit then Shut Down – to shutdown your FOG Server.
STEP 5 – ADDING WINDOWS DRIVERS AND POSTDOWNLOAD SCRIPTS TO FOG SERVER – mins
In this step we will be adding Windows drivers for both x86 and x64 architecture for Windows 7, Windows 8 and Windows 10 to the FOG server for all computer models that you are managing and the FOG Postdownload scripts which checks the make and model of computer, the system architecture (x86 or x64) and the version of Windows (7, 8.1, 10) and copies the correct drivers for the specific computer model from the FOG server to the Client computer in the c:\Drivers folder.
- Create a folder on the desktop of the Host Computer called Drivers to store all drivers for various models. Under the drivers folder create the following folder structure for each model of computer in your environment and copy the drivers for that model in their respective folders:- (for example I am managing Latitude E6400 laptops and Optiplex 3010 computers, some are Installed with Windows 7 32bit, Windows 7 64bit, Windows 8.1, and Windows 10. So for each model I have drivers for each version of Windows supported. If you have less versions you will not need as many folders.). It is best to limit the amount of Operating Systems supported and the amount of different computer models to a minimum. I recommend no more that 2 versions of Windows and no more than 5 models of computers. Please note that you must use lowercase for the win7,win81, win10, x86 and x64 computers. FOG uses linux and linux is case sensitive i.e. Win7 and win7 are not the same and if you name the folder Win7 the drivers will not be copied from the FOG Server to the Windows Client. Also the Model name must be exactly as seen on the FOG Management Console under HOST, All hosts, hostname, Inventory, System Product - minus the spaces. i.e. if the FOG Management Console has Latitude E6400 then the folder must be LatitudeE6400 and again it is case sensitive. HERE IS AN EXAMPLE OF MY FOLDER STRUCTURE FOR DRIVERS!!
2. Drivers for Dell computers can be downloaded in CAB format and then extracted to each folder from the following site:
3. HP driver cabs can be found here: http://ftp.hp.com/pub/caps-softpaq/cmit/HP_Driverpack_Matrix_x64.html
4. You can download the Lenovo driver cabs for your hardware from here: https://support.lenovo.com/us/en/solutions/ht074984
5. Also copy all FOG post install scripts to a folder called postinstallscripts on the Desktop of the Host PC. Reboot the FOG Server VM and double click the Computer Icon then double click File System. Right click on images folder and click Open as Administrator. Open the drivers folder. Leave this window open and go to the Desktop of the FOG Server VM and double click on the icon on the desktop that say sf_Desktop (this is the shared folder from the Host PC). Select all the folders under the Drivers folder and copy them to the drivers folder on the other window you opened earlier.
6. Also copy all the FOG scripts from the share on the desktop in the postdownloadscripts folder to the \images\postdownloadscripts folder on the FOG Server VM.
THIS COMPLETES THE ADDITION OF THE FOG POSTDOWNLOAD SCRIPTS AND THE WINDOWS DRIVERS INJECTION.
Next we will install Windows 7 64bit on a VM, copy an unattend.xml file and scripts and run sysprep to prepare for capturing the image to the FOG Server. We will also upload Adobe Acrobat Reader, Google Chrome, Firefox and Office 2007 to the FOG Server.