This is an environment build using Ansible, Vagrant, and VirtualBox to create an environment suitable for study and practice of Linux. In order to make use of this environment, some software will need to be installed on your computer. The computer you use for this should have at least 16Gb of RAM and a CPU that has at least 2 cores. You may be able to get away with a little less, however for the optimum experience it is recommended. This can be setup on hosts with a variety of operating systems.
Gatekeeper will block virtualbox from installing. All you have to do is go into Security & Privacy of System Preferences and click Allow under the General tab and rerun installation.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" && xcode-select --install &&brew install ansible ; brew install python ; brew cask install vagrant ; brew cask install VirtualBox ; brew cask install virtualbox-extension-pack ; vagrant plugin install vagrant-guest_ansible
- Install the Latest Version of Vagrant - (
brew cask install vagrant
)- Vagrant Plugin -
vagrant plugin install vagrant-guest_ansible
- Vagrant Plugin -
- Install the Latest Version of Virtualbox (
brew cask install VirtualBox
)- Virtual Box Extension Pack (
brew cask install virtualbox-extension-pack
)
- Virtual Box Extension Pack (
- Create a separate
~/bin
directory andcd
to it. (The directory doesn't have to be ~/bin, it can be anything you want.) - Clone the environment repo to it with
git clone https://github.com/OpenCloudJedi/Rocky9-GUI.git
- Change to the
Rocky9-GUI
directory that is now in your~/bin
directory. - Run
vagrant up
to deploy the environment (If the environment has a designated repo VM it will take the longest to deploy the first time only, this is because the repo system has all the packages available to the base release but will be quicker on subsequent deployments.)
NOTE - If it's been awhile since you've run yum update, do that first. Reboot if the kernel was updated. There may be some dependencies errors but don't be alarmed as this won't stop the environment from working.
NOTE2 - If you receive an error for an ansible guest vagrant plugin, DO NOT worry, as there are two different plugins related to Ansible and only one needs to be installed.
systemctl stop packagekit; yum install -y epel-release && yum install -y git binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms libvirt libvirt-devel ruby-devel libxslt-devel libxml2-devel libguestfs-tools-c ; mkdir ~/Vagrant ; cd ~/Vagrant ; curl -o vagrant_2.2.6_x86_64.rpm https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.rpm && yum install -y vagrant_2.2.6_x86_64.rpm && vagrant plugin install vagrant-guest_ansible ; vagrant plugin install vagrant-guest-ansible ; wget -O /etc/yum.repos.d/virtualbox.repo wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo ; yum install -y VirtualBox-6.0 && systemctl start packagekit
systemctl stop packagekit; dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm ; dnf install -y git binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms libvirt libvirt-devel ruby-devel libxslt-devel libxml2-devel libguestfs-tools-c ; mkdir ~/Vagrant ; cd ~/Vagrant ; curl -o vagrant_2.2.6_x86_64.rpm https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.rpm && dnf install -y vagrant_2.2.6_x86_64.rpm && vagrant plugin install vagrant-guest_ansible ; wget -O /etc/yum.repos.d/virtualbox.repo wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo ; dnf install -y VirtualBox-6.0 && /usr/lib/virtualbox/vboxdrv.sh setup ; usermod -a -G vboxusers root ; systemctl start packagekit
- Create a separate
~/bin
directory andcd
to it. (The directory doesn't have to be ~/bin, it can be anything you want.) - Clone the environment repo to it with
https://github.com/OpenCloudJedi/Rocky9-GUI.git
- Change to the
Rocky9-GUI
directory that is now in your~/bin
directory. - Run
vagrant up
to deploy the environment (If the environment has a designated repo VM it will take the longest to deploy the first time only, this is because the repo system has all the packages available to the base release but will be quicker on subsequent deployments.)
- If using Windows:
- Install Microsoft C++ Visual 2019
- Install the Latest Version of Vagrant
- Install the Latest Version of Virtualbox and Virtual Box Extension Pack
- Then install the following vagrant plugin via PowerShell as Administrator
vagrant plugin install vagrant-guest_ansible
Once the above software is installed. Do the following if you're running the environment on Windows:
- Create a separate
~/bin
directory andcd
to it using the same PowerShell/Terminal as Administrator/Root. (The directory doesn't have to be ~/bin, it can be anything you want.) - Use your browser of choice and navigate to https://github.com/OpenCloudJedi/Rocky9-GUI, press the green “Clone or download” button then the “Download ZIP” button. Or use Github Desktop (See below).
- Once downloaded, unzip the file and move it to the directory you created earlier,
~/bin
in the above example. - Use PowerShell/Terminal as Administrator/Root again and cd to the
~/bin/Rocky9-GUI-main
directory then runvagrant up
to deploy the environment. (It will take the longest to deploy the first time only, this is because the Vagrant system downloads the base image only the first time.
NOTE - If it's been awhile since you've run apt update, do that first. Reboot if the kernel was updated.
sudo snap install ruby ; sudo apt install ruby-bundler git -y; wget -c https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.deb ; sudo dpkg -i vagrant_2.2.6_x86_64.deb ; wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - ; wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - ; sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"; sudo apt update; sudo apt install -y virtualbox ; vagrant plugin install vagrant-guest_ansible
- Create a separate
~/bin
directory andcd
to it. (The directory doesn't have to be ~/bin, it can be anything you want.) - Clone the environment repo to it with
git clone https://github.com/OpenCloudJedi/Rocky9-GUI.git
- Change to the
Rocky9-GUI
directory that is now in your~/bin
directory and then cd into the OS directory you want to deploy. - Run
vagrant up
to deploy the environment (If the environment has a designated repo VM it will take the longest to deploy the first time only, this is because the repo system has all the packages available to the base release but will be quicker on subsequent deployments.)
NOTE this requires a free Github account
- Navigate to https://desktop.github.com/ and download Github Desktop.
- Create or sign in to your account.
- Click "Clone a repository from the Internet" and enter "OpenCloudJedi/Rocky9-GUI" and choose a location then "Clone".
- You are also able to easily pull changes when they're made available.
vagrant up
- Boots and provisions the environmentvagrant destroy -f
- Shuts down and destroys the vm and wipes all data on it.vagrant up --provision
- Builds the servers that were destroyed and runs provisioning scripts again
If you want you can create a snapshot of your machine that get reset and then restore that snapshot to quickly start over. This is significantly faster than a full reset.
- First bring up the environment fully and make sure the provisioning script ran (The ansible part after the machine boots up)
- Make a snapshot of the vm
vagrant snapshot create Rocky9-GUI Rocky9-GUI
- After completing your studies or in the case you broke your machine, try restoring the images back the vm (make sure you are in the project directory before attempting this ie. ~/bin/LinuxPlus-main/CentOS )
vagrant snapshot restore Rocky9-GUI Rocky9-GUI
You can also use the VirtualBox console to interact with the VMs or through a terminal. The workstation VM has gnome desktop installed and can be used so you have a linux terminal if you happen to be running Windows. If you need to reset the root password, you would need to use the console. I'm constantly making upgrades to the environments, so every once and awhile run git pull
in the repo directory to pull down changes. If you're using Windows, it's recommended to use Github Desktop so you can easily pull changes that are made to the environment. The first time you run the vagrant up command, it will download the OS images for later use. In other words, it will take longest the first time around but will be faster when it is deployed again. You can run vagrant destroy -f
to destroy your environment at anytime. This will erase everything. This environment is meant to be reuseable, If you run the vagrant up
command after destroying the environment, the OS image will already be downloaded and environment will deploy faster. Deployment should take around 15 minutes depending on your computer. Everything should be provided that you would normally need during an actual exam. Hope this helps in your studies!
- Rocky1
- Rocky2 (Both Rocky1 and Rocky2 are on the same network, so they can communicate with each other.)
Rocky1
- 192.168.2.100
Rocky2
- 192.168.2.101