Install VirtualBox in CentOS 7

Source: Internet
Author: User

Install VirtualBox in CentOS 7

Yesterday I installed VirtualBox for centos6.5, but it didn't take a day. Today I am idle. Try centos7. As a result, PS younger brother is also a beginner of linux. Many of them just found a solution, but I don't know why.

Strange O (∩ _ ∩) O ha!

1. Install centos7, which is much simpler than the old version.

2. Configure the network connection. After installing centos, use ifconfig to check that there is no IP address. solution:

Cd/etc/sysconfig/network-scripts/

Vi ifcfg-eno16777736 # note, we usually see if1__eth0, what is specific, use ifconfig to see.

ONBOOT = yes # Set onboot to yes

Restart the NIC:/etc/init. d/network restart

2. Install virtualbox:

1> download the RHEL software library configuration file of VirtualBox:

[Cpp] view plaincopyprint?
  1. Cd/etc/yum. repos. d
  2. Wgethttp: // download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

2> install RPMForge.

First

For more information, see http://wiki.centos.org/zh/additionalresources/repositories/rpmforge.

[Cpp] view plaincopyprint?
  1. Rpm-ivhrpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

3> install DKMS (Dynamic Kernel Module)

[Python] view plaincopyprint?
  1. Yuminstalldkms

4> install the development environment and kernel:

[Cpp] view plaincopyprint?
  1. Yumgroupinstall "DevelopmentTools"
  2. Yuminstallkernel-devel

5> install qt and qt-

[Cpp] view plaincopyprint?
  1. Yuminstallqtqt-x11
6> install VirtualBox

I downloaded it on the official website first, the version is VirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm, https://www.virtualbox.org/wiki/Downloads

[Cpp] view plaincopyprint?
  1. YuminstallVirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm

7> Installation extension:

[Cpp] view plaincopyprint?
  1. VBoxManageextpackinstallOracle_VM_VirtualBox_Extension_Pack-4.3.16-95972.vbox-extpack

This is a problem.

VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackFile, interface IExtPackFile, callee nsISupports
VBoxManage: error: Context: "Install (fReplace, NULL, ptrProgress. asOutParam ()" at line 1140 of file VBoxManageMisc. cpp

However, virtualbox already exists in the system, so you can ignore this problem and continue with the next step.

[Cpp] view plaincopyprint?
  1. 8>/etc/init. d/vboxdrvsetup

Here an error occurs:

Building the VirtualBox Guest Additions kernel modules [FAILED]
Your system does not seem to be set up to build kernel modules.
Look at/var/log/vboxadd-install.log to find out what went wrong.
Once you have corrected it, you can run/etc/init. d/vboxadd setup to build them.
View error logs:
/Tmp/vbox. o/Makefile. include. header: 97 :***
Error: unable to find the source of your current Linux kernel. Specify KERN_DIR = <directory> and run make again. Stop.

Solution:

[Cpp] view plaincopyprint?
  1. Yuminstallkernel
  2. Yuminstallkernel-devel <span>
  3. Yuminstallkernel-headers
  4. </Span> yuminstallgcc *
  5. Yuminstallmake
  6. Reboot

Restart

[Cpp] view plaincopyprint?
  1. /Etc/init. d/vboxdrvsetup

Success!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.