cd /etc/yum.repos.d
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
下载跟CENTOS6.5相对对应的版本,这里下载的是VirtualBox-.x86_64.rpm。

以root账号登录到CentOS系统。

update之前:
# rpm -qa |egrep "^kernel-[0-9]|kernel-devel"
kernel--.el6.x86_64
kernel-devel--.el6.x86_64

update之后:
# rpm -qa |egrep "^kernel-[0-9]|kernel-devel"
kernel--.el6.x86_64
kernel--.el6.x86_64
kernel-devel--.el6.x86_64

VirtualBox需要kernel modules的支持,所以系统要先安装kernel。
#yum install kernel-devel
 #yum install gcc
运行上面两个命令,其中第一个命令安装了kernel-devel,第二个命令安装了kernel-headers、glibc-headers、glibc-devel和gcc,并更新了glibc-common。

#rpm –ivh VirtualBox-.x86_64.rpm
安装过程,除了DSA signature警告外,还有VBox内核模块安装失败的报错:
Trying to register the VirtualBox kernel modules using DKMS[FAILED]
   (Failed, trying without DKMS)
 Recompiling VirtualBox kernel modules [FAILED]
   (look at /var/log/vbox-install.log to find out what went wrong)

此时,建立、并且启动VirtualBox kernel module:
#/etc/init.d/vboxdrv setup
也出现同样报错,

搜索了一下“DKMS”,百度百科对DKMS是这样描述的:Oikawa等人在1996年提出一种与LKM类似的动态核心模块(DKMs)技术。与LKM一样,DKMs以文件的形式存储并能在系统运行过程中动态地加载和卸载。DKMs由一个用户层的DKM服务器来管理,并非由内核来管理。当核心需要某模块时,由DKM服务器负责把相应的DKM加载;当核心的内存资源紧缺时,由DKM服务器负责卸载一个没有被使用的DKM。

试途通过命令
#yum list DKMS*
下载安装DKMS,但并没有发现DKMS源。(参考文中,是在Fedora14下运行该命令能发现源的)。后来到http://linux.dell.com/dkms/网站下载了最新的dkms驱动程序包 dkms-2.1.1.2-1.noarch.rpm。
 通过命令
#rpm –ivh dkms-.noarch.rpm
安装该包后,再运行
#/etc/init.d/vboxdrv setup
命令,还是存在问题,但不是dkms问题,而仅仅是内核的问题,
 报错如下:
Trying to register the VirtualBox kernel modules using DKMS
 Error!Your kernel headers -.el6.x86_64 cannot be found at /lib/moduals/-.el6.x86_64/build or /lib/modules/-.el6.x86_64/source[FAILED]
 (Failed,trying without DKMS)
 Recompiling VirtualBox kernel modules[FAILED]
 (look at /var/log/vbox-install.log to find out what went wrong)

若直接运行VBox,也有类似的警告
#VirtualBox
 WARNING:The vboxdrv kernel module -.el6.x86_64) or it failed to load.Please recompile the kernel module and install it by
 sudo /etc/init.d/vboxdrv setup
 You will not be able to start VMs until this problem is fixed.

通过reboot命令重启计算机,也解决不了。
 按系统提示,运行Package Updater,把要更新的软件包都更新了一遍,再重启计算机,问题依旧。
 执行命令
#yum install kernel-devel
把内核更新了一次,重启,问题依旧。
 执行命令

####yum install kernel-PAE-devel
####把内核更新,重启,这次重启花了比较长的时间,能看到加载VirtualBox kernel modules成功的提示。
上面这条命令不成功,重启grub界面出现2..el6.x86_64和2..el6.x86_64两个启动项,选择最新的2..el6.x86_64进入后,
执行
#/etc/init.d/vboxdrv setup
提示如下
[root@lhf op]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules                         [  OK  ]
Uninstalling old VirtualBox DKMS kernel modulesError! There are no instances of module: vboxhost
 located in the DKMS tree.
                                                           [  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 DKMSError! echo
Your kernel headers -.el6.x86_64 cannot be found at
/lib/modules/-.el6.x86_64/build or /lib/modules/-.el6.x86_64/source.
                                                           [FAILED]
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules                      [FAILED]
  (Look at /var/log/vbox-install.log to find out what went wrong)
Uninstalling old VirtualBox DKMS kernel modules

Stopping VirtualBox kernel modules                         [  OK  ]
Uninstalling old VirtualBox DKMS kernel modulesError! There are no instances of module: vboxhost
 located in the DKMS tree.
                                                           [  OK  ]
Trying to register the VirtualBox kernel modules using DKMS[  OK  ]
Starting VirtualBox kernel modules                         [  OK  ]

若执行
#VirtualBox
则直接运行VirtualBox,而没有任何警告或报错,表明VirtualBox已经可以正常运行。

后来才知道,操作系统在32bit x86平台上最大寻址空间只有4GB,如果要使用大于4GB的内存,就必须使用Intel的PAE(物理地址扩展)模式。对于RHEL5,缺省安装模式下是不允许检测超过4GB内存,所以需要在内核安装完毕后再安装kernel-PAE套件。由于我做测试用的是16G的Dell服务器,内存有16G,而操作系统是32bit的,所以要安装kernel-PAE-devel。

在VirtualBox上新建虚拟机,按提示进行虚拟系统环境配置,操作相对简单,设置内容大致如下:
    Name:虚拟系统名称,将显示在主界面上。
    OS Type:选择将安装的系统类型。
    Base Memory Size:给虚拟系统分配内存,依照物理内存大小合理分配。
    Boot Hard Disk:相当于给虚拟系统建立的虚拟硬盘,第一次使用肯定没有建立过,故选择"New",建立一个。
    Image Typ:建立选择第一个类型,也就是动态空间。这样可以避免主机硬盘空间浪费。
    Image File Name:虚拟硬盘的名字。
    Image Size:划分虚拟硬盘大小。
 然后就可以在虚拟机上安装Guest操作系统了。

这次装的是windows2003英文版的一个系统,系统安装完成后,可以直接上网,VBox默认使用的是NAT方式。不过分辨率不好调整。

看到有些资料说,安装完客户机系统的第一件事情,应该是安装"VirtualBox Guset Additions"。
VirtualBox Guset Additions作用,据介绍有以下几点:
    、实现客户机和主机间的鼠标平滑移动。
    、与主机实现文件共享。
    、于主机共享剪贴板的内容,也就是说直接可以在主机、客户机之间复制、粘贴。
    、使用音效系统,要不然没法用虚拟机听音乐了。
    、与主机实现时间同步。否则的话主机已经到了上午10点了,你的客户机可能还在半夜3点...
     、自动登录windows。

具体的操作是,启动客户机系统,在drives中选择"install Guset Additions"。在弹出的对话框中,基本上一路“下一步”就OK了。安装结束后,需要重启客户机系统。重启后,在客户机系统中,可以看到右下角有个四方形的图标,表示系统运行了“Oracle VM VirtualBox Guest Additions”。此时,鼠标可以在当前系统和客户机系统之前随意移动,而在装VirtualBox Guset Additions之前,要从客户机系统回到当前系统是需要按组合键“Ctrl+Alt+Delete”的。而且系统根据当前VBox窗口的大小自动调整像素,也可以全屏显示。

centos6.5安装vbox的更多相关文章

  1. vmware Centos6.6安装64位

    Centos6.6安装64位 必须开启BIOS中的虚拟化技术 首先开机进入BIOS,一般机器是按F2,我的T420是按F1,然后进入Security,Virtualization,选择Enable即可 ...

  2. Gitlab完美安装【CentOS6.5安装gitlab-6.9.2】

    摘要: 拆腾了几天,终于在今天找到了快速安装Gitlab的方法.CentOS6.5安装gitlab-6.9.2 参考网址:https://gitlab.com/gitlab-org/omnibus-g ...

  3. CentOS6.5安装Tomcat

    安装说明 安装环境:CentOS-6.4 安装方式:源码安装 软件:apache-tomcat-7.0.56.tar.gz 下载地址:http://tomcat.apache.org/download ...

  4. Centos6 yum安装openldap+phpldapadmin+TLS+双主配置

    原文地址:http://54im.com/openldap/centos-6-yum-install-openldap-phpldapadmin-tls-%E5%8F%8C%E4%B8%BB%E9%8 ...

  5. centos6.5安装oracle11g_2

    centos7安装oracle数据库不成功,换成centos6.5安装,可以安装成功,记录一下 安装系统时,主机名如果不是用localhost,安装成功后,要用主机名和ip做映射,修改/etc/hos ...

  6. CentOS6.6安装vmware workstation报错

    本人系统用的是centos6.6,安装了vmware workstation,启动后一直如下图报错,相关内核已经安装了的,哪位前辈如果解决过这样的问题,麻烦指点指点,小弟在此先谢过了.

  7. CentOS6.6安装virtualbox4.1.44

    本人用的是centos6.6,安装了virtualbox 4.1.44,启动后一直如上图报错,哪位前辈如果解决过这样的问题,麻烦指点指点,小弟在此先谢过了.

  8. [转]CentOS-6.3安装配置cmake

    CentOS-6.3安装配置cmake   zhoulf 2013-02-03 原创 安装说明 安装环境:CentOS-6.3安装方式:源码编译安装 软件:cmake-2.8.10.2.tar.gz下 ...

  9. 实战CENTOS6.5安装docker并创建asp.net mvc 5 镜像,运行MVC 网站

    Docker,容器,让研发.测试.生产同一环境,可在linux平台上混合使用JAVA与net 程序 Centos6.5安装docker 参考http://my.oschina.net/kcw/blog ...

随机推荐

  1. 关于insertBefore

    insertBefore,看名字就是在某个元素前插入元素,但是其实它可以再文档任何元素强势插入. insertBefore用法: parent.insertBefore(newChild, refCh ...

  2. SVN: revert all command

    If you accidentally marked all your files as "delete" (your file/folder has a red x on it) ...

  3. OpenJudge/Poj 1658 Eva's Problem

    1.链接地址: http://bailian.openjudge.cn/practice/1658 http://poj.org/problem?id=1658 2.题目: 总时间限制: 1000ms ...

  4. Linux C 程序 两变量值交换(FIVE)

    example:1.运算符: #include<stdio.h> int main(){ int a , b , c ,d ; a = ; b = a++;//先赋值给b,a再自增 c = ...

  5. node.js 安装express 提示 command is not found

    肯定有遇到这样的问题. 在执行express -e app时,出现 command is not found 此时需要执行 : $ npm install -g express-generator 你 ...

  6. sql 自定义排序

    方法一: 比如需要对SQL表中的字段NAME进行如下的排序: 张三(Z) 李四(L) 王五(W) 赵六(Z) 按照sql中的默认排序规则,根据字母顺序(a~z)排,结果为:李四  王五 赵六 张三   ...

  7. 安装mvc3出错致命错误

    给vs2010安装mvc3,出现如下错误提示: Installation failed with error code: (0x80070643), "安装时发生严重错误 ". 将 ...

  8. PHP中使用cURL

    1.cURL介绍 cURL 是一个利用URL语法规定来传输文件和数据的工具,支持很多协议,如HTTP.FTP.TELNET等.最爽的是,PHP也支持 cURL 库.本文将介绍 cURL 的一些高级特性 ...

  9. Mysql ID重新排列

    我们经常会遇到,在删除数据库某条记录时,原来的ID排序会有间隔,比如删除了ID为8的数据,这个表的ID排序就会从7直接到9, 那我们如何解决这个ID重新排列的问题呢? 只需一下三步: 1.删除这个表的 ...

  10. cms开发笔记2

    1 创建数据库表 //配置文件CREATE TABLE IF NOT EXISTS `mc_config` ( `en_name` varchar(80) NOT NULL, `ch_name` va ...