自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

centos5.6下virtualbox安裝手記

系統(tǒng) Linux
本文介紹了Virtualbox在CentOS5.6上的安裝步驟,以及提供對安裝過程中出現(xiàn)問題的一些解決方法.

最近服務器被大量外借,所以想借此推進一下虛擬化技術。虛擬機軟件特別選用了比較簡單的Virtualbox。但是居然被告知軟件裝不上,無奈之下自己動手,中間確實遇到點小問題,記錄下來以做備忘。

1. 安裝軟件環(huán)境

  1. yum install gcc 
  2. yum install kernel-devel 
  3. yum install kernel-headers 

這里需要注意一下當前系統(tǒng)使用的kernel版本與安裝相應kernel-headers和kernel-devel要對應上。如果找不到相應的 包,那么就用yum install kernel把服務器也升級到同一個版本,然后選擇新內核重啟。(遠程安裝可以通過下面的對/boot/grub/grub.conf編輯實現(xiàn)切換指定內 核)

2. 安裝virtualbox軟件

rpm -ivh VirtualBox-4.1-4.1.6_74727_rhel5-1.x86_64.rpm

但是隨便調用了下vboxmanage list vms就發(fā)現(xiàn)驅動沒有編譯,根據(jù)提示執(zhí)行編譯命令,見到如下報錯:

  1. [root@localhost home]#  sudo /etc/init.d/vboxdrv setup 
  2.  
  3. Stopping VirtualBox kernel modules                         [確定] 
  4.  
  5. Uninstalling old VirtualBox DKMS kernel modules            [確定] 
  6.  
  7. Removing old VirtualBox pci kernel module                  [確定] 
  8.  
  9. Removing old VirtualBox netadp kernel module               [確定] 
  10.  
  11. Removing old VirtualBox netflt kernel module               [確定] 
  12.  
  13. Removing old VirtualBox kernel module                      [確定] 
  14.  
  15. Trying to register the VirtualBox kernel modules using DKMS[失敗] 
  16.  
  17.   (Failed, trying without DKMS) 
  18.  
  19. Recompiling VirtualBox kernel modules                      [確定] 
  20.  
  21. Starting VirtualBox kernel modules                         [失敗] 
  22.  
  23.   (Running VirtualBox in a Xen environment is not supported) 
簡單看了一下,是dkms沒安裝引起的

 

3. 安裝dkms

這個比較簡單,到這里http://linux.dell.com/dkms/去下載一個安裝就行了。

然后再執(zhí)行驅動編譯命令,發(fā)現(xiàn)還是出錯:

#p#

  1. [root@localhost home]#  sudo /etc/init.d/vboxdrv setup 
  2.  
  3. Stopping VirtualBox kernel modules                         [確定] 
  4.  
  5. Uninstalling old VirtualBox DKMS kernel modules            [確定] 
  6.  
  7. Removing old VirtualBox pci kernel module                  [確定] 
  8.  
  9. Removing old VirtualBox netadp kernel module               [確定] 
  10.  
  11. Removing old VirtualBox netflt kernel module               [確定] 
  12.  
  13. Removing old VirtualBox kernel module                      [確定] 
  14.  
  15. Trying to register the VirtualBox kernel modules using DKMS[確定] 
  16.  
  17. Starting VirtualBox kernel modules                         [失敗] 
  18.  
  19.   (Running VirtualBox in a Xen environment is not supported) 

 

4. 處理Xen環(huán)境問題

這次仔細看了一下報錯,才發(fā)現(xiàn)***一句提示是系統(tǒng)運行在Xen環(huán)境中,找了一下Virtualbox啟動腳本,發(fā)現(xiàn)就是一個很簡單的判斷:
 begin_msg "Starting VirtualBox kernel modules"
    if [ -d /proc/xen ]; then
        failure "Running VirtualBox in a Xen environment is not supported"
    fi
用xm list看了一下果然是跑在這個環(huán)境里面了,virtualbox不能在xen里面安裝。顯然我自己沒有在服務器上安裝過Xen虛擬機,這其實就是內核啟動的時候選擇了Xen內核模式而已。用uname -ar就可以看到目前的內核。
  1. [root@localhost ~]# uname -ar 
  2. 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 
 
這個很容易搞定,修改啟動選用的內核:
  1. [root@localhost ~]# vim /boot/grub/grub.conf 
  2. default=0 
  3. timeout=5 
  4. splashimage=(hd0,0)/boot/grub/splash.xpm.gz 
  5. hiddenmenu 
  6. title CentOS (2.6.18-238.el5xen) 
  7.         root (hd0,0) 
  8.         kernel /boot/xen.gz-2.6.18-238.el5 
  9.         module /boot/vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet 
  10.         module /boot/initrd-2.6.18-238.el5xen.img 
  11. title CentOS-base (2.6.18-238.el5) 
  12.         root (hd0,0) 
  13.         kernel /boot/vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet 
  14.         initrd /boot/initrd-2.6.18-238.el5.img 
每個內核從0開始排序,可以看到這里把default改成1就可以選用普通內核。然后reboot重啟。
 
5. 執(zhí)行sudo /etc/init.d/vboxdrv setup,可以看到編譯順利通過
 
6. 原以為萬事大吉,但發(fā)現(xiàn)安裝虛擬機操作系統(tǒng)時卻裝不上。見到如下報錯:
  1. virtualbox vt-x is not available 
    一看感覺是服務器虛擬化沒有打開,重啟服務器在bios里面打開虛擬化選項,但是發(fā)現(xiàn)問題依舊。
    上網(wǎng)查了一圈資料,有人說與kvm沖突有關,試了一下果然可以了。步驟:1)先用lsmod | grep kvm來查看服務器是kvm_intel還是kvm_amd,2)然后再用modprobe -r kvm_intel清除沖突。
 
總結:其實整個過程也不是很麻煩,就是每個問題定位清楚,逐一處理,切忌漫無目的一通亂試!

 

責任編輯:龐桂玉 來源: 51cto
相關推薦

2012-03-18 22:33:15

centosxen

2012-03-21 09:04:10

MySQL

2011-10-28 16:05:56

Node.js

2012-09-06 09:21:46

Centos5.6HeartbeatMySQL

2013-04-10 15:12:03

MySQL 5.6

2011-04-12 09:23:29

CentOS 5.6

2013-06-26 15:58:33

CentOS 5.6Memcached

2011-05-23 09:11:54

2011-08-17 10:19:30

CentOSOpenStack N

2011-05-05 09:32:59

CentOS 5.6KVM

2011-07-04 11:45:59

XenCentOS 5.6

2013-04-01 15:42:10

MySQL 5.6Windows

2011-03-02 09:52:03

2019-12-02 11:50:09

CentOS 8VirtualBoxLinux

2011-07-28 10:56:55

CentOS 5.6CentOS 6.0升級

2010-03-30 18:21:38

CentOS系統(tǒng)

2011-03-10 15:44:18

CentOSLAMP安裝

2011-03-10 15:44:18

CentOSLAMP安裝

2011-05-24 09:56:50

2010-01-13 15:17:18

VirtualBox安
點贊
收藏

51CTO技術棧公眾號