#yum install epel-release
在 RHEL/CentOS 和 Fedora 上安裝 VirtualBox 5.1bash
1.若是已經安裝有老版本,須要先卸載原來版本oracle
# yum remove VirtualBox-4*
2.添加VirtualBox安裝源ide
# cd /etc/yum.repos.d/ # wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
# wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm # rpm -Uvh epel-release-5-4.noarch.rpm
# cd /etc/yum.repos.d/ # wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
# yum update # yum install binutils qt gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms
4.安裝VirtualBox 5.1post
# yum install VirtualBox-5.1
5.重建VirtualBox 5.1內核模塊spa
------------- Fedora 24-19 and CentOS/RHEL 7 ------------- #/usr/lib/virtualbox/vboxdrv.sh setup
------------- Fedora 18-16 and CentOS/RHEL 6/5 ------------- #/etc/init.d/vboxdrv setup
## OR ##
#service vboxdrv setup
6.添加用戶到vboxusers中 (user_name替換爲相應的用戶名)orm
# usermod -a -G vboxusers user_name
7.若是有關於KERN_DIR的錯誤,則須要設置相應的全局變量blog
## RHEL / CentOS / Fedora ## KERN_DIR=/usr/src/kernels/3.10.0-229.7.2.el7.x86_64 ## Export KERN_DIR ## export KERN_DIR
First, uninstall any earlier version of Virtualbox if any.ci
$ sudo apt-get remove virtualbox-4*
Next, install latest 5.1 version using official Virtualbox repository. To add the repository, use the following command as shown.rem
$ sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" >> /etc/apt/sources.list.d/virtualbox.list' $ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - $ sudo apt-get update $ sudo apt-get install virtualbox-5.1
Simply execute following command to start it from the terminal or use launcher from menu to start.terminal
# VirtualBox
If you need some additional functionality such as VirtualBox RDP, PXE, ROM with E1000 support and USB 2.0 Host Controller support, etc. You need to download and install the VirtualBox Extension Pack using following wget command.
# wget http://download.virtualbox.org/virtualbox/5.1.0/Oracle_VM_VirtualBox_Extension_Pack-5.1.0.vbox-extpack
To install the extension pack, you must have Virtualbox 5.1 installed, once you downloaded vbox-extpack open with Virtualbox as shown below. If it doesn’t work out, then open Virtaulbox –> Preferences –> Extensions and browse for the vbox-extpack to install it.
If you want to update the VirtualBox with latest version in the future, you can simply run the following command to update it.
# yum update VirtualBox-5.1
# apt-get install VirtualBox-5.1
If in case you want to remove VirtualBox completely, just use the following command to remove it completely from your system.
# cd /etc/yum.repos.d/ # rm -rf virtualbox.repo # yum remove VirtualBox-5.1
# apt-get remove VirtualBox-5.1
You can also Download VirtualBox 5.1 for other Linux, Windows and Mac OS X platforms.