Oracle VirtualBox on Linux

The VirtualBox application has a GPL license.

Please see the VirtualBox documentation and Download VirtualBox for Linux Hosts. It is most convenient to install VirtualBox using the Yum repository:

cd /etc/yum.repos.d
wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
yum install VirtualBox-6.1

You will want to install Dynamic Kernel Module Support (DKMS) to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next kernel update.

First you must enable the EPEL repository, then:

yum install dkms

Test builds

For the latest kernels, for example for CentOS 8 Stream, it may be necessary to install the VirtualBox Test builds version.

VirtualBox Extension Pack

For support of USB devices, RDP and more within the Virtual Machine, you must first install the Oracle VM VirtualBox Extension Pack, see the page:

You may use the File Manager to open the downloaded file (will open it using VirtualBox), or you can use the command line, see https://www.virtualbox.org/manual/ch08.html#vboxmanage-extpack:

wget http://download.virtualbox.org/virtualbox/XXX/Oracle_VM_VirtualBox_Extension_Pack-xxx.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-xxx.vbox-extpack

You may have to add your shell (/bin/bash, for example) to the /etc/shells file.lBox_Extension_Pack-xxx.vbox-extpack

You may have to add your shell (/bin/bash, for example) to the /etc/shells file.

To list or uninstall Extension Packs see the VBoxManage extpack documentation:

VBoxManage list extpacks
VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"

USB devices on the host are enabled as explained in https://www.virtualbox.org/manual/ch03.html#settings-usb.

Important: Make sure to add the desktop user to the vboxusers group:

usermod -a -G vboxusers <username>

and check the current groups in another GUI window:

groups

Managing VirtualBox users

Important: Make sure to add the desktop user to the vboxusers group:

usermod -a -G vboxusers <username>

The user must re-login to become a member of the vboxusers UNIX group. Then open VirtualBox, go to Settings->USB and enable the USB 2.0 controller. There should not be any error messages about missing USB support!

Resize virtual disk

See the VBoxManage modifymedium documentation:

VBoxManage modifymedium  [disk|dvd|floppy]    <uuid|filename>
                         [--resize <megabytes>|--resizebyte <bytes>]

First you must shut down the guest machine.

For example:

VBoxManage modifymedium Win7Ent32_new.vdi --resize 70000

Now you have to resize the file system inside the guest OS using its storage management tool:

  1. Windows 7: In the Start button search for Disk management.

  2. Windows 10: Right-click the start button and select Disk management.

  3. Right-click on the C: drive and select Extend volume.

  4. In the Extend Volume Wizard select how much you want to extend the disk.

Potential problems:

  • If the Extend volume menu item is greyed out, there is probably not free space immediately following the disk (C:) you are trying to extend. You have to delete or move the volume allocated right after the disk.

  • The Recovery partition may be deleted using diskpart, see https://www.diskpart.com/articles/delete-recovery-partition.html