How to Install CentOS 8 on Virtual Machine | Linux Tutorial For Beginners Part-2 | Intellipaat

To Your Future Endeavors
26 followers
28 Video Views·Oct 21, 2022
Hello guys, welcome to yet another Linux session by Intellipaat.
Linux is technically not a desktop operating system, but a kernel.
And as per our last discussion, the kernel is part of your computer.
The kernel is the reason text appears when you type.
The cursor moves when you stroke the touchpad and images appear on your monitor.
In the early days of computing, programmers freely shared codes and programs.
This started to change when corporate entities like IBM, Apple, and Microsoft
started to release copyrighted codes that users couldn't view.
In response to that, the GNU project was formed,
which eventually gave rise to the incarnation of Linux.
And today, with this particular session, we are going to learn how you can install
CentOS 8 distribution of Linux on your respective systems.
But before we do that, make sure that you guys enable both subscribe button and bell icon so
that you never miss any interesting update from Intellipaat YouTube channel.
That being said, let's get started with our session.
Hey guys, welcome to this Linux course.
So in this session, we'll be learning how to install CentOS 8 on a virtual machine.
The first, let us look at the prerequisites to do this.
And then let us get started with the installation process.
So first, let me open the browser.
So the first thing you'll have to download is the ISO file.
So if you just type in download CentOS 8 ISO, you will get the centos.org page,
or you can just go type in www.centos.org slash download, and you will get the page.
So you have two buttons, go to CentOS Linux DVD ISO, and then you'll get a list of mirrors.
So you can click on any link and it'll start downloading.
So if any link is not working, you can check the other link.
So it's a 7 GB file, so download it before.
So once this is done, so while it is downloading, you can also download and install Oracle VirtualBox.
So Oracle VirtualBox is the tool which you're going to use to virtualize
the operating system on top of my Windows operating system.
So now, once you open virtualbox.org, you will just have to click on this button
and you will be given a list of options.
So I'll show that.
The options would be Windows, OSX, Linux distributions, and so on.
If your PC is a Windows operating system, click on Windows hosts,
and a .exe file will be downloading which you can use to install it.
And then if your PC is a Mac, if you have OSX in it, then use this.
And if you have any Linux distributions running on your system,
let's say Ubuntu and you want to install Oracle VirtualBox on Ubuntu,
then you can click on Linux distributions and you can check out the options you have and choose it.
If you have Debian, you can choose it.
Fedora, you can choose it.
CentOS also, you can choose it.
So accordingly, you can choose it and download it.
So for me, it's Windows, so I've already downloaded it and installed it.
So once you click on it, it will start downloading.
So once it's downloaded, it's like installing a normal software.
Just click on next and finish it.
So once it's done, you will get a desktop icon like this.
Oracle VM VirtualBox.
So once you got that, open it.
So let's assume right now you have already downloaded the ISO file
because I already have the ISO file.
And yeah, so this is how the VM will look.
You can see already I have a virtual machine running.
So let me explain to you from the start how to install it.
So the first thing you'll have to do is click on new because we are creating a new virtual machine.
So for the new virtual machine, you'll have to provide new virtual machine configuration.
So my operating system is Cent.
So I'm going to give CentOS 8.
And you can see the change automatically happening here.
Linux Red Hat.
If I just type in Windows over here, it will automatically change to Windows.
So that you'll have to look into it.
And one more thing, sometimes you'll not get the 64-bit icon.
You'll only get the 32-bit option.
So what you'll have to do is you'll have to go to your BIOS settings.
In BIOS, you'll have to go to security.
Under security, you will have a virtualization option.
Then you enable it and then start your PC normally.
And then you will get the 64-bit option.
So once that's done, next.
And I'm going to give 3 GB of memory while it's running.
Or I'll just give 4 GB of memory.
Why to risk it?
Because anyway, I'm going to use this virtual machine for the entire course.
So I'm going to give 4 GB.
So then you'll have to create a virtual hard disk.
So once I've created, clicked on create, you'll have three options.
Virtual box disk image, virtual hard disk, virtual machine disk.
As we are going to use virtual box to run our virtual machine,
you can choose virtual box disk image and click on next.
And then again, two options, dynamically allocated and fixed size.
Dynamically allocated is when there is only increase in the size.
When there is a need for memory, it will allocate it.
If there is no need for the memory, that memory will be free.
Even the Windows system can use it.
My already installed operating system on my PC can use it.
Typically fixed size, the size which you have mentioned will be fixed already.
That memory will not be free.
That memory will be occupied.
So that memory can be only used by the CentOS.
It cannot be used by the Windows operating system.
So it is suggested to use the dynamically allocated option.
So go ahead with that and then choose the size.
8 GB, I won't suggest to go with 8 GB.
Go with 40 to 50 GB of space so that your CentOS can run smoothly.
Because CentOS installs a lot of applications.
It installs a lot of bytes.
So it needs a lot of space itself.
So once that is installed, there needs to be a lot of space,
extra space so that you can run your operating system smoothly.
So I'm going to choose it and I'm going to create it.
So now the launch configuration is done.
So the next step is to use the ISO file to launch the virtual machine.
So now go to settings.
Go to storage.
You can see the virtual box disk image is already mounted.
And now you'll have to mount the ISO file here.
So to mount the ISO file, click on empty.
Go to the CD icon.
Click on choose a disk file and you get options over here.
So I'm going to select an ISO file.
I'm going to click on open and click OK.
So now I have provided the ISO file and the state.
So now the option is to click on start.
So once you've done that, you will get a pop-up.
You'll get a prompt over here, which will be running the virtual machine in it.
And first, you'll have to start it.
Once you've started it, so sometimes there will be this mouse issue.
So just go ahead and click on install CentOS.
I'm not doing anything actually.
I'm just trying to integrate mouse.
So now once the install is starting, the first option you will see is the language choosing
option.
So once that is given, you'll have to choose the language accordingly and then proceed.
You can see the language option over here.
So now you'll have to select it.
Continue.
So this mouse problem will prevail a lot.
So now first choose the language and then click on continue.
I'm fine with English, so I'm just going to click on continue.
So as it is a virtual machine, it'll be a little slow.
So you can see the click has been initiated, but it will take some time.
Right now, you can see one thing that the box is not proper.
So it is out of space or something.
But once you've installed it, you'll have to install some guest installations.
Only if you do that, basically you can do other operations.
So until then, you will have to adjust with the small screen.
So once you've installed those guest installations, then your monitor will become a bigger one.
So it'll cover the whole screen.
So now you'll have to select the size.
Sorry, the standard disks.
So we have created one.
So I'm going to just go ahead with that.
Just click on done.
Once you know that is the disk you are going to choose.
So the thing is selected, done.
So now once that is done, you will get the begin installation button.
Click on it.
Then first give a root password.
And if you want, it's suggested to give a strong password.
But I'm going to give a simpler one for me to remember it.
If it is a simpler password, it'll ask for you to click on done twice.
So once that is done, then create a user.
So I'm going to create a user named as Intellipaat.
I'm going to make this user administrator, that is root.
And I'm going to give the same password.
And I'm going to just click on done.
So again, you'll have to, if it is a simple password,
you'll have to click on create twice.
Once you click on done twice, it'll take some time to complete this process.
So once this is going, once this is completed,
then we will have to basically remove the disk and then reboot the system.
So we'll have to wait right now.
And now you can see it is complete.
The configuration installation part is complete.
Now your next step is to reboot and just login into the system.
But before doing that, go to hit right control.
So basically, you can see this mouse inside.
If you hit right control button, it'll take your mouse out of the virtual box.
So once that is done, go to your virtual box, go to settings.
Now remove this ISO file by right clicking on it
or just go here and remove this from virtual disk.
Now click on OK.
So it's done.
So guys, now go back to your virtual machine and now click on the button reboot.
So now once it reboots,
if that disk is already attached to this particular virtual machine,
then it'll again show you the install window install CentOS 8 Linux.
It'll show that window, but we don't want that window.
So first remove your ISO file and then reboot it.
So right now, this particular installation's configurations
are stored in the storage which we created, the virtual hard disk.
So once you remove the ISO file,
it will take the configurations from that storage space
and start using that for booting the system.
So now it will boot the system.
And once it's booted, you will see the username,
which you can click and log into the system.
So now we'll have to wait until it gets booted because it's the first boot.
So it'll take some time to start up the system.
So let's wait for that.
Or if you think this will take time, you can do one more thing.
You can just click here, power off the machine.
So once it's done, you can again start the machine.
So it's the same thing, but now you can see it is showing me two options.
So it has installed CentOS Linux in my system.
So I'm hitting CentOS Linux and I'm opening my system.
Now it will be booting.
It will be booting my system.
So once it's booted, once it's completed, all the processes have run.
So now you can see the loading screen.
So next, after this loading screen, I will see my username over there.
Intellipaat username will be there.
Now I can click on that username and enter my password
and enter into this particular instance.
So now you can see the licensing page.
So click on the license, accept the license agreement
and click on done.
So now the configuration is done.
So right now you will see the opening page.
So now once the processes are done, you will see the opening page
and we can start off with our Linux code because we have installed the system.
After installing it, we'll also have to do a small process,
which is basically installing guest additions.
I've already installed the guest additions in another virtual machine.
I will show you how to do that process.
Once that is done, I'll just use that.
So now you saw the username.
So now I'm entering my password and I'm hitting sign in.
So now you can see it as it's loading.
So it's a little slow because it's the first time again.
It's the first time it's loading, so it'll be a little slow.
But once it's done, after that, it'll be quite fast.
So the thing is right now, our screen is very small.
So with this screen, it's very hard.
It'll be very hard to do all operations and to concentrate.
So to make the screen larger, we should actually install a guest addition.
The virtual box guest addition.
That guest addition will make our systems.
So it'll make this particular system bigger.
So now you can see I've hit the start button.
Now you can see there are some.
There is Firefox, there is files, software, help and terminals.
So I'll just click on terminals and if it is like.
So it opens and basically we have successfully installed our PC.
So now let us go ahead and just set up the basic settings.
So it's English.
Go next.
And it's fine.
It's fine.
Location is fine.
I'm not going to enter any account right now.
So now it's fine.
So right now you can see terminals.
It's opening the help screen.
I don't need this.
So you can see.
Yeah.
So slash home slash Intellipaat because Intellipaat is the username.
And you can see Intellipaat at localhost.
Again, Intellipaat is the username as well as the administrator.
So now our first process is done.
So now the second process is to install guest additions.
So I have a file to install guest additions.
So.
So you can see vbox guest additions over here.
So this is the file for that.
So first you'll have to install all of the software which is required.
And then you'll have to cd into run slash media.
And inside that you will have the username and the files.
And then you'll have to run this particular command.
So once you run this particular command, then it will install.
Then if you reboot the system, you will be able to see the changes.
So now let me go here.
First thing, open your terminal.
And so first you'll have to connect to the internet.
So to connect to the internet, go here the top right.
Click on wired off and click on connect.
So if you have internet in your system, it may be Wi-Fi or Ethernet.
It will automatically connect to it.
So you don't need you don't have any issues.
So now what I'm going to do is, you know, update.
I'm going to become the root user.
Now I'm going to update.
I'll have to enter my password.
Yeah, now I'm the root user.
So I'm going to update my system.
So you can also do dnf update.
You can also do yum update.
So both will work.
So once dnf update is completed, I'll give yum update.
Let's see what happens.
Well, this is happening.
I'll open another tab and then type in yum update.
So yum and dnf are package managers.
So again, here I'll become the root user.
Now again, yum update.
So it is waiting for this particular process to finish so that it can start this.
I'm just going to close this.
I don't need this to happen because I'm already updating it using dnf.
So again, the internet is quite slow.
You can see now it's downloading.
And once it finishes, then we can install every single.
So we can install all of these.
Once all of these, all of this is installed, then we can go ahead.
Now opening it again.
Let it install.
So it will take some time, obviously.
You can see that.
So you saw that it got automatically aborted.
I did not click yes.
So right now I'm going to ignore this because it will take a lot of time.
So now I'm just going to install all the softwares which are required for installing my guest
editor.
So now first, dnf install star.
So it's checking whether it's already installed.
It is already installed.
Next, I'll have to install vzip2.
This is basically to unzip a file.
You can also download this software called unzip.
And then I have to do this.
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
we need to install the latest GIST edition. So once this is complete, we can do that.
As it's a 13 MB file and the internet is quite mediocre, so it's taking some time.
So you'll have to wait until all of these processes are complete.
Once you've installed kernel-devil, then install the kernel-headers.
Then install Perl, GCC, Make, and elf-utils, libel, development.
So you need all these development headers so that you can install the GIST edition.
So make sure you install these before running your GIST edition.
I think kernel-devil is installed, downloaded successfully.
Now it's running the scripts, so now it's installing.
So once the installation is completed, we can install the next software.
So now the installation of kernel-devil is successful.
Next, we'll install the kernel-headers.
Again, this is a 2.7 MB file. Installed size would be 4.6 MB.
Now you can see it's installing. It's quite faster than the last installation
because it was a bigger size and there was a lot of things to install.
So now kernel-headers is completed. Next, we'll have to install Perl
because while installing GIST edition, there will be some Perl scripts running.
You don't need to worry about anything else. You just install these.
Because these are required for us while we are adding the GIST edition.
Because without the GIST edition, it'll be a small screen and it'll be hard for you to work with.
So now even Perl is completed.
Next, we'll have to install GCC.
So you can also install them in a go.
But the thing is, all of these are bigger files and you'll have to enter Y every single time while installing them.
Sometimes you might fail to do that and that will cause your data inconsistency.
So it's better to install them one by one.
If you have a fast internet, it's going to take you lesser time anyway.
So once all of this is done, next we'll have to install make as well.
Once this is done, I'll show you how to install VBox Linux editions.
Once that is done, we'll be set to go with our further processes.
We'll be learning basic Linux commands.
We'll be learning other commands like echo, ls and all.
So right now, let's finish the installation part.
So now even this is complete.
Next, it's make.
It's already installed.
And next, elf-users.
Library elf.
Sorry.
Live elf.
So now, if we install this, then we are perfect to go.
Perfect to go ahead.
Okay.
Now all the softwares are installed.
Everything we need is installed.
So now what we'll have to do is, so I'm going to just exit the root user.
So you'll have to go to run slash media.
So first check whether it is available in your system or not.
So it is not.
So once you install these softwares, the next process for you is
first go out to devices.
Here you have insert guest editions.
CD image.
Click on it.
You'll get an option over here.
So you get this option.
Click on run.
So enter your root password and authenticate it.
So it needs, this particular installer needs all these, sorry,
all these softwares to install this particular guest edition.
It needs Perl, GCC, May, kernel headers, all the latest ones,
tar to untar it, bzip to unzip it.
So it needs all of them.
So right now it is installing the guest editions.
Let it install.
Let's wait.
So it's asking please return, enter return to closest window.
So I've closed it.
So right now I think you will have this particular folder installed.
So yeah, it's installed.
So right now you can see the username inside that.
So if you open this, again, you'll get vbox.
Now open vbox as well.
So inside this, you will get all these files.
And you will be able to see a file named as, you can see here,
vboxlinuxeditions.run.
So you will see that file over here, vboxlinuxeditions.run.
So you'll have to run these files.
So I'm going to run this like this, vboxlinuxeditions.run.
So it has to be run with administrative privileges.
So I'm just going to add a sudo in front and give my password.
So it's uncompressing.
So it's installing a new version.
It already installed while we run it.
But still, I'm just making sure that it's installed properly.
Because while you are running the GUI based one, when you clicked on run,
it would have installed it already.
But still, to make sure I'm installing it again.
So basically, after installing using this particular option, device,
this one, you can basically try rebooting your system
and check whether your system is having a full screen.
But sometimes it might not work.
Sometimes there might be an error.
So make sure that you rerun it yourself.
So once you've done it, once it's successfully installed,
then you're set to go.
Then you can actually restart the system and check.
So it is done.
So right now, guys, let me clear this and reboot the system.
So once we reboot it, once it successfully reboots,
we'll be able to see the changes made.
So yeah, we'll have to wait for it.
So now again, it's running.
But I can control it.
Closing all the other things.
I'm just opening this.
Just keeping it running.
So you can see the loading screen.
Again, it's a little slow.
So as I was telling you,
as this is the first time we are installing some more additions,
now going to VirtualBox,
here in Settings and Storage,
you'll be seeing a Guest Additions.
So you should not remove this.
It should be always with your virtual machine
because only with this Guest Addition,
your particular virtual machine will know that it has to be larger.
So that is the input which that provides.
So do not delete that.
So again, it's still loading.
So we'll have to wait.
So the installation page is opened.
So right now, let me open it.
One more thing, I've already installed everything over here.
It's properly set up.
So the same thing I'm doing with this particular virtual machine.
So we've done everything.
So we've installed the Guest Additions
and we've also installed the software.
So let's end this session right here.
So thank you.
