MILESTONE X ‐ FOG - seabar24/SYS-480 GitHub Wiki
Use the following link to get a Rocky 8 ISO file to create a new FOG
Server off of:
- 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.
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:
- 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:
Select English and click Continue
:
Select Installation Destination
and pick one of the disks for the Installation Destination:
Ignore that this screenshot says 16 GB, I redid the Rocky Install and made the Hard Disks 25 GBs.
Click Done
and then select User Creation
to create our deployer
users, make them Administrator, and create a password for them to do SysPrep:
Once done, click Begin Installation
and wait for the install to finish. This will take some time:
Once the install is done, make sure to Install VMWare Tools, OpenSSH Server and disable IPv6:
You can use this ubuntu-sealer.sh
as a reference for the type of SysPrep we are doing:
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:
And finally create a new snapshot called Base
.
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.
Make sure to add A
and PTR
Records for NS Lookup on the Fog Server:
Then manually set the IP Address to 10.0.17.5
, create sudo user for fog
, and set the hostname to fog
.
sudo nmtui
Set Hostname
Adding the fog
sudo user:
sudo useradd <username>
sudo passwd
sudo usermod -aG wheel <username>
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.
We will mount our /dev/sdb
and make a new partition using fdisk /dev/sdb
. Select the defaults when creating the new partition:
Then type w
to write the partition to the disk:
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.
We will be creating a ext4 file system on this raw partition with the following commands:
mkfs.ext4 /dev/sdb1
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:
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:
Then do a reboot of your fog
server.
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.
Set Y
for setting SELinux to pervassive:
Select N
for disabling the local firewall:
Select Redhat Based Linux (Redhat, Alma, Rocky, CentOS, Mageia)
for the version of Linux:
Select Normal
Installation for FOG Server:
Select N
for the DHCP Options and y
for HTTPS Option for FOG. And also keep the hostname given earlier:
Once you get to this screen and confirm the settings are correct, select Y
to continue. This will take some time to complete.
After a little bit, you will be met with setting a password for the new database. Remember this password.
The install will be finished once you get to the screen:
Before going to the link in the install, access the fog server via SSH and set the firewall-cmd
to following settings:
- 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
.
- 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
:
Click to do the Installation:
Then click Enter
on the Fog Server to continue. This part will take awhile:
Once done, you will get your default fog
login/password, sign into the https://10.0.17.5/fog/management
page from here:
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:
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
!!!!!!!!
Select Apply
& Ok
to save those settings.
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
.
In the FOG Dashboard, go over to Images
> Create New Image
:
Then configure the image settings to the following:
- 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:
Then within the List All Images
tab we can see the Image that we just created:
Boot up xubuntu-target-capture
and select the following Boot Option:
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!!!
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
.
On the Hosts Menu, we are going to select the Capture
task and pick our Xubuntu-20.04
as the Host 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:
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.
Once the Image Capture is complete, we can see that it is changes within the Images
tab on FOG:
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
.
Log in with your fog credentials:
Select our Xubuntu-20.04
and wait for the Deployment to complete.
Once it's complete, we can then login in to our newly deployed xubuntu VM!