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?
- Cd/etc/yum. repos. d
- 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?
- Rpm-ivhrpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
3> install DKMS (Dynamic Kernel Module)
[Python] view plaincopyprint?
- Yuminstalldkms
4> install the development environment and kernel:
[Cpp] view plaincopyprint?
- Yumgroupinstall "DevelopmentTools"
- Yuminstallkernel-devel
5> install qt and qt-
[Cpp] view plaincopyprint?
- 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?
- YuminstallVirtualBox-4.3-4.3.26_98988_el7-1.x86_64.rpm
7> Installation extension:
[Cpp] view plaincopyprint?
- 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?
- 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?
- Yuminstallkernel
- Yuminstallkernel-devel <span>
- Yuminstallkernel-headers
- </Span> yuminstallgcc *
- Yuminstallmake
- Reboot
Restart
[Cpp] view plaincopyprint?
- /Etc/init. d/vboxdrvsetup
Success!