Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Install VirtualBox legacy version 5.x on CentOS 7

Rumi, June 11, 2022

Install Dependencies

Install Extra Packages for Enterprise Linux (EPEL)

# sudo yum install epel-release wget -y

Install Dynamic Kernel Module Support (DKMS)

# sudo yum --enablerepo=epel install dkms -y

This will install quite a few packages:

Install Development Tools

# sudo yum groupinstall "Development Tools" -y

Install Kernel Development

# sudo yum install kernel-devel -y

Install VirtualBox by adding the VirtualBox package repository

# cd /etc/yum.repos.d
# sudo wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

Install VirtualBox

# sudo yum install VirtualBox-5.0 -y

This will also install a number of dependencies.

Install VirtualBox Extension Pack

The VirtualBox Extension Pack will add support for the following:

  • USB 2.0 and USB 3.0 Host Controller
  • Host Webcam
  • VirtualBox RDP
  • PXE ROM
  • Disk Encryption
  • NVMe

Download the extension pack:

# sudo wget http://download.virtualbox.org/virtualbox/5.2.6/Oracle_VM_VirtualBox_Extension_Pack-5.2.6-120293.vbox-extpack

Once downloaded, install the extension pack:

# sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.6-120293.vbox-extpack

OR, if you are upgrading from a previous version of the extension pack, then you will need to add the ‘–replace’ option to uninstall the old version first.

# sudo VBoxManage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-5.2.6-120293.vbox-extpack

Agree to the license terms and conditions.

Do you agree to these license terms and conditions (y/n)? y

The extension will be installed.

Verify that the extension pack has been installed successfully.

# sudo VBoxManage list extpacks

You should see output like the following:

Add Users to ‘vboxusers’ Group

When VirtualBox is installed a new group ‘vboxusers’ is created. Users that are a member of this group will be allowed to run VirtualBox. I will add my non-privileged user to this group.

adduser vbox
passwd vbox
# sudo usermod -a -G vboxusers vbox

Create the file /etc/default/virtualbox and put the line

VBOXWEB_USER=vbox

Check that the vboxdrv service has installed correctly and is running.

# sudo systemctl status vboxdrv

You should see output like the following:

The status should be ‘loaded‘ and ‘active‘. If you see a ‘Kernel driver not installed‘ message then try running the following command:

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

VirtualBox Web Service (vboxweb)

Check that the vboxweb service is running:

# sudo systemctl status vboxweb-service

You should see output like the following:

Exclusive Hardware Virtualization

VirtualBox will be given exclusive use of the hardware virtualization extensions (Intel VT-x or AMD-V). I think this defaults to on but let’s set it anyway.

# VBoxManage setproperty hwvirtexclusive on

Default Front End

I am not running a GUI on this server so all virtual machines will be running in headless mode.

# VBoxManage setproperty defaultfrontend headless

Install PHPVirtualbox:

Start with installing LAMP Stack

 yum install httpd

If you have firewalld running use the firewall policy update:

# firewall-cmd --permanent --add-service=http
# systemctl restart firewalld# firewall-cmd --state
# firewall-cmd --list-all
# firewall-cmd --list-interfaces
# firewall-cmd --get-service
# firewall-cmd --query-service service_name
# firewall-cmd --add-port=8080/tcp

Install PHP (default 5.4 on a CentOS 7 is fine to run phpvirtualbox)

# yum install php php-mysql php-pdo php-gd php-mbstring php-soap php-xml

Now test PHP installation is working properly-

# echo "<?php phpinfo(); ?>" > /var/www/html/info.php
# systemctl restart httpd

Now open browser and type http://<ip>/info.php

Download and Install PHPVirtualbox:

In my case, I’m downloading version 5.0-5

cd /tmp
wget https://github.com/phpvirtualbox/phpvirtualbox/archive/refs/tags/5.0-5.zip
unzip 5.0-5.zip

After that mv the unzipped folder to /var/www/html/<phpvirtualbox>

cd /var/www/html/<phpvirtualbox>

cp config.php-sample config.php

nano config.php

  • update the user and password of vbox.
  • uncomment the console IP

Now point your browser to-

http://<ip>/<phpvirtualbox>

Src:
https://github.com/phpvirtualbox/phpvirtualbox/releases

CentOS running VirtualBox (headless mode)

Install Virtualbox 5.2/6.1 on Ubuntu 16 headless mode


https://www.tecmint.com/install-lamp-in-centos-7/

Administrations Virtualbox Virtualization CentOSCentOS 7virtualbox

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP squid SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin XCP-NG zimbra

Topics

Recent Posts

  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025
  • Mount a drive permanently with fstab in Linux April 16, 2025
  • Proxmox 1:1 NAT routing March 30, 2025
  • Installation steps of WSL – Windows Subsystem for Linux March 8, 2025
  • Enabling Nested Virtualization In Proxmox March 8, 2025
  • How to Modify/Change console/SSH login banner for Proxmox Virtual Environment (Proxmox VE / PVE) March 3, 2025
  • Install Proxmox Backup Server on Debian 12 February 12, 2025

Archives

Top Posts & Pages

  • Install Jitsi on Ubuntu 22.04 / 22.10
©2025 Bots! | WordPress Theme by SuperbThemes