Let’s talk about the Linux installation, but first of all why Linux is a great OS as compared to others in most of the scenarios.
Why Linux:
Linux is open source, which means its code is available, for anyone to inspect, modify and distribute and most of its distributions are free of cost. It has a reputation for being more secure as compared to other operating systems because of its open-source nature, where the community can quickly identify and patch vulnerabilities.
Linux is versatile and can run on a wide range of hardware devices, from embedded systems to IOT devices to supercomputers to mobile devices and it’s also well-known for its efficient resource management and performance.
When it comes to customization there’s no end, it allows for the customization of user-experience from the choice of desktop environment to kernel-level modifications. Its distributions generally place high emphasis on user privacy, so we can check how it handles our data.
Linux is also known as the backbone of the internet, as most web servers, including those running major services like Google, Facebook, and Amazon, are Linux-based. Many enterprises use Linux for its reliability, scalability, and cost-efficiency.
At this stage, we have an idea about why its important to learn Linux OS. Now comes to its installation, we’ll talk about it in our own context where we will install it for learning purposes.
Linux Distributions:
So first of all, we have to choose the Linux distribution for installation and here we have several options:
- Ubuntu: It is one of the most user-friendly and widely used distributions and has a large community and excellent support.
- Fedora: Known for cutting-edge features and strong support from the open-source community.
- Linux Mint: Based on Ubuntu, with a more familiar interface similar to Windows.
- Red Hat Enterprise Linux (RHEL): It is a commercial distribution widely used in enterprises for servers, cloud environments, and mission-critical applications and also offers special support and services that are paid.
- CentOS: That was used to be a very popular free, open-source alternative to Red Hat Enterprise Linux (RHEL) with its stability, compatibility with RHEL, and long-term support, without the cost associated with RHEL’s commercial licenses. But recently in 2020, The CentOS Project, in coordination with Red Hat, announced that it would shift full investment to CentOS Stream, the upstream development platform for upcoming Red Hat Enterprise Linux releases. As a result, CentOS Linux updates and releases were discontinued between 2021 and 2024, finishing when CentOS Linux 7 reached EOL on June 30, 2024. [ Check over here ]
- CentOS Stream: After the EOL of CentOS linux, Red Hat introduced CentOS Stream, an upstream version of RHEL. This means it sits between Fedora (the cutting edge) and RHEL (stable), and it serves as a testing platform for features that will later be included in RHEL.
So, what we have studied during the courses ( RHEL Intensive + ) was about CentOS, so did we waste our time with CentOS 6, 7, & 8? No, everything we learned to do on CentOS, can be done exactly the same way on RHEL. Likewise, if you switch to CentOS Stream, you take all that knowledge and experience with you.
So, we will learn about the installation of centOS Stream and even can we upgrade to CentOS stream from centOS Linux (7, 8 ) with 3 simple commands; no painful migration is required.
Linux Installation Platforms:
As per our purpose, we have two options:
- Desktops/Laptops: The most common option for running Linux, allowing you to replace or dual boot with an existing OS.
- Servers: This is often used for web, database, and file servers.
So our focus will be the servers.
Installation options for Linux server:
We have 5 different options:
- Single Boot: Directly on the server’s physical hardware, replacing any existing operating system.
- Dual Boot: Install Linux alongside another operating system. Not ideal for servers.
- Headless Installation: Means only command-line installation no GUI is available.
- Virtualization: Installing Linux on a virtual machine (VM) using hypervisors like VMware, KVM, VirtualBox, Parallels Desktop, and UTM. [ We will utilize this method ]
- Containers: Instead of full virtual machines, containers are lightweight, isolated environments that run on the same kernel as the host OS. Tools like Docker, Podman, or LXC are used to manage these containers. [ Also a good option for our user case ]
As the lecture ( Linux Primer 100c installation process) under the course of Linux Deep Dive, has covered the installation of Ubnut/centos using VirtualBox, we will learn how to install CentOS 9 [ aka stream ] using Virtualbox on Windows and UTM on Mac:
Installing CentOS-Stream 9 on windows using VirtualBox
So if you are using Windows and want a free virtualization option then Virtualbox is a good option. So, here’s the steps to follow for that:
- Download the CentOS 9 ISO: You can download the CentOS-Stream 9 ISO from this link.
- Download VirtualBox from the official site: https://www.virtualbox.org/ and run the installer.
- Create a New Virtual Machine for CentOS Stream 9:
- Open VirtualBox and click New to create a new VM.
- Name the VM (e.g., “CentOS Stream 9”).
- Type: Select Linux.
- Version: Choose Red Hat (64-bit) (CentOS Stream is derived from Red Hat).
- Memory Size: Allocate at least 2 GB of RAM (2048 MB). For better performance, you may allocate more if your system allows.
- Hard Disk:
- Select Create a virtual hard disk now.
- Choose VDI (VirtualBox Disk Image).
- Set storage to Dynamically allocated (this allows the disk to grow as needed).
- Specify at least 20 GB for the virtual hard disk.
- Configure VM Settings: Before starting the VM, you should adjust a few settings:
- System:
- Go to the System tab.
- Under the Processor tab, allocate at least 2 CPU cores (if available).
- Under the Motherboard tab, ensure Enable EFI is checked if CentOS requires UEFI.
- Display:
- Allocate at least 16 MB of Video Memory (increase if using a GUI).
- Storage:
- Under Controller: IDE, click Empty, then click the CD icon and choose Choose a disk file.
- Select the CentOS Stream 9 ISO you downloaded earlier.
- Network:
- Ensure Adapter 1 is attached to NAT for internet access.
- You can change this to Bridged Adapter if you want the VM to be accessible on the same network as your host.
- System:
- Boot the Virtual Machine: Click on Start to boot the VM and then select Install CentOS Stream 9 from the menu.
- Installing CentOS Stream 9: First, choose language, leave the selection of automatic partitioning, select Server with GUI for software selection, also set a root password, and finally click on Begin Installation.
- Post-Installation Setup
- After installation is complete, the system will prompt you to reboot.
- Before rebooting, remove the CentOS Stream ISO from the virtual CD drive in VirtualBox by going to Devices > Optical Drives > Remove Disk from Virtual Drive.
- Reboot the system.
Installing CentOS-Stream 9 on Mac using UTM
Now let’s come to the MacOS, so if you are using MacOS then in my experience the UTM is the best option as it uses QEMU under the hood. I’ll include a video for that later.
So let’s see how we can install cetnOS 9 on macOS using UTM:
- Download CentOS Stream 9 ISO: Follow the above-mentioned method to download the CentOS Stream 9 ISO file.
- Install UTM on macOS:
- Download UTM for Mac from its official website
- Install UTM by dragging it to the Applications folder.
- Create a New Virtual Machine in UTM
- Open UTM and click the + button to create a new VM
- Select Virtualize for better performance, especially if you’re using an Apple Silicon Mac
- Configure the Virtual Machine for CentOS Stream 9:
- Provide a name for your VM
- Under Architecture, select x86_64 if you are using intel mac and choose aarch64 for apple silicon.
- Allocate at least 2 GB of RAM, allocate more RAM for better performance if you have.
- In hardware: Allocate 2 CPU cores ( or more if you have), and add a new hard disk with at least 20 GB of storage for the installation.
- Under the CD/DVD Drive section, select the CentOS Stream 9 ISO you downloaded earlier ( click browse locate the ISO file on your system, and select it).
- For Network, Use the default Emulated Network Adapter to provide internet access for the VM through your host machine.
- Start the VM and Install CentOS Stream 9 ( by following the steps as we discussed earlier )
Finally here are three commands to upgrade to CentOS-Stream from centOS linux,run these commands with root privileges to perform the migration ( its always recommended to take a backup of your system):
dnf install -y centos-release-stream
dnf swap -y centos-{linux,stream}-repos
dnf distro-sync -y
Key Takeaways:
We are done with the installation of Linux. Here are the key takeaways:
Linux Advantages: Open source, secure, versatile, customizable, privacy-focused, and widely used in enterprise environments.
Popular Distributions: Ubuntu (user-friendly), Fedora (cutting-edge), Linux Mint (Windows-like), RHEL (commercial), CentOS (formerly free RHEL alternative, now CentOS Stream).
Installation Platforms: Desktops/laptops (replace or dual boot), servers, and virtual environments.
Server Installation Options:
- Single Boot
- Dual Boot
- Headless
- Virtualization (e.g., VirtualBox, UTM)
- Containers (e.g., Docker)
CentOS Stream 9 Installation:
- Windows (VirtualBox): Download ISO, create VM (2 GB RAM, 20 GB disk), configure settings, install CentOS, remove ISO post-install.
- macOS (UTM): Download ISO, install UTM, create VM (2 GB RAM, 20 GB disk, x86_64 or aarch64), configure settings, install CentOS.
Upgrading from CentOS Linux:
dnf install -y centos-release-stream
dnf swap -y centos-{linux,stream}-repos
dns distro-sunc -y