chapter 2 and updates

This commit is contained in:
marcel-dempers 2024-11-20 19:57:29 +11:00
parent 77af9a7db2
commit 9d5651120b
8 changed files with 770 additions and 7 deletions

View File

@ -56,7 +56,7 @@ You will build the ultimate foundation and be equipped to make more informed dec
* <b>Operating System:</b> Windows (Pro and Enterprise ), Linux or MacOS
* <i>note: You'll need Pro or Enterprise Windows to support Virtualization</i>
* You will need at least 8GB RAM and 20GB of hard disk space to complete modules related to virtualization. </br>
* You will need at least 2GB EXTRA RAM and 25GB of hard disk space to complete modules related to virtualization. </br>
* <i>These numbers are early access guide only and may be reviewed and adjusted based on course feedback</i>
## 📖 Table of Contents

View File

@ -2,7 +2,7 @@
Back to [Course Introduction](../../README.md)
### 🎬 [Module 1: Introduction Operating Systems for DevOps](../../content/operating-systems/intro/README.md)
### 🎬 [Module 1: Introduction Operating Systems for DevOps](../../content/operating-systems/introduction/README.md)
#### In this module
@ -20,7 +20,7 @@ Back to [Course Introduction](../../README.md)
* The Kernel
* Terminal & Command Line
### 🚧🎬 [Module 2: Introduction to Servers & Virtualisation](../../content/operating-systems/virtualization/README.md)
### 🎬 [Module 2: Introduction to Servers & Virtualisation](../../content/operating-systems/virtualization/README.md)
#### In this module
@ -29,7 +29,7 @@ Back to [Course Introduction](../../README.md)
* Virtualisation software
* Creating our first server
### 🚧🎬 [Module 3: Introduction to Linux for beginners](../../content/operating-systems/linux/README.md)
### 🎬 [Module 3: Introduction to Linux for beginners](../../content/operating-systems/linux/introduction/README.md)
#### In this module
@ -59,4 +59,4 @@ Back to [Course Introduction](../../README.md)
* Basics of Automation
* Introduction to bash scripting
* Pro's and Con's of scripting
* Write our first bash script
* Write our first bash script

View File

@ -0,0 +1,120 @@
<span style="color:yellow">
</span>
🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦
<span style="color:yellow">
[seg-1] - [desk]
- Welcome to chapter `2`, and a new module that coveres the introduction to operating systems
- In the chapter overview I mentioned that under every system that you will work on, there is an operating system.
- [pc]
- let's start of with the course material
- in the course notes you will find the link to my Github repo
- when you open this link it will take you to github and you will see many files and folders
- what you are looking for is the course folder.
- i want you to get comfortable with navigating and familiarise yourself with the course content
- in the course folder is the course landing page which has table of contents
- and that takes you to each chapter. we are interested in chapter 1 so click that
- each chapter lists out a number of modules so in this video we cover ... so click that
- and now you are at the course content for this lesson.
- [side]
- Now in this module we'll be covering mostly theory, but i've hand picked the most important components of operating systems that I deal with day to day.
- You can do an entire year or two studying operating system fundamentals at university, so it has a lot of depth, but hopefully with this module you will get an idea of the important parts of the operating system so after completing this course, you can make informed descisions about where to put your time and energy to learn more.
- Also a lot of this theory will become important, especially in modules where we learn about how to use command line, scripting, and also I have an entire chapter on monitoring, so how to monitor a system effectively, and to do so you will need an understanding of operating system resources.
</span>
[seg-1] - [desk]
- Welcome to another video & new chapter in the ultimate course for DevOps
- In the previous modules and chapters we covered GIT, source control and IDEs.
- We learnt how to work with source code and why its important for devops, SRE and platform engineers
- This this new chapter we'll be covering operating systems
- As a DevOps, SRE or platform engineer you will be dealing with operating systems
- when doing automation, scripting, monitoring and all the tooling we use
- interfaces with the operating system
- It's probably the most boring part of IT
- because Operating systems are often huge portions of university IT semesters
- and so much time is spent on out of date irrelavant CPU chipset architectures of the 1980s
- that a lot of the important things for modern devops is lost
- today will be focussing on everything you need to know regarding operating systems in a modern devops field
- so without further adeau, lets go
[intro]
[seg-2] - [desk]
- first of all , what is an operating system
- An operating system is software that allows us to run programs
- All the automation , the scripting and tools we will run, run directly on the operating system
-[side] It allows user programs to [show desktop pc box] interface with the hardware
- [motion]
- in computer systems, users interact with applications
- applications are made up of code and scripts that developers write
- these applications interact with the operating system
- and the operating system fascilitates the interaction with the hardware
- the operating system ensures we have access to memory, network, disk and CPU cycles to do processing
- [desk]
- Why is the operating system so important for devops?
- *read ouf the section to camera*
- [pc]
- now the operating system has some key functions.
- talk through user and permission section
[seg-3] - [desk]
- Now When we use a computer, we dont work directly with the hardware.
- Even when we write automation scripts or code, we dont talk to the hardware directly
- All this is faciliated through the operating system
- *read out hardware management about mouse and keyboard explanation* [camera]
- [side]
- So how does the operating system achieve this ? we'll it uses whats called device drivers
[seg-4] - [pc]
- *read device drivers section* [can show USB drivers in device management tab]
- [desk]
- now with the boring stuff out the way, the next important and most relevant part of operating systems for devops is resource management
- there are three most important resources, cpu , memory and disk
- for devops this is very important because we will monitor how these resources are used in our systems
- how to view these resources, how to monitor and how to tune our system to effectively use these resources
- we'll touch on the basics on this in this module and then deep dive futher throughout this course
- [pc]
- *read CPU section* , combine [pc] and [side] views
<span style="color: yellow"> *when discussing cycles:* why is this important ? when we start looking at CPU performance from a devops perspective, we'll start seeing interesting challenges when analyzing CPU usage as a percentange. When we see CPU is at 100% utlization, what does that really mean ? what could application be doing when its stuck at high CPU usage, what could cause that and how can we solve this<span/>
- [desk]
- *read memory section*
<span style="color: yellow"> *discuss persistance in more depth* The word persistance is very important in software engineering<span/>
- [pc]
- *read Disk section* , combine [pc] and [side] views
<span style="color: yellow"> Explain database transactions and tradeoff with performance<span/>
[seg-5] - [desk]
- So far we've been talking about what the Operating system does, like device and resource management.
These operations are performed by part of the Operating system called the "Kernel" or core.
- Now applications and code or scripts that we write as engineers dont directly talk to hardware or in fact it does not interface directly with memory, CPU or disk.
- When we write code to say, "create a file on disk with this content"
- we send that instruction to the operating system and it will talk to disk for us
- The operating system piece that handles all of these "system calls" is called the kernel
[seg-6] - [pc]
- **walk through kernel section in readme**
- **walk through types section in readme**
- **walk through cmd section in readme**
<span style="color:yellow">walk through why command line is important, I.E running out of disk etc</span>
[outtro]
- Hope this video helps you with xxxxxxx.
- In the next one we'll take a look at ...
- Remember to like & subscribe, hit the bell
- You can also join the community
- If you want to support the channel futher, hit the join button - become a member.
- Thanks for watching , until next time , peace!

View File

@ -0,0 +1,229 @@
# 🎬 Introduction to Linux for beginners
## 💡 Preface
This module is part of a course on DevOps. </br>
Checkout the [course introduction](../../../README.md) for more information </br>
This module is part of [chapter 2](../../../chapters/chapter-2-operating-systems/README.md)
## What is Linux
Linux is a family of operating systems based on the Linux kernel. It's the most popular operating system on the planet that powers most of the internet today as well as Android which is powered by the Linux operating system. </br>
It's important to note that Linux comes in many [distributions](https://en.wikipedia.org/wiki/List_of_Linux_distributions) or Distros. a Distro is the Linux kernel, packaged alongside many supporting operating system software and libraries.
There are many popular Linux Distros, including Ubuntu, Debian, Arch Linux, Fedora and more. </br>
## Setup a Linux Server
For this module, you will need access to a Linux server. </br>
See the Preface section above for a link to the chapter overview page where you will find the module on Servers & Virtualization for creating a Virtual Server. </br>
Checkout [chapter 2: module: Introduction to Servers & Virtualization](../../../chapters/chapter-2-operating-systems/README.md) if you need to create a Linux server </br>
## Terminal, Shell & Command Line
The first thing we see when we start this server is that our software gives us a window where we can type commands. </br>
The window we see is called the Terminal. The terminal is just a window that accepts inputs and outputs </br>
The Terminal is responsible for running what's called a Shell. </br>
A Shell is a program that exposes the operating system to a user or a program. So we talk to the operating system by typing commands into the Shell. The Shell is the command intepreter which processes our commands and outputs the results. </br>
## Users & Security
When we created our server, we had to provide details of a username and password for our default user. </br>
This is a standard practice for setting up Linux. </br>
Linux by default is shipped with a `root` user. The `root` user is the administrative account of the operating system which have very high privileges. </br>
You are discouraged from using the `root` user because it can make almost any change to the operating system which can be disastrous or have catastrophic effects. </br>
### SUDO & Administrative tasks
In order to do administrative tasks on a server, instead of using the `root` account, we can setup whats called `sudo` </br>
`sudo` is a program that enables users to run programs with privileges of other users, by default the super user. </br>
SUDO originally stood for "superuser do" as it allowed us to do something as a super user. </br>
Then it became "su do", as in "Substitute user, do", because `sudo` can run commands as other users as well. </br>
To see `sudo`, type `sudo --help` </br>
We can run `sudo -i` to switch to `root` and `exit` to go back to our account
### Add a user
To add user: (We see only root account can do this)
```
adduser bob
Fatal: Only root may add a user or group to the system.
```
We elevate our privilege by using `sudo` in the front (and follow the prompts)
```
sudo adduser bob
```
Bob is now an unprivileged user. </br>
We can make Bob privileged by adding him to the SUDOers group then Bob can use `sudo` to elevate privileges just like our user.
```
# see the help text
usermod --help
# we are going to use -a which means append
# we are going to use -G which means we want to append to a group
usermod -aG sudo bob
# we get permission denied! remember to use sudo
sudo usermod -aG sudo bob
```
### Delete a user
To delete a user, we simply run `userdel`
```
userdel --help
#remove bob
sudo userdel -r bob
```
### List users
User information in Linux is stored in the `passwd` file which exists in the `/etc` directly
View the content of the file with the `cat` command
```
cat /etc/passwd
```
Another useful command to see who we are logged in as, is the `whoami` command
## The File system & Navigation
In order to navigate around, we will learn a couple of commands to navigate, but we also need to know what we are navigating </br>
* `ls` is a command we use to list contents in a directory. `/` id the root directory in Linux, which is the equivalent of `C:\` in Windows. Type `ls /` in the terminal to list out contents in the `/` root directory.
* <b>Home directories:</b> Under the `/` directory you will see a directory called `/root` which is the `$HOME` directory of the root user. </br> All other user folders are under `/home` </br>
The `~` also represents the full path to the home directory for your current user
* The `.` is a short-hand for the current directory. Example: `ls .`
* `echo` prints stuff to the terminal. One example is to see the content of the $HOME environment variable, we can type `echo $HOME` to see it </br>
* Environment variables are something we will dive into an our command line and scripting modules, but some variables are important as we have already seen with `$HOME`. Another one is `$PWD` which contains the current working directory. </br>
* <b>Create a directory:</b> we can create a directory with `mkdir` </br>
Create a directory in your HOME directory: `mkdir $HOME/testdir`
* <b>Change directory:</b> We can change the current working directory by using the `cd` command. </br>
I.E `cd $HOME`
* <b>Delete a directory:</b> we can create a directory with `rm` </br>
Let's delete our test directory: `rm -rf testdir`
### File management
Let's change directory to our $HOME folder
```
cd $HOME
```
We can see where we are
```
echo $PWD
```
Create a new folder where we can keep our scripts
```
# create directory
mkdir scripts
# view directory
ls -l
# change directory
cd scripts
```
Create a new script file with the `touch` command
We can use the `touch` command to create any type of file
```
touch my-first-script.sh
```
We can see the file is empty
```
ls
cat my-first-script.sh
```
We can edit the file using `nano` which is a simple text editor for Linux
```
nano my-first-script.sh
```
We can now write content in the file </br>
Let's add the following content to the script file:
```
echo "This is our first script running from directory $PWD !"
```
To exit `nano` and save the file, we press CTRL+x and type `Y` to save the file.
In our scripting module, we will look at running scripts in more details , but quickly:
```
# try run the script
./my-first-script.sh
-bash: ./my-first-script.sh: Permission denied
# needs exectute permissions
chmod +x my-first-script.sh
# try run the script again
./my-first-script.sh
This is our first script running from directory /home/devopsguy/scripts !
```
To copy a file, we can use the `cp` command. Lets make a copy of our script
```
cp --help
cp my-first-script.sh my-second-script.sh
ls -l
```
We can delete the second file with the `rm` command
```
rm my-second-script.sh
```
We can move or rename a file with the `mv` command
```
cp my-first-script.sh my-final-script.sh
```
## Package managers
To install things on Linux we need to learn about the package managers. </br>
Ubuntu Linux maintains sources list for where it downloads packages by default </br>
The sources list contains URLs or Links to Mirror sites or Repository sites where packages are looked for when trying to install things </br>
To install a package :
```
sudo apt-get install -y <packagename>
```
To remove a package :
```
sudo apt-get remove <packagename>
```

View File

@ -0,0 +1,202 @@
<span style="color:yellow">
</span>
🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦🎦 C:\Users\aimve\Videos\video-projects\videos\footage\
<span style="color:yellow">
[seg-1] - [desk]
- Welcome to chapter `2`, and a new module that coveres the introduction to Linux
- In the chapter overview I talked about servers and the importance of servers in DevOps.
- We'll most of the internet are run by Linux servers
- Linux is extremely important in DevOps, SRE, platform & cloud engineering.
- [pc]
- let's start of with the course material
- in the course notes you will find the link to my Github repo
- when you open this link it will take you to github and you will see many files and folders
- what you are looking for is the course folder.
- i want you to get comfortable with navigating and familiarise yourself with the course content
- in the course folder is the course landing page which has table of contents
- and that takes you to each chapter. we are interested in chapter 1 so click that
- each chapter lists out a number of modules so in this video we cover ... so click that
- and now you are at the course content for this lesson.
- [side]
- Now throughout this course we will be following practical steps, so i wont just be
- explaining theories and concepts , but I also urge you to follow along
- the benefit of this course is that we will be building you
- a personal website profile using DevOps tools, principals and practises
- to help you learn devops concepts.
- so at any time, pause this video if you need to and try to follow along
</span>
[seg-1-yt] - [desk]
- Linux is a very important operating system to learn about in DevOps, SRE, cloud and platform engineering.
- Linux makes up most of the internet
- Over 96% of the top one million web servers use Linux
- the Cloud is made up of around 90% Linux servers
- it runs all of the worlds 500 fastest super computeres and runs the world stock exchange.
- I think i've given many good reasons why Linux is important,
- But the reason its very important for you when learning DevOps is because much of the servers you may deal with in your career, may be running linux.
- We need to know how to work with linux
- How to setup
- How to configure
- How to monitor
- How to secure
- and effectively manage linux servers
- So today we take a look at Linux for beginners
- we'll create a linux server
- learn about the terminal, shell & command line and some of the linux basics
- we've got a lot to cover to
- without further adeau, lets go
<span style="color:yellow">
Importance for Linux - learning docker containers and kubernetes
</span>
[intro]
<span style="color:yellow">play course placement</span>
[seg-2] - [pc]
- show course material
- [side]
- so be sure to checkout the link down below to the readme file so you can follow along
- [pc]
- "so what is linux" - read (what is linux first paragraph)
<span style="color:yellow">walkthrough distributions chart</span>
- [side]
- Linux comes in many distros, or distributions
- Think of a distribution as a flavour
- You have the core of linux which is the burger, we all know what a burger is made of
- then you have many flavors of burgers, like mcdonalds, burger king, five guys, etc
- read (distro section)
[seg-3] - [desk]
- now to learn about Linux, you will need a linux environment
- It's very important to have a linux environment on hand
- which you can use as a playground
- if you mess it up, you can delete it and start again
- without affecting your own computer
- In a previous video we talked about servers and virtualization
- And I showed you how to create a linux server using virtualization software.
- If you dont have a server, check the preface in the course material
- which will take you to an earlier video on how to create a linux server
- [pc]
- show preface
- show a server quickly
- show SSH from VSCode
<span style="color:yellow">
importance of having a linux server you can create and destroy
- this is why the module on servers and virt is so important
- use it as a baseline to :
- automation - infrastructure as code
- we'll use it as practise
- you will likely create your server over and over
</span>
[seg-4] - [desk]
- [pc]<span style="color:yellow"> discuss (Terminal, Shell & command line section)</span>
- When working with linux we are immediately faced with a window
- where we have to type commands.
- This window is called a terminal
- It accepts inputs and outputs
- The terminal is responsible for running whats called a Shell
- a Shell is a program that exposes the operating system to users
- we dont type commands directly to the operating system
- we type it into the shell
- the shell is a command line intepreter which inteprets our command, processes it
- and outputs the results
- [pc]<span style="color:yellow"> discuss (Users & Security)</span>
- Now when running commands
- You have to run commands as a user
- When you installed Linux, you would have been prompted to create a user account and set a password
- This is the account you are encoured to use
- Linux also comes with a root account
- We are discouraged from using the root account
- Because its a highly privileged administrative acount
- that can change anything about the operating system
- This can lead to mistakes, disastrous outcomes or have catastrophic effects
- Firstly lets take a look at how to setup a user account and manage users
- [pc]
- *walkthrough (SUDO & Administrative tasks) section *
[seg-5] - [desk]
- This brings us to the file system
- Linux has an intimidating and overwhelming filesystem
- This is because all the files and directories are sort acronyms
- that we may not understand the meaning of
- this is ok.
- i'd highly recommend to ignore these when you start
- and you'll slowly get introduced to directories you need to care about
- otherwise you will be overwhelmed with information
- and to be honest I still dont know what most of the directories in linux are used for
- I've been using linux for years now and some directories
- i got really involved in, and then never touched them for years, and forgot what they are used for
- The key with Linux is just stay in your lane
- You dont have to know everything, and you'll be fine
- Let's focus on learning how to navigate the file system
- [pc]
- cover (File system & Navigation section)
[seg-6] - [desk]
- This may all seem like a lot of information
- Which is ok, The key with Linux is practise
- And all of these commands need to become muscle memory
- So using the command line as often as possible
- will make things a lot easier for you in the long run
- It's all about building that experience and being consistent
- with learning
- Navigating the filesystem is important
- But you will very often work with files
- So we need to learn about working with files in Linux
- Sometimes you need to make a change or few a config file on a production server on Linux, or you may need to reconfigure something.
- Let's take a look at that
- [pc]
- *walkthrough (File management) section*
[seg-7] - [desk]
- To install things on Linux, we need to learn about package managers
- Every Linux distrobution has a package manager
- used to install packages
- in our first modules in this course, we installed GIT using a package
- we installed VSCode using a package.
- There are different type of package manager
- You have RPM, YUM, APK
- For Ubuntu Linux, and Debian based Linux you have apt or apt-get
<span style="color:yellow">
when i used linux, i never deep dived package management too much
when ever i needed to install something, i googled it.
and then ran the commands i found to install anything i needed.
over time i learned what the commands mean
but i never really understood the concept of apt sources and package sources in the beginning. So don't be overwhelmed by it
</span>
- [pc]
- *walkthrough (Package managers) section*
<span style="color:yellow">
</span>
[outtro]
- Hope this video helps you with xxxxxxx.
- In the next one we'll take a look at ...
- Remember to like & subscribe, hit the bell
- You can also join the community
- If you want to support the channel futher, hit the join button - become a member.
- Thanks for watching , until next time , peace!
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04
https://www.digitalocean.com/community/tutorials/an-introduction-to-linux-basics

View File

@ -0,0 +1,212 @@
# 🎬 Introduction to Servers & Virtualization
## 💡 Preface
This module is part of a course on DevOps. </br>
Checkout the [course introduction](../../../README.md) for more information </br>
This module is part of [chapter 2](../../../chapters/chapter-2-operating-systems/README.md)
## What is a Server
A server is a dedicated computer that computes, stores and manages data or serves a specific purpose </br>
For example, a server could be running a database that stores important data, run a website for a company, or a set of services </br>
Types of servers include:
* Mail server
* Web server
* Database server
* DNS server
* Proxy servers
* Application servers
Servers can either be physical or virtual. </br>
Physical servers are ones that are made up of physical hardware, like the ones in a datacenter. </br>
You can also setup a physical server by using your old desktop hardware, or when you buy a Rasberry Pi or a mini PC like an NUC. </br>
When setting up a server, hardware is important </br> We want hardware that is reliable and long lasting to minimise cost and increase reliability and longevity </br>
For DevOps, SRE and platform engineers the most important part of setting up servers is choosing the hardware resources such as CPU, RAM memory and Hard disk types and sizes. </br>
## Why Servers are important for DevOps , SRE and Cloud Engineers
Throughout a DevOps career, you will be working either directly or indirectly with servers, whether you are working with real on-prem hardware, or servers in the cloud, or even with serverless technology, you will still be indirectly working with servers and will need to consider important aspects of how servers operate. </br>
For example:
* "How much traffic can this server handle?" (does not matter if its physical or virtual!)
* "How much data can this server store?"
* "Why is my application on this server so slow?"
<b>"The cloud is just someone else's computer"</b> </br>
Even if this is a cloud product or "server-less" technology where you cannot interact with a server directly, there is always a server somewhere and we will need to consider performance and reliability of our system running on that server </br>
## What is Virtualisation
Not all servers are physical. </br>
A Virtual server (or Virtual Machine) is a software-based server that acts as a real server. </br>
We can run this software on a physical server and run multiple virtual server </br>
So it allows us to slice up and share physical hardware among multiple virtual servers </br>
If you have a physical server with 24 cores and 64GB of RAM, you could host a few 4 core 8GB RAM virtual servers </br>
### Why run Virtual machines
There are a number of benefits why Virtual machines are great. </br>
* <b>Isolation</b>: Having seperate servers with seperate functions, like running a Web server and a Database server
* <b>Automation</b>: Using automation software or tools can help recreate servers and roll out updates
* <b>Scalability</b>: Ability to quickly add more servers when demands increase
## Virtualisation software
There are many types of virtualization software that allows us to create Virtual machines </br>
For simplicity and compatibility, in this course we will use
[Virtual Box](https://www.virtualbox.org/) as it can run on Windows, Linux and MacOS and its the simplest one to start with </br>
### Requirements
In order to follow along with this module, you will need an operating system with hypervisor capabilities. </br>
For Windows: check if Virtualization is enabled by:
* Right click your taskbar and open `Task Manager`
* Select the `Performance` window
* Check the right side of the panel, see `Virtualization` if its enabled or not.
For Linux: check if Virtualization is enabled by:
* run `sudo cat /proc/cpuinfo`
* If you see the below flags, Virtualization is enabled in the BIOS
* `vmx`: Intel VT-x, virtualization support enabled in BIOS.
* `svm`: AMD SVM, virtualization enabled in BIOS.
You will need at least 2GB extra RAM and 25GB of hard disk space to create a Virtual machine for this module </br>
<i>These numbers are early access guide only and may be reviewed and adjusted based on course feedback</i>
### Installation
### Windows:
In this module we will walk through the installation on both Windows & Linux. </br>
for Windows its as simple as following the installer prompts </br>
### Linux
For Linux, the installation can be slightly more complicated. </br>
* Virtualization needs to be enabled as per above Requirements </br>
* You need latest kernel modules for your computer
* You either need to turn off Secure boot in the BIOS, or you need to manually sign the VirtualBox kernel modules by using `mokutil`
Install Virtual Box on Ubuntu:
```
# install a few dependencies
sudo apt-get update
sudo apt-get install -y ca-certificates curl wget gnupg
# download oracle public key
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
# get your ubuntu codename for your source list
cat /etc/os-release | grep CODENAME
# update apt sources
sudo echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib" >> /etc/apt/sources.list.d/virtualbox.list
sudo apt-get update
sudo apt-get install -y virtualbox-7.1
```
#### Preferences
On the Preferences page, the most important thing is to select a folder where all our Virtual Machine data will be stored </br>
## Creating our first Server
In order to create a virtual server, we need to get an [ISO](https://simple.wikipedia.org/wiki/ISO_image) file </br>
What is an ISO image ?
Traditionally, an ISO image file is an image of an optical disk. In the past, we could create copies of CD's or DVD disks by creating ISO images of them and store them as files </br>
For Virtual machines, ISO image files are basically the disks that contains the operating system files that we use to install the operating system onto a Virtual Server. </br>
### Download the virtual machine ISO file
In this course we will get Ubuntu Linux from [ubuntu.com](https://ubuntu.com/) </br>
### Setup Network
One very important component of environments both for in data centers and in the cloud is the network. Servers communicate with one another over the network. </br>
Networks can be either public (like sitting on the internet) or private or a combination of public and private </br>
* Host-only Networks
* NAT Networks `Network Address Translation (NAT) is the simplest way of accessing an external network from a virtual machine. Usually, it does not require any configuration on the host network and guest system. For this reason, it is the default networking mode in Oracle VM VirtualBox.`
* Cloud Networks
An IP is a series of numbers and dots that identify a device that is part of a network. </br>
Networks have an IP range. </br>
We can specify a network range using whats called a [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) <br>
It's a way for us to "size" our network and know how many IP addresses are available in that network. </br>
There are many online network size calculators out there, but I like to use [mxtoolbox](https://mxtoolbox.com/subnetcalculator.aspx)
For example, we can create a network with IP starting with `10.0.0.0` and let's say we want 32 IPs , we select `/27` </br>
Our calculator will show us that this gives us 32 IPs </br>
Our first IP is 10.0.0.0 and we can increment the number at the end all the way up to 31, which in total means that we have 32 IP addresses. </br>
Private IPv4 address ranges include:
* 10.0.0.0 to 10.255.255.255
* 172.16.0.0 to 172.31.255.255
* 192.168.0.0 to 192.168.255.255
Private network ranges are blocked from being used on public networks. </br>
A network can have a really large IP range, because you may want to divide networks into many smaller networks, for example a network for each department or subset of servers. </br>
These divides are called [Subnets](https://en.wikipedia.org/wiki/Subnet). </br>
When a device connects to a network its assigned an IP address by [DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol) </br>
`Port Forwarding` allows us to forward certain ports from our machine to this virtual machine network. This is because the NAT Network is isolated so we need to setup any connections between us and the virtual machine </br>
### Creating Virtual Machine
On the main panel, we can click on `Machine` and `New` to get to the server creation page. </br>
give our server a `Name` and `Folder` where our virtual server data will be created. </br>
We select the `ISO Image` that we downloaded previously. </br> Once we select our ISO file, the rest gets filled out because the software gets the data from the ISO image. </br>
Next important section is `Hardware` </br>
#### Hardware
We select our `Base Memory` (RAM Memory) and `Processors` (CPU) </br>
We learnt about the importance of these resources in our Operating system introduction module </br>
When we choose these resources, we have to consider how much resources our host computer has. </br>
Next we create a hard disk, by filling out `Hard Disk File Location and Size`
Then we press `Finish` to create the virtual server </br>
## Setup Server Access
Now Virtual Box allows us to access our server by giving us a screen interface. </br>
Now if we wanted to automate things later and remotly manage this server, we need to setup [SSH](https://en.wikipedia.org/wiki/Secure_Shell) access
Get the local IP to setup port forwarding in Virtual Box
```
# grab the IP address from the `inet` section
ip addr
```
Install SSH server:
```
sudo apt-get update
sudo apt-get install -y openssh-server
```

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1014 KiB

After

Width:  |  Height:  |  Size: 1014 KiB