In this lecture I’ll show you how to install CentOS in a VirtualMachine. The first step is to download 1
CentOS iso file from the oficial CentOS Website. 2
I'm installing the latest version of CentOS, which is 8 at the moment, and I’ll select a mirror server 3
that is geographically closer to me. 4
These servers act like backup servers and provide fault-tolerance and availability. And I'm downloading 5
the ISO file. 6
You can download the DVD file, which contains all the applications or a smaller one, the boot file. 7
I'm downloading the boot iso file. 8
In fact, I've already downloaded the file to save time, and now it's on my desktop. 9
The next step is to start VirtualBox. 10
I suppose you've already installed it. 11
I've shown you how to do it when we have installed Ubuntu. If, for some reason, you don't have it, just 12
go to virtualbox.org 13
click the Downloads link 14
and then download and install Virtual Box for your platform. 15
The installation is very simple and there is no point to show you this at the moment; download and 16
install a VirtualBox Extension Pack as well. 17
This is provided as a single file for all platforms. 18
Let's return to CentOS installation; go to machine and click "new". 19
This will create a new virtual machine, give it a relevant name like CentOS8. 20
Set its type to Linux and version to RedHat 64 bit. 21
I'm clicking next. 22
In this window select the amount of RAM that will be used by CentOS. The recommended size is 2 23
GB, but the more you can give, the better it will be. 24
Now it's time to create a virtual disk. This serves as the hard disk of the virtual Linux system. 25
It is where CentOS will store its files and it's completely isolated in a single disk file; click 26
"create" and leave the default selection for the hard disk file and type. 27
In this step, leave the default selection, which is “Dynamically Allocated”. The disk file will only 28
use space on your physical hard disk as it fills up to the maximum fixed size you'll be setting up in 29
the next step. 30
Now it's time to select file location and size. 31
I recommend you to use 20 GB. 32
If possible, for maximum performance, the location should be on an SSD disk. 33
I'll leave the default location and click "create". 34
Now it's time to boot the ISO file we've just downloaded and install a CentO as a virtual operating system. 35
I'm clicking the "start" icon and then selecting the start-up file, which is the iso file. 36
I'll browse to its location on my Desktop by clicking the folder icon. 37
In this window I'm clicking "Add" and I'm going to my desktop to selected. 38
The iso file was selected and I'm clicking “Choose”. And “start”. 39
It has started and in a few seconds, you'll be presented with the GRUB menu and some options. 40
I'm selecting the first option, which is install CentOS Linux 8; after hitting enter, it's possible 41
to get an error. If you get this error, which is related to AMD-V or VT-X while trying to start the 42
VM, it means that the virtualization or VT-X is disabled in your computer 43
BIOS. Reboot your system and and access the BIOS settings,using a function key that is specific for your computer 44
or laptop model. 45
Look for something related to virtualization or VT-X and enable it; save the settings, restart the 46
system and then start the VM again. 47
Let's return to theCentOS installation. I'm hitting enter. 48
Note that when you click somewhere in CentOS, the mouse pointer will be captured by the guest OS. To 49
return the ownership of the mouse to your host OS, VirtualBox reserves a special key, the hostkey. 50
By default 51
this is the right control key on your keyboard. 52
So to release the mouse pointer, I have to press on the control key. 53
I'm selecting the language and I'm clicking continue. 54
In the next window, a summary of the installation is displayed. 55
Before continuing, I have to complete the items marked with this exclamation mark icon. 56
I'm clicking the installation destination, selecting the virtual hard drive 57
and leaving the storage configuration to its default values, 58
so to automatic. 59
And I'm clicking "done". 60
Next, I'll set the network, so I'm clicking the “Network and Hostname”. 61
In this window, I'm enabling the network interface, which at least in my case, was disabled. 62
Now it's on. 63
I’ll also change the hostname to centos8. 64
I’m clicking "Apply" and "Done". 65
Next, I click the “Software selection”. 66
If you want to install the CentOS server with a graphical user interface, then you don’t have to do anything 67
else. 68
But, if you want to install CentOS 8 as a headless server or without a GUI , select the second option, 69
this one. 70
I'd recommend you to leave it as it is. 71
And I'm clicking "done". 72
Great. 73
There is no exclamation mark, I can begin the installation. 74
If you want to make other changes, like setting up the time and date, now is the time to do it. 75
I'm done, so I click on "begin installation". 76
The installation has started and I have to set the root password and another non-privileged user. I'm 77
setting the root password. 78
And I'm creating a new non privileged user. 79
This is, in fact, the user that will be used to log into the system. 80
Type is full name, username and his password. 81
I'd recommend you to select this option as well: "make this user administrator". 82
And I'm done. 83
The installation is still running. 84
It will take a few minutes, maybe more than 10, depending on your hardware and Internet speed; it's 85
downloading a lot of software. 86
I'm pausing the recording until it's done. 87
And it's done, I'm rebooting it. 88
After a successful installation, we need to restart the virtual machine. The ISO file used for installation 89
was mounted on an optical drive or a CD ROM. 90
This time we don't need the ISO file inserted in the optical drive and I don't want it to boot up from 91
that file again. 92
So go to devices, optical drives 93
and remove disk from virtual drive. 94
If it says "that's currently busy", then go ahead and force it to unmount. 95
Restart the VM by going to Machine > Reset. 96
Start the VM again and It should properly boot into the new CentOS 8. Now it's booting into the new operating 97
system. 98
At the first boot you have to accept the license. 99
The distribution was released under GPLv2 license, which means it's completely free. 100
I accept the license agreement and finish the configuration. 101
And I'll be greeted with the welcome screen of CentOS. 102
I’m logging in using the username created during installation. 103
It will prompt you for some configuration like language, privacy and so on. 104
Just click on "next" a few times. 105
After that, it should display your desktop. 106
Great! The network card is put into NAT mode so I can access the Internet, as well. 107
I'm opening Firefox. 108
Let's see if I can access CentOS.org and it's working. 109
I have an active Internet connection. 110
If it's not working 111
check that your network interface is set to connect automatically; go to these top arrow 112
wired connected, wired settings 113
and check that the wired interface is connected and set to connect automatically at boot time. 114
Great, you now have a very nice Linux server distribution, running.