Une erreur s'est produite.

L'erreur a été envoyée par e-mail à l'administrateur pour analyse.

How do I try CentOS 7 Linux without replacing my operating system?

Try CentOS 7 on a VirtualBox virtual machine.

Hello, my name is Christopher Tate. I am a Red Hat consultant and I love open source software. I will help you create your own successful website, on your own computer, using open-source software.

Is it possible to try Linux without destroying my operating system?

Virtualization can run Linux on any operating system.

Thanks to virtualization, trying out operating systems on your own computer is simple! Virtualization allows you to run virtual machines. Virtual machines are entire operating systems running under your own operating system through software. Virtualization is free, thanks to many good software packages! For Linux I recommend Libvirt for more power, but for a cross-platform solution, we will be using VirtualBox in this lesson. I'll teach you how to get a CentOS 7 virtual machine running on your system.

How do I install VirtualBox for virtualization?

Simply download it from virtualbox.org.

  1. VirtualBox is easy to download and install.
  2. Visit this url: https://www.virtualbox.org/wiki/Downloads
  3. You can download it on a Windows host, an OS X host, a Linux or Solaris host.
  4. Because I am running CentOS 7, which is similar to RHEL, I will use the RHEL instructions at the very bottom of the page.

How can I prepare CentOS 7 to install VirtualBox?

Install the virtualbox yum repo

wget https://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /tmp/virtualbox.repo
  1. The command to download files.
  2. The URL to the VirtualBox yum repository download file.
  3. For specifying the output path for the downloaded file.
  4. The output path for the downloaded yum repository file.

How can I install the virtualbox yum repository?

Put virtualbox.repo in /etc/yum.repos.d/.

sudo mv /tmp/virtualbox.repo /etc/yum.repos.d/
  1. The command to install yum repositories begins with the command sudo. The "sudo" command allows your current user to have root privileges for a few minutes after entering your password. Installing yum repositories always requires root privileges.
  2. For moving files to new locations in the filesystem.
  3. The path to the downloaded yum repository file.
  4. The directory for configured yum repositories.

How do I know what the VirtualBox package is called?

Search for \"virtualbox\" in yum.

sudo yum search virtualbox
  1. sudo
  2. Which stands for "Yellowdog Updater Modified", but nobody knows it as yellowdog, just yum. CentOS manages software packages and RPM application files with yum.
  3. For searching for available yum packages.
  4. A phrase to search for in the yum repositories, like "virtualbox".

How do I now install the VirtualBox application?

Install the package with yum.

sudo yum install -y VirtualBox-5.2
  1. sudo
  2. yum
  3. For installing new yum packages.
  4. Suppress messages asking to confirm if you want to install the software.
  5. The package name of VirtualBox you wish to install. You can use the package name before the ".x86_64" from the yum search you did earlier. For me it is "VirtualBox-5.2".

How do I put an operating system on a VirtualBox virtual machine?

Download an ISO file.

wget http://mirrors.xmission.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso -O ~/Downloads/CentOS-7-x86_64-DVD-1810.iso
  1. wget
  2. The URL to the CentOS 7 ISO file to download.
  3. -O
  4. The output path for the downloaded CentOS 7 ISO file.

You can download the latest CentOS 7 ISO file to install on a new virtual machine here https://www.centos.org/download/. Click on the [ DVD ISO ] button. You can choose from any of the mirrors, you might find one close to you. You can also download the file using the wget command in the terminal like that.

How do I know that my ISO download is complete?

Check the sha256sum.

sha256sum ~/Downloads/CentOS-7-x86_64-DVD-1810.iso
  1. Compute and check the SHA256 message digest for a file.
  2. The path to the downloaded CentOS 7 ISO file.

You can see the documented sha256sum of the download in the release notes for your version of CentOS 7, see https://wiki.centos.org/Manuals/ReleaseNotes. If yours is the latest version, then click on "Release Notes for CentOS 7". Otherwise, find your version in the links in the release notes. Where it says "Verifying Downloaded Installation Images", you will also see the sha256sums for all versions. Notice the sha256sum for CentOS-7-x86_64-DVD-1708.iso, and then perform the command and compare.

How do I create a CentOS 7 virtual machine in VirtualBox?

Open up VirtualBox and click [ New ].

  1. Open VirtualBox in your installed applications.
  2. Click [ New ].
  3. Donnez un nom à votre machine virtuelle, comme « mv1 ».
  4. Type: Linux
  5. Version: Other Linux (64-bit)
  6. Click [ Next > ].
  7. Now you can give your virtual machine as much RAM as you want. This can be changed later. I would recommend at least 4096 MiB.
  8. Click [ Next > ].
  9. Now you will create a disk file for your virtual machine. You can select the default option "Create a virtual hard disk now".
  10. Click [ Create ].
  11. Now you can choose from a few different disk types. I would recommend "VMDK (Virtual Machine Disk)" which is more portable to other hypervisor software like libvirt.
  12. Here I would recommend a "Dynamically allocated" disk, that will will start out as a small file and will grow as it is used.
  13. Here you can leave the name of the disk as the hostname you gave to the virtual machine. You can also choose the size of the virtual machine disk. I would recommend at least 108 GB, since the disk file does not take up that much space, unless it grows to be that big if it is dynamically allocated.
  14. Click [ Create ].
  15. Now your virtual machine is created! The next step is to assign and ISO to it as an optical disk drive. Right-click on the virtual machine in VirtualBox.
  16. Click "Settings..."
  17. Click [ Storage ].
  18. Click the optical drive named "Empty".
  19. In the optical drive attributes, click the disk button with the dropdown arrow.
  20. Click "Choose Virtual Optical Disk File...".
  21. Browse to the CentOS 7 ISO file in your downloads: ~/Downloads/CentOS-7-x86_64-DVD-1810.iso
  22. Click [ OK ].
  23. Now click [ Start ].

What if I get an error? Kernel driver not installed (rc=-1908)

Install the right linux kernel prerequisites.

If you are running CentOS 7, you may get an error when starting your virtual machine:

VirtualBox - Error In suplibOsInit

Kernel driver not installed (rc=-1908)

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

'/sbin/vboxconfig'

as root.

where: suplib0slnit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned EN0ENT.

sudo /sbin/vboxconfig
  1. sudo
  2. Linux post-installer for building VirtualBox kernel modules. This will fail if the kernel-devel prerequisites have not been installed.

Another error will occur when running this command here.

vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-3.10.0-693.el7.x86_64
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
kernel-devel kernel-devel-3.10.0-693.el7.x86_64

So you will want to read carefully in the error message you receive for the specific packages you need to install to fix the problem as below.

sudo yum install -y kernel-devel kernel-devel-3.10.0-693.el7.x86_64
  1. sudo
  2. yum
  3. install
  4. -y
  5. The development package for building kernel modules to match the kernel.
  6. Be aware that this version may be different for your system. You will want to install the version that this command recommended earlier: sudo /sbin/vboxconfig
sudo /sbin/vboxconfig
  1. sudo
  2. Run this again with the kernel-devel prerequisites installed.

Here, when you run this command again, you should no longer have an error message.

Now, return to VirtualBox and click [ Start ].

To review:

Tuesday
April 23 2019 How to try CentOS 7 On a virtual machine By Christopher Tate
Questions Answers
Will Linux destroy my operating system? Virtualization can run Linux on any operating system.
How do I install VirtualBox? Download it from virtualbox.org
Prepare CentOS 7 to install VirtualBox Install the virtualbox yum repo
Install the virtualbox yum repository Put virtualbox.repo in /etc/yum.repos.d/
What is the VirtualBox package called? Search for "virtualbox" in yum
Installing VirtualBox Install the package with yum
How to put an operating system on a virtual machine Download an ISO file
Verify ISO download Check the sha256sum
How do I create the virtual machine? Open up VirtualBox and click New
Kernel driver not installed error Install kernel prerequisites

Previous and next articles.

Don't give up on your dreams. You can do hard things!

Share this story.

Let's get connected.
Up to the top.