The virtualization makes easy our day a day as software developer, both at development environment as the production environment, among many programs of virtualization existing maybe the most popular is the VirtualBox and all certain it is much simple of to use, therefore this article show how to install it on Fedora 27 and 28.

Add the repository

Before installing we’ll to add the official repository of the VirtualBox and upgrade the operational system.

sudo wget https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo && \
sudo dnf -y upgrade

Install the requirements

Now let’s go to install the requirements.

sudo dnf install -y binutils gcc make patch libgomp glibc-headers \
glibc-devel kernel-headers kernel-devel dkms

Before of go forward execute the command below and verify if your operational system already using the most recent Kernel version.

rpm -qa kernel | sort -V | tail -n 1 | sed s/kernel-// && uname -r

Install the VirtualBox

With the Kernel more recent in use and all requirements installed we can finally install the VirtualBox, at the moment of write of this article the most recent version is the 5.2, so we’ll to install it.

sudo dnf install -y VirtualBox-5.2

Next require to VirtualBox to run the setup.

sudo /usr/lib/virtualbox/vboxdrv.sh setup

Now include your user to VirtualBox user group.

sudo usermod -a -G vboxusers $USER

Extension pack

Optionally you can to install the extension pack of VirtualBox to improve the integration between the virtual machines and the host machine, for this you should to do download of the extension pack compatible with the version of your VirtualBox.

wget https://download.virtualbox.org/virtualbox/5.2.12/Oracle_VM_VirtualBox_Extension_Pack-5.2.12.vbox-extpack

For to install execute the command below, agree the terms of use and then the installation will be done.

sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack*.vbox-extpack

Wrapping up

Now you can to use the operation system that you wish without to install it or use the dual boot directly in your computer, on my case I use the VirtualBox for have a virtual machine with Windows and some others with Linux distributions where I configure the development environment as similar as possible with the production environment.

Resources