How to Install VirtualBox 5.2 on CentOS 7

tiny丶發表於2018-09-05

VirtualBox is a free and open-source virtualization software for x86 hardware. It is available for both Windows and Linux like operating system, it is one the most popular virtualization software used at Desktop level. VirtualBox provides a Graphical User interface (GUI) through which we can create and manage virtual machines, apart from this we can also create Snapshots of VMs, Cloning of the VMs and can create our own customize network for the VMs.

In this article we will discuss how to install latest version of VirtualBox (VirtualBox-5.1.26) on CentOS 7

Installation Steps of VirtualBox-5.2 on CentOS 7 

Virtualbox rpm package and its dependencies are not available in the default CentOS 7 and RHEL 7 yum repositories, so we have to set virtualbox repository using the beneath command.

[root@linuxtechi ~]# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo -P /etc/yum.repos.d/

Before start installing virtualbox, first we should install all dependencies of virtualbox, some of the dependencies are available in EPEL repository. So let’s first enable epel repository and install the virtualbox dependencies.

Enable EPEL repository and Install all Virtualbox dependencies

[root@linuxtechi ~]# yum install epel-release -y
[root@linuxtechi ~]# yum update -y && reboot
[root@linuxtechi ~]# yum install gcc make patch  dkms qt libgomp kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel  -y

Now Install VirtualBox-5.2 with yum Command

sudo wget -P /etc/yum.repos.d http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
sudo yum install VirtualBox-5.2.x86_64
Once the VirtualBox package is installed then rebuild the kernel modules using the following command.
[root@linuxtechi ~]# /usr/lib/virtualbox/vboxdrv.sh setup
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.
[root@linuxtechi ~]#

Above command will automatically create a group with name “vboxusers“. If any local user wants to use virtualbox then he/she has to be part of vboxusers group. Let’s assume ‘linuxtechi’ wants to use virtualbox

[root@linuxtechi ~]# usermod -a -G vboxusers linuxtechi
[root@linuxtechi ~]#

Now try accessing VirtualBox

Note: If you get an error related to ‘KERN_DIR’ while installing and rebuilding kernel module then set the following variable manually and again try to install and rebuild kernel module for VirtualBox.

[root@linuxtechi ~]# export KERN_DIR=/usr/src/kernels/$(uname -r)

 

refer:

https://www.linuxtechi.com/install-virtualbox-5-1-centos-7-rhel-7-fedora-26/

https://blog.csdn.net/fzh90/article/details/46764499

另外一份可靠資料http://wiki.centos.org/zh/HowTos/Virtualization/VirtualBox

基本裝好之後,然後下載擴充套件版本,https://www.virtualbox.org/wiki/Downloads

usb問題 http://www.cnblogs.com/ericsun/archive/2013/06/10/3130679.html

virtual box 安裝

1. wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo -P /etc/yum.repos.d/
2. yum install gcc make patch  dkms qt libgomp kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel  -y   ---- 安裝依賴環境
3. yum install epel-release -y  && yum update -y 
4. yum install VirtualBox-5.2.x86_64
5. sudo /sbin/vboxconfig ---  啟動vbox驅動
    -----vboxdrv.sh: Stopping VirtualBox services.
    -----vboxdrv.sh: Starting VirtualBox services.
    -----Building VirtualBox kernel modules.

 

相關文章