【转】How to Install Latest VirtualBox 6.0 in Linux

VirtualBox is an open source cross-platform virtualization software, it can be installed on any operating system and enable you to install and run multiple guest operating systems on same computer.

For example, if you install it on your Linux system, you can run Windows XP operating system under it as a Guest OS or run Linux OS on your Windows system and so on. This way, you can install and run as many as guest operating systems as you like, the only limit is disk space and memory.

Recently Oracle has released latest stable version of Virtualbox 6.0.0, the newest version of Virtual box comes with so many major changes and new features added to it.

Whats new in Virtualbox 6.0

  • Added support for exporting a virtual machine to Oracle Cloud Infrastructure.
  • A much improved HiDPI and scaling support, along with superior detection and per-machine configuration.
  • A Major rework of user interface with smooth and easy setup of virtual machines.
  • A new file manager allows user to manage the guest file system and copy files between host and guest.
  • A major update of 3D graphics device emulation on Linux guests.
  • vboximg-mount utility for hosts enables users to access the content of guest disks on the host.
  • Added support for using Hyper-V on Windows host.

You can see the complete new change log details about VirtualBox 6.0 on their Official Changelog Page.

This guide explains how to install VirtualBox 6.0 on RHELCentOS and Fedora systems using VirtualBox’s own repository with YUM and DNF (for Fedora 22+ releases) tool.

This guide also explains how to install VirtualBox 6.0 on DebianUbuntu and Linux Mint systems using VirtualBox’s own repository with APT-GET or APT command.

Installing VirtualBox 6.0 in RHEL/CentOS and Fedora

If you’ve any earlier version of Virtualbox installed, remove that before installing latest version.

# yum remove VirtualBox*
# dnf remove VirtualBox*  [On Fedora 22+]

Adding VirtualBox Repository

Next add the VirtualBox own repository to install latest VirtualBox 6.0 on following systems.

For RHEL/CentOS 7/6/

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

For RHEL/CentOS 5

# wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm

For Fedora 24-29

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

Install Dependency Packages for VirtualBox

VirtualBox uses vboxdrv kernel module to control and allocate physical memory for execution of guest operating systems. Without this module, you can still use the VirtualBox to create and configure virtual machines, but they will not work.

So, to make VirtualBox fully functional you will need to update your system first, then install some additional modules like DKMSkernel-headers and kernel-devel and some dependency packages.

 

# yum update
# yum install binutils qt gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms

Install VirtualBox 6.0

Once you’ve installed all the needed dependency packages, you can install latest version of VirtualBox using following command.

# yum install VirtualBox-6.0

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

检测一下是否安装成功:

virtualbox --help

发现:

执行命令行:

rcvboxdrv setup

发现:

yum install - y  kernel-devel-3.10.0-957.21.2.el7.x86_64

rcvboxdrv setup

问题即可解决!!

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Rebuild Kernel Modules for VirtualBox 6.0

The below command will automatically create vboxusers group and user and also search and automatically rebuild required kernel modules.

------------- Fedora 22+ 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

If the above build process fails, you will get a warning messages similar to below.

vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-4.19.0-1.el7.elrepo.x86_64

Then you need to first check your installed kernel and then install needed kernel-devel using following commands.

# uname -r
# yum install kernel-devel-CURRENT_KERNEL

Note: replace CURRENT_KERNEL with string you get from uname -r.

Now run the build setup again.

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

Next, replace user_name in the following command with your own user name.

# usermod -a -G vboxusers user_name

Troubleshooting

If you get any error message like KERN_DIR or if your kernel source directory not detected automatically by build process, you can set it by using following command. Make sure you change kernel version according to your system as shown in red color.

## RHEL / CentOS / Fedora ##
KERN_DIR=/usr/src/kernels/4.19.0-1.el7.elrepo.x86_64

## Export KERN_DIR ##
export KERN_DIR

Installing VirtualBox 6.0 in Debian, Ubuntu and Linux Mint

First, uninstall any earlier version of Virtualbox if any.

$ sudo apt-get remove virtualbox-*

Next, install latest VirtualBox 6.0 version using official Virtualbox repository. To add the repository, use the following command as shown.

$ 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-6.0

查看virtualbox安装在哪里?

whereis VirtualBox

Starting VirtualBox 6.0

Simply execute following command to start it from the terminal or use launcher from menu to start.

# VirtualBox

VirtualBox 6.0 Screenshots on CentOS 7

VirtualBox 6.0 Running on CentOS 7

VirtualBox 6.0 Running on CentOS 7

Create Virtalbox New Guest Machine

Create Virtalbox New Guest Machine

Installing VirtualBox Extension Pack

If you need some additional functionality such as VirtualBox RDPPXEROM 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/6.0.0/Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack

 

To install the extension pack, you must have Virtualbox 6.0 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.

Install Virtualbox Extension Pack

Install Virtualbox Extension Pack

Updating VirtualBox

If you want to update the VirtualBox with latest version in the future, you can simply run the following command to update it.

On RHEL/CentOS/Fedora

# yum update VirtualBox-6.0

On Ubuntu/Linux Mint

# apt-get install VirtualBox-6.0

Remove VirtualBox

If in case you want to remove VirtualBox completely, just use the following command to remove it completely from your system.

On RHEL/CentOS/Fedora

# cd /etc/yum.repos.d/
# rm -rf virtualbox.repo
# yum remove VirtualBox-6.0

On Ubuntu/Linux Mint

# apt-get remove VirtualBox-6.0

You can also Download VirtualBox 6.0 for other LinuxWindows and Mac OS X platforms.

————————————————————————————————————————————————————————

下面可能更详细些

https://linuxhint.com/install_virtualbox_6_centos/

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值