MILESTONE X ‐ FOG - seabar24/SYS-480 GitHub Wiki

Rocky 8 Prep

Use the following link to get a Rocky 8 ISO file to create a new FOG Server off of:

Rocky ISO Download

  • Choose minimal ISOS and x86_64 Architecture

Once the download is done, upload it to your Datastore 2 on your ESXi Host for VM Creation.

image

Then once that is done, go into your Xubuntu-wan box and create a new Base VM called Rocky-8.base.

  • OS Family: Linux
  • OS Version: Rocky Linux (64-Bit)

Customization hardware:

image

  • Make sure to add a 2nd Hard disk!
  • Thin Provisioning on both
  • CD/DVD: Datastore ISO File - Rocky-8.9-x86_64-minimal.iso

Once finished, power on your Rocky-8.base VM and go through the installation Process:

image

Select English and click Continue:

image

Select Installation Destination and pick one of the disks for the Installation Destination:

image

Ignore that this screenshot says 16 GB, I redid the Rocky Install and made the Hard Disks 25 GBs.

image

Click Done and then select User Creation to create our deployer users, make them Administrator, and create a password for them to do SysPrep:

image

Once done, click Begin Installation and wait for the install to finish. This will take some time:

image

image

Once the install is done, make sure to Install VMWare Tools, OpenSSH Server and disable IPv6:

image

You can use this ubuntu-sealer.sh as a reference for the type of SysPrep we are doing:

ubuntu-desktop.sh

or run the following commands:

# Installing OpenSSH
sudo yum update
sudo yum install -y openssh-server
sudo systemctl start sshd
sudo systemctl enable sshd
ssh-keygen -t rsa -b 4096
# Disabling IPv6
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

Once that's done, Power down the VM and set the CD/DVD to Client Device and the Network Adapter to 480-WAN:

image

And finally create a new snapshot called Base.

image

Fog Installation

Cloned VM Creation

For FOG Installation, create a Full Clone of the newly made Rocky-8.base VM and call it FOG.

Use the 480-utils script to create the Full Clone and then Power it On.

DC1

Make sure to add A and PTR Records for NS Lookup on the Fog Server:

image

image

Then manually set the IP Address to 10.0.17.5, create sudo user for fog, and set the hostname to fog.

sudo nmtui

image

Set Hostname

image

Adding the fog sudo user:

sudo useradd <username>
sudo passwd
sudo usermod -aG wheel <username>

File System Mounting

Login in as root on fog and check your disks using fdisk -l. Take note of the partitioned disk with our OS running off it, and the second hard disk that is unpartitioned.

/dev/sda being the Partitioned disk.

/dev/sdb being the unpartitioned disk.

image

We will mount our /dev/sdb and make a new partition using fdisk /dev/sdb. Select the defaults when creating the new partition:

image

Then type w to write the partition to the disk:

image

Doing another fdisk -l we can see a new partition called /dev/sdb1. This is a raw partition that has not been formatted to the file system.

image

We will be creating a ext4 file system on this raw partition with the following commands:

mkfs.ext4 /dev/sdb1

image

Now we are going to mount the filesystem in a way that will mount it every time we boot up the system.

Make a new directory called images:

mkdir /images

Then edit the file called fstab in /etc/fstab/ according to the screenshot below:

image

Save and exit that file. Then run the command:

mount -a

If prompted, make sure to run the command systemctl daemon-reload to make sure the file system is booted when restarted.

We can see if fstab worked by looking in the /images directory and seeing this:

image

Then do a reboot of your fog server.

FOG Installation

From here, we are going to do a git pull of the fogproject from github using the following commands:

yum install git
git clone https://github.com/FOGProject/fogproject.git

SELinux does not like the fogproject, so we need to set SELinux to be permissive or off. As well as set the correct services through the Firewall for fog to work correctly.

First, traverse over to ~/fogproject/bin/ and run the install script called installfog.sh. We are going to go step-by-step to disable SELinux and enable to correct services for fog to work during the install.

image

Set Y for setting SELinux to pervassive:

image

Select N for disabling the local firewall:

image

Select Redhat Based Linux (Redhat, Alma, Rocky, CentOS, Mageia) for the version of Linux:

image

Select Normal Installation for FOG Server:

image

Select N for the DHCP Options and y for HTTPS Option for FOG. And also keep the hostname given earlier:

image

image

Once you get to this screen and confirm the settings are correct, select Y to continue. This will take some time to complete.

image

After a little bit, you will be met with setting a password for the new database. Remember this password.

image

The install will be finished once you get to the screen:

image

Firewall Setup

Before going to the link in the install, access the fog server via SSH and set the firewall-cmd to following settings:

image

  • Make sure to add them using --permanent
  • Make sure to do a firewall-cmd --reload

For the /images directory, we are going to modify the permissions so that root is the owner, fogproject is the group owner, and the permissions are drwxrwxr-x.

image

  • chown root:fogproject
  • chmod 775

Now that permissions and services are setup, traverse to the fog installation page in the Xubuntu-wan browser at https://10.0.17.5/fog/management:

image

Click to do the Installation:

image

Then click Enter on the Fog Server to continue. This part will take awhile:

image

Once done, you will get your default fog login/password, sign into the https://10.0.17.5/fog/management page from here:

image

image

image

Image Capturing

Pre-Setup

Before starting Image Captures, we need to add a couple of rules to our DHCP Server on DC1.

In Scope Options, select the following for our fog server:

image

image

IF YOUR XUBUNTU-CAPTURE-TARGET IS UNABLE TO BOOT TO BIOS IN THE NEXT COMING STEPS. (LIKE MINES DID). THEN SET THE 067 Bootfile Name STRING VALUE TO ipxe.efi INSTEAD OF undionly.kpxe!!!!!!!!

image

Select Apply & Ok to save those settings.

Setup

For this portion, we are going to take our Base Snapshot under our Xubuntu-wan VM when we set it up and make an Image Capture of it to become an actual VM and put it under our BaseVM folder.

First, use the 480-utils script to create Full Clone VM of Xubuntu-wan. Name the new clone xubuntu-20.04-base.

Then use the script again to create a clone from xubuntu-20.04-base and call it xubuntu-capture-target.

image

In the FOG Dashboard, go over to Images > Create New Image:

image

Then configure the image settings to the following:

image

  • Image Name: xubuntu-20.04
  • Operating System: Linux - (50)
  • Image Path: /images/xubuntu-20.04
  • Image Type: Multiple Partition Image - Single Disk (Note Resizable) - (2)

Then click Add to add the Image:

image

Then within the List All Images tab we can see the Image that we just created:

image

Boot up xubuntu-target-capture and select the following Boot Option:

image

Change the Boot Order so that it will Boot to the EFI Network. From here, the PXE will grab it and set it up for FOG Imaging. MAKE SURE THAT YOUR BOOT OPTION HAS THE SECURE BOOT UNCHECKED!! THIS CAUSED ME A HEADACHE FOR AN HOUR!!!

image

image

image

Choose Quick Registration and Inventory and wait until the install is fully complete! Once it goes through it and trys to boot up from EFI Network again, you can power it off and move over to FOG to see the image from Hosts.

image

On the Hosts Menu, we are going to select the Capture task and pick our Xubuntu-20.04 as the Host Image:

image

image

image

Go over to tasks to make sure that the Capture Task is running. If not, go over to List All Hosts and click on the Capture button again to run the task:

image

image

Boot up xubuntu-target-capture again and make sure to boot to the EFI Network again so that the Image Capture will take place. This will take a little while.

image

Once the Image Capture is complete, we can see that it is changes within the Images tab on FOG:

image

Deploy VM from Image

Create a new VM called Xubuntu-deploy.

  • CPU: 1 GB
  • Memory: 2 GB
  • Hard Disk: 31 GB, Thin Provisioned

Once booted up, it should boot according to the EFI Network Boot, but if not do a quick sudo systemctl reboot --firmware-setup and boot it via EFI Network.

Once in the FOG Project page, we are going to select Deploy Image.

image

Log in with your fog credentials:

image

Select our Xubuntu-20.04 and wait for the Deployment to complete.

image

image

Once it's complete, we can then login in to our newly deployed xubuntu VM!

image

⚠️ **GitHub.com Fallback** ⚠️