Recently, a large number of servers have been borrowed, so I want to promote virtualization technology. Virtual Machine Software selects Virtualbox, which is relatively simple. However, I was told that the software could not be installed, but I had to do it myself. I encountered a small problem in the middle and recorded it for my memo.
1. install the software environment
Yum install gcc yum install kernel-devel yum install kernel-headers here you need to note that the current system uses the kernel version corresponding to installing the corresponding kernel-headers and kernel-devel. If the corresponding package cannot be found, use yum install kernel to upgrade the server to the same version, and then restart the new kernel. (For Remote Installation, you can switch to the specified kernel by editing/boot/grub. conf below)
2. Install virtualbox Software
Rpm-ivh VirtualBox-4.1-4.1.6_74727_rhel5-1.x86_64.rpm
However, if you call vboxmanage list vms, you will find that the driver has not been compiled. Run the compilation command as prompted. the following error is returned:
[Root @ localhost home] # sudo/etc/init. d/vboxdrv setup Stopping VirtualBox kernel modules [OK] Uninstalling old VirtualBox DKMS kernel modules [OK] Removing old VirtualBox pci kernel module [OK] Removing old VirtualBox netadp kernel module [OK] Removing old virtualBox netflt kernel module [OK] Removing old VirtualBox kernel module [OK] Trying to register the VirtualBox kernel modules using DKMS [failure] (Failed, trying without DKMS) Recompiling VirtualBox kernel modules [OK] Starting VirtualBox kernel modules [failure] (Running VirtualBox in a Xen environment is not supported) a brief look at it, which is caused by dkms not being installed.
3. Install dkms
This is relatively simple. You can download an installation at http://linux.dell.com/dkms.
Then execute the driver compilation command and find the error:
[Root @ localhost home] # sudo/etc/init. d/vboxdrv setup Stopping VirtualBox kernel modules [OK] Uninstalling old VirtualBox DKMS kernel modules [OK] Removing old VirtualBox pci kernel module [OK] Removing old VirtualBox netadp kernel module [OK] Removing old virtualBox netflt kernel module [OK] Removing old VirtualBox kernel module [OK] Trying to register the VirtualBox kernel modules using DKMS [OK] Starting VirtualBox kernel modules [failure] (Running VirtualBox in a Xen environment is not supported)
4. Handle Xen environment problems
After carefully reading the error, I found that the last prompt was that the system was running in the Xen environment. I found the Virtualbox STARTUP script and found that it was a simple judgment:
Begin_msg "Starting VirtualBox kernel modules"
If [-d/proc/xen]; then
Failure "Running VirtualBox in a Xen environment is not supported"
Fi ran in this environment with xm list. virtualbox cannot be installed in xen. Obviously, I have not installed the Xen virtual machine on the server. This is actually because I chose the Xen kernel mode when the kernel is started. Use uname-ar to view the current kernel.
[Root @ localhost ~] # Uname-ar Linux localhost. localdomain 2.6.18-238. el5xen #1 SMP Thu Jan 13 16:41:45 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
This is easy to handle. Modify the Kernel used for startup:
[Root @ localhost ~] # Vim/boot/grub. conf default = 0 timeout = 5 splashimage = (hd0, 0)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-238. el5xen) root (hd0, 0) kernel/boot/xen.gz-2.6.18-238. el5 module/boot/vmlinuz-2.6.18-238.el5xen ro root = LABEL =/rhgb quiet module/boot/initrd-2.6.18-238.el5xen.img title CentOS-base (2.6.18-238. el5) root (hd0, 0) kernel/boot/vmlinuz-2.6.18-238.el5 ro root = LABEL =/rhgb quiet Initrd/boot/initrd-2.6.18-238.el5.img Each kernel is sorted from 0, you can see here to change the default to 1 can choose ordinary kernel. Then restart reboot.
5. Run sudo/etc/init. d/vboxdrv setup. You can see that the compilation is successful.
6. I thought everything was fine, but I found that I could not install the virtual machine operating system. See the following error:
Virtualbox vt-x is not available it seems that server virtualization is not enabled. Restart the server to enable the virtualization option in the bios, but the problem persists.
I checked a circle of information online. Someone said it was related to the kvm conflict. I tried it. Step: 1) Use lsmod | grep kvm to check whether the server is kvm_intel or kvm_amd. 2) then use modprobe-r kvm_intel to clear the conflict.
Conclusion: in fact, the whole process is not very troublesome, that is, every problem is clearly located and handled one by one, so we should not try it out without any aim!
Reference:
1. Solutions to virtualbox conflicts with kvm http://www.bkjia.com/ OS /201201/116796.html