How to setup CentOS 9 in VirtualBox

Published: January 28, 2023 (Updated: Jan 28, 2023)

Enjoying this content? Subscribe to the Channel!

Conquering CentOS 9: A Step-by-Step Guide to Installation on VirtualBox

Hello tech enthusiasts and welcome to Darren’s Tech Tutorials! I’m Darren, and I’m thrilled to guide you through setting up one of the most stable and reliable Linux operating systems available today: CentOS 9.

If you’re looking to experiment with enterprise-grade Linux, run development servers, or simply learn more about virtualization without altering your primary operating system, VirtualBox is your perfect tool. It’s free, it’s powerful, and today we are going to use it to install CentOS 9 from scratch. Let’s get started and build your new virtual environment!


Essential Prerequisites: Getting Ready

Before we jump into the installation process, we need to ensure you have the required components downloaded and ready to go.

  1. Oracle VM VirtualBox: Make sure you have the latest version of VirtualBox installed on your host machine (Windows, macOS, or Linux). This software is free and open-source.
  2. CentOS 9 Stream ISO File: You will need the installation disk image for CentOS 9. Download the official ISO file from the CentOS project website. This ISO will act as the “DVD” for your new virtual machine.

Creating Your Virtual Machine Shell

The first step is to create a configuration within VirtualBox that reserves hardware resources for your CentOS installation.

Step 1: Initialize the New VM

  1. Open VirtualBox and click the New button.
  2. Name and OS Type:
    • Name: Give your machine a descriptive name (e.g., CentOS-9-Server).
    • Folder: Choose where to store the VM files.
    • Type: Select Linux.
    • Version: Select Red Hat (64-bit) (since CentOS is a derivative of Red Hat Enterprise Linux).

Step 2: Allocate Resources

For a smooth CentOS 9 experience, we recommend the following minimum specifications:

  1. Memory (RAM): Allocate at least 2048 MB (2 GB) of RAM. If your host machine has plenty of memory, allocating 4 GB is ideal for better performance.
  2. Hard Disk: Select Create a virtual hard disk now. Use the default file type (VDI).
  3. Storage Allocation: Choose Dynamically allocated. This means the virtual disk file will only grow as you use space on the VM, saving space on your host machine initially. Set the disk size to at least 25 GB.

Step 3: Mount the ISO

  1. After creation, select your new VM in the VirtualBox sidebar and click Settings.
  2. Go to the Storage section.
  3. Under the Storage Tree, click the Empty CD icon under the Controller: IDE.
  4. On the right, click the small CD icon next to “Optical Drive” and select Choose a disk file. Navigate to where you saved your CentOS 9 ISO and select it.
  5. Click OK to save the settings.

The CentOS 9 Installation Process

With the VM configured and the ISO mounted, we can now start the installation!

Step 4: Starting the Installation

  1. Select your CentOS VM and click Start.
  2. When prompted, select the option to Test this media & install CentOS Stream 9.

Step 5: Initial Setup Configuration

The graphical installer will load. You will be asked to configure several critical settings from a central screen:

  1. Language: Select your preferred language and click Continue.
  2. Installation Destination: This is the most crucial step. Click this option. Since we only have the single 25 GB virtual drive, select it and choose Automatic partitioning (unless you are an advanced user who needs custom partitions). Click Done.
  3. Root Password and User Creation:
    • Click Root Password and set a strong password for the system administrator account.
    • Click User Creation and set up a standard user account for daily use.

Step 6: Configure Networking

CentOS 9 needs to be able to talk to the outside world!

  1. Click on Network & Host Name.
  2. On the adapter shown (usually enp0s3), toggle the switch in the upper right from OFF to ON. If you are using VirtualBox’s default NAT setup, the VM should instantly receive an IP address.
  3. Set your desired Host Name at the bottom (e.g., centos9-test).
  4. Click Done.

Step 7: Begin the Install

Once all required items (marked by warning icons) have been addressed, the Begin Installation button will activate. Click it!

The installation process will now copy files and configure the system. This may take 10 to 20 minutes depending on your host machine’s speed.

Step 8: Reboot and Finalize

  1. Once installation is complete, click Reboot System.
  2. Important: After the VM shuts down, go back to Settings > Storage and eject the CentOS ISO file. If you don’t remove the ISO, the VM might boot back into the installer instead of the installed operating system.
  3. Start the VM again. You will be greeted by the CentOS login screen! Log in with the user account you created.

Conclusion: CentOS 9, Ready to Explore!

Congratulations! You have successfully installed a highly stable and reliable CentOS 9 instance within the free and flexible environment of VirtualBox.

This new virtual server is now a powerful asset for running web servers, testing configurations, or mastering essential Linux commands. You have full control over a robust, virtualized operating system without risking changes to your main computer.

If this step-by-step guide helped you conquer virtualization today, please smash that Like button, subscribe to Darren’s Tech Tutorials for more crystal-clear guides, and let me know in the comments below what project you plan to tackle first with your new CentOS 9 machine! Happy virtualizing!