How to install CentOS 8 using VirtualBox
In this article, I will explain how to install CentOS8 on your host PC using VirtualBox. If you read this article, you’ll be able to build a virtual CentOS 8 machine.
Table of Contents
Step 1: Install VirtualBox
Before we start the installation, we need VirtualBox. If you haven’t downloaded it yet, please reference this article below. It explains how to install VirtualBox on your Mac PC, so you can install VirtualBox following the instruction. If you’re a Windows or Linux user, don’t worry, the installation process is not that different, so you can also reference this article.
How to install VirtualBox on a Mac PC: https://shuhei-blog.work/tools-software/install-virtualbox-macos/
Step2: Download CentOS 8 ISO image file
Now you have VirtualBox installed, so it’s time to begin the installation. First of all, we need the CentOS 8 ISO image file, so the first step is to download it from the CentOS official page. CentOS8 ISO image file is a file that has data of the OS in it. You can download the file from the link below.
Visit this page: https://www.centos.org/download/
Then, click “x86-64”.
Then, choose any mirror sites from the list. This time, I chose the mirror “http://ftp.riken.jp/Linux/centos/8.3.2011/isos/x86_64/“. But if you don’t have this mirror on your list, you shouldn’t choose this one because it takes longer to download the image file. This list depends on your location, so you’ll see a different list if you don’t live in Japan. But it’s OK, you can just choose any mirrors from your list.
Once you visit the mirror site, you’ll see another list like the image below. Choose the file “CentOS-8.xxxxx 64-dvd1.iso”, and download the ISO image file. This file is 8.6GB, so it takes a while to download.
Step3: build a CentOS 8 virtual machine on VirtualBox
Now we have the CentOS ISO image file, so let’s build a CentOS virtual machine on VirtualBox. First, launch VirtualBox from the Launchpad.
Then, a VirtualBox window will appear. Click the
New button at the top right.
Set the name of the virtual machine. You can choose any name you like. Then, choose the Type:
Linux, and Version:
Red Hat(64-bit). Once you finished the configuration, click
Next, you need to choose the memory size of this virtual machine. This depends on your PC’s performance, here I set the memory to be 4096MB(4GB). The larger the memory size, the more performance the virtual machine will have. But if you give too much memory to the virtual machine, it will degrade your host PC’s performance. Click
Continue after you set the memory size.
Next, we configure the hard disk of this virtual machine. Just keep the default setting and click
Again, just click
Here you can choose the type of hard disk. If you choose a
dynamically allocated hard disk, the virtual machine won’t occupy the unused space, so this can save the host PC’s disk space. If you choose a
fixed size hard disk, the virtual machine will occupy the specified disk space anyway, but it’s usually faster than the dynamically allocated hard disk. I recommend choosing the dynamically allocated hard disk because it can save disk space. Also, we can increase the size of the dynamically allocated hard disk after the installation, while we can’t change the size of the fixed size hard disk once we initialized the virtual machine.
Configure the size of the virtual hard disk. Here I set 50GB. Click
Create once you finished the configuration.
Now we could set up a CentOS 8 virtual machine! You can see your virtual machine on the left side of the window.
But we have a few more things to configure. First, go to
Processor. If you want to use more than 1 CPU, you can allocate them here.
Next, go to
Network. Choose Attached to:
Next, go to
Storage. From the list on the left side, choose
Empty. Then you will see a disk icon on the right side, so click that icon and choose
Choose a disk file... . Then choose the ISO image file you downloaded in step1. After you set the ISO image file, click
Step4: Boot the virtual machine and begin the installation
Now we finished all the virtual machine configurations. So it’s time to boot the virtual machine and install CentOS 8 in it.
Choose the CentOS 8 virtual machine from the list, then click the
If you see a window shown in the image below, just click cancel.
Once you click the start button, the CentOS 8 virtual machine will be running in a new window. You can start installation using this window.
When you click the window, the cursor will be occupied by the virtual machine. If you want to come back to the host PC, click the left ⌘ key if you’re using Mac PC. If you’re using Windows or Linux PC, click the
right Ctrl key.
First, change the resolution of the display. The default resolution is a little bit too small so I couldn’t see the whole screen. Click the tab and then you will see a command at the bottom of the screen.
Modify the last part of the command.
Here I set the resolution to be 1280×800, but you can set any resolution you like. Then click Enter, and the installation begins.
Choose the language, and click
Next, go to
We need to visit this page at least once before the installation but we don’t need to change any configuration here. So just click the
Done button and go back to the top page.
Next, go to the
Network & Host Name page.
Turn on the Ethernet(enp0s3), and click the Done button.
Then, go to
Set the root password, and click the
And if you want to create a user, you can do this from
User Creation page.
Now we’re ready to install CentOS 8, click the
Begin Installation button. This process takes a while.
When the installation finished, click the Reboot System button. The virtual machine reboots, and you’ll see the install setup window again. Go to
Check the agreement checkbox, and click
Then, the system reboots again, and you’ll see the Welcome page.
Congratulations! Now you could successfully install CentOS 8 on your virtual machine. Follow the instruction and set up your desktop, then you can explore and enjoy CentOS 8!