CentOS 6.2 安装VirtualBox 4.3 的教程
本文记录如何在一个全新安装的CentOS6.2的Linux系统上安装VirtualBox4.3
1、变更yum配置
Python
代码如下 | |
[root@itchenyi ~]# cd /etc/yum.repos.d/ [root@itchenyi yum.repos.d]# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo --2014-01-27 11:46:24-- http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo Resolving download.virtualbox.org... 137.254.120.26 Connecting to download.virtualbox.org|137.254.120.26|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 256 [text/plain] Saving to: “virtualbox.repo” 100%[======================================>] 256 --.-K/s in 0s 2014-01-27 11:46:25 (29.4 MB/s) - “virtualbox.repo” saved [256/256] |
2、virtualbox.repo文件的内容,请确保启用了gpgchec,并验证了GPG秘钥的路径:
代码如下 | |
[root@itchenyi yum.repos.d]# cat virtualbox.repo [virtualbox] name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch enabled=1 gpgcheck=1 gpgkey=http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc |
3、本步骤为可选步骤,验证GPG秘钥的路径
代码如下 | |
[root@itchenyi yum.repos.d]# wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | gpg --quiet --with-fingerprint pub 1024D/98AB5139 2010-05-18 Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org> www.111cn.net Key fingerprint = 7B0F AB3A 13B9 0743 5925 D9C9 5442 2A4B 98AB 5139 |
sub 2048g/281DDC4B 2010-05-18
在http://pgp.mit.edu 搜索vitrualbox.org,勾选显示pgp指纹钥匙… 确认可以匹配即可!
代码如下 | |
virtualbox校验PGP Key |
4、使用yum 审查安装前的包信息
代码如下 | |
[root@itchenyi yum.repos.d]# yum info VirtualBox-4.3 Available Packages Name : VirtualBox-4.3 Arch : x86_64 Version : 4.3.6_91406_el6 Release : 1 Size : 72 M Repo : virtualbox Summary : Oracle VM VirtualBox URL : http://www.virtualbox.org/ License : GPLv2 Description : VirtualBox is a powerful PC virtualization solution allowing : you to run a wide range of PC operating systems on your Linux : system. This includes Windows, Linux, FreeBSD, DOS, OpenBSD : and others. VirtualBox comes with a broad feature set and : excellent performance, making it the premier virtualization : software solution on the market. |
5、开始安装Vbox
代码如下 | |
[root@itchenyi yum.repos.d]# yum install VirtualBox-4.3 Dependencies Resolved ========================================================================================================================================= Package Arch Version Repository Size ========================================================================================================================================= Installing: VirtualBox-4.3 x86_64 4.3.6_91406_el6-1 virtualbox 72 M Transaction Summary ========================================================================================================================================= Install 1 Package(s) Total download size: 72 M Installed size: 147 M Is this ok [y/N]: y |
你也可以使用wget 下载到本地后安装,但我不保证下载源的可用性
代码如下 | |
[root@itchenyi Downloads]# wget http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3-4.3.6_91406_el6-1.x86_64.rpm --2014-01-27 11:55:28-- http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3-4.3.6_91406_el6-1.x86_64.rpm Resolving download.virtualbox.org... 137.254.120.26 Connecting to download.virtualbox.org|137.254.120.26|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://dlc.sun.com.edgesuite.net/virtualbox/4.3.6/VirtualBox-4.3-4.3.6_91406_el6-1.x86_64.rpm [following] --2014-01-27 11:55:28-- http://dlc.sun.com.edgesuite.net/virtualbox/4.3.6/VirtualBox-4.3-4.3.6_91406_el6-1.x86_64.rpm Resolving dlc.sun.com.edgesuite.net... 58.27.124.146, 58.27.124.139 Connecting to dlc.sun.com.edgesuite.net|58.27.124.146|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 75914276 (72M) [application/x-redhat-package-manager] Saving to: “VirtualBox-4.3-4.3.6_91406_el6-1.x86_64.rpm” 5% [====> ] 4,537,516 1110K/s eta 10m 31s [root@itchenyi Downloads]# rpm -Uvh VirtualBox-4.3-4.3.6_91406_el6-1.x86_64.rpm warning: VirtualBox-4.3-4.3.6_91406_el6-1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 98ab5139: NOKEY Preparing... ########################################### [100%] 1:VirtualBox-4.3 ########################################### [100%] |
6、创建Vbox用户组
代码如下 | |
[root@itchenyi Downloads]# /usr/sbin/usermod -a -G vboxusers itchenyi |
7、安装内核头文件等….
代码如下 | |
[root@itchenyi Downloads]# yum install kernel-headers kernel-devel gcc Dependencies Resolved ========================================================================================================================================= Package Arch Version Repository Size ========================================================================================================================================= Installing: gcc x86_64 4.4.7-4.el6 base 10 M kernel-devel x86_64 2.6.32-220.el6 updates 8.8 M Installing for dependencies: cloog-ppl x86_64 0.15.7-1.2.el6 base 93 k cpp x86_64 4.4.7-4.el6 base 3.7 M mpfr x86_64 2.4.1-6.el6 base 157 k ppl x86_64 0.10.2-11.el6 base 1.3 M Updating for dependencies: libgcc x86_64 4.4.7-4.el6 base 101 k libgomp x86_64 4.4.7-4.el6 base 118 k Transaction Summary ========================================================================================================================================= Install 6 Package(s) Upgrade 2 Package(s) Total download size: 24 M Is this ok [y/N]: y |
8、确认你的内核版本
代码如下 | |
[root@itchenyi Downloads]# uname -r 2.6.32-220.el6.x86_64 |
#请确保你上下得到的版本信息一致!
代码如下 | |
[root@itchenyi Downloads]# ls /usr/src/kernels/ 2.6.32-220.el6.x86_64 |
9、环境变量
代码如下 | |
[root@itchenyi Downloads]# KERN_DIR=/usr/src/kernels/2.6.32-220.el6.x86_64 [root@itchenyi Downloads]# export KERN_DIR |
10、echo 变量,确保信息是正确的
代码如下 | |
[root@itchenyi Downloads]# echo $KERN_DIR /usr/src/kernels/2.6.32-220.el6.x86_64 |
11、启动Virtualbox,完成配置
代码如下 | |
www.111cn.net [root@itchenyi ~]# service vboxdrv setup Stopping VirtualBox kernel modules [ OK ] Uninstalling old VirtualBox DKMS kernel modules [ OK ] Trying to register the VirtualBox kernel modules using DKMS[ OK ] Starting VirtualBox kernel modules [ OK ] |
12、运行图 如下..
代码如下 | |
virtualbox running |