redhat安装virtualbox详情

一、下载virtualbox安装包

[root@master virtualbox-tool-ref]# wget http://download.virtualbox.org/virtualbox/4.3.20/VirtualBox-4.3-4.3.20_96996_el6-1.x86_64.rpmjava

二、安装virtualbox

1)、安装virtualbox安装包

[root@master virtualbox-tool-ref]# rpm -ivh VirtualBox-4.3-4.3.20_96996_el6-1.x86_64.rpm c++

warning: VirtualBox-4.3-4.3.20_96996_el6-1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 98ab5139: NOKEYweb

Preparing...                ########################################### [100%]ubuntu

   1:VirtualBox-4.3         ########################################### [100%]服务器

 

Creating group 'vboxusers'. VM users must be member of that group!oracle

 

No precompiled module for this kernel found -- trying to build one. Messagesoop

emitted during module compilation will be logged to /var/log/vbox-install.log.ui

 

Stopping VirtualBox kernel modules [肯定]this

Recompiling VirtualBox kernel modules [失败]spa

  (Look at /var/log/vbox-install.log to find out what went wrong)

2)、导入key

[root@master virtualbox-tool-ref]# wget https://www.virtualbox.org/download/oracle_vbox.asc

3)、验证key

[root@master virtualbox-tool-ref]# rpm --import oracle_vbox.asc

4)、导入key后从新安装virtualbox(此时应该是能安装成功的)

[root@master virtualbox-tool-ref]# rpm -ivh VirtualBox-4.3-4.3.20_96996_el6-1.x86_64.rpm 

Preparing...                ########################################### [100%]

package VirtualBox-4.3-4.3.20_96996_el6-1.x86_64 is already installed

三、安装virtualbox扩展包

[root@master RemoteBox-1.9]# wget http://download.virtualbox.org/virtualbox/4.3.20/Oracle_VM_VirtualBox_Extension_Pack-4.3.20-96996.vbox-extpack 

四、启动virtualbox报错:

报错信息以下:

[root@master ~]# virtualbox 

WARNING: The vboxdrv kernel module is not loaded. Either there is no module

         available for the current kernel (2.6.32-431.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.

Xlib:  extension "RANDR" missing on display "localhost:10.0".

[root@master ~]# sudo /etc/init.d/vboxdrv setup

Stopping VirtualBox kernel modules                         [肯定]

Recompiling VirtualBox kernel modules                      [失败]

  (Look at /var/log/vbox-install.log to find out what went wrong)

[root@master ~]# cat /var/log/vbox-install.log 

Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again。 中止。

Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again。 中止。

Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again。 中止。

[root@master ~]# 

解决方案:

1)、安装gcckernelkernel-devel

a)、gcc安装

 

[root@master ~]# yum search gcc

已加载插件:fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

base                                                                                      | 3.7 kB     00:00     

extras                                                                                    | 3.4 kB     00:00     

updates                                                                                   | 3.4 kB     00:00     

=============================================== N/S Matched: gcc ================================================

gcc-c++.x86_64 : C++ support for GCC

gcc-gnat.x86_64 : Ada 95 support for GCC

gcc-java.x86_64 : Java support for GCC

gcc-objc.x86_64 : Objective-C support for GCC

gcc-objc++.x86_64 : Objective-C++ support for GCC

libgcc.x86_64 : GCC version 4.4 shared support library

libgcc.i686 : GCC version 4.4 shared support library

compat-gcc-34.x86_64 : Compatibility GNU Compiler Collection

compat-gcc-34-c++.x86_64 : C++ support for compatibility compiler

compat-gcc-34-g77.x86_64 : Fortran 77 support for compatibility compiler

gcc.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)

[root@master ~]# yum install gcc.x86_64

b)、安装kernel

[root@master ~]# yum search kernel

已加载插件:fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

============================================== N/S Matched: kernel ==============================================

abrt-addon-kerneloops.x86_64 : abrt's kerneloops addon

dracut-kernel.noarch : Metapackage to build generic initramfs with dracut with only kernel modules

kernel.x86_64 : The Linux kernel

c)、安装kernel-devel

[root@master ~]# yum search kernel-devel

已加载插件:fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

=========================================== N/S Matched: kernel-devel ===========================================

kernel-devel.x86_64 : Development package for building kernel modules to match the kernel

 

  Name and summary matches only, use "search all" for everything.

[root@master ~]# yum install kernel-devel.x86_64

2)、从新计算机

reboot

3)、启动virtualbox

[root@master ~]# virtualbox 

WARNING: The vboxdrv kernel module is not loaded. Either there is no module

         available for the current kernel (2.6.32-504.3.3.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.

4)、执行sudo /etc/init.d/vboxdrv setup

执行以上命令从新编译内核。

[root@master ~]# sudo /etc/init.d/vboxdrv setup

Stopping VirtualBox kernel modules                         [肯定]

Recompiling VirtualBox kernel modules                      [肯定]

Starting VirtualBox kernel modules                         [肯定]

5)、从新启动virtualbox

[root@master ~]# virtualbox 

从新启动virtualbox成功。

六、配置服务器上的virtualbox web服务

1)、将root用户添加到vboxusers组中

[root@master virtualbox-tool-ref]# usermod -a -G vboxusers root

useradd -g vboxusers -s /sbin/nologin vbox

[root@master virtualbox-tool-ref]# id root

uid=0(root) gid=0(root) =0(root),492(vboxusers)

2)、在/etc/default/virtualbox处,为web服务建立一个配置文件

[root@master ~]# vi /etc/default/virtualbox 

VBOXWEB_USER="root"

VBOXWEB_TIMEOUT=0

VBOXWEB_LOGFILE="/var/log/vboxwebservice.log"

VBOXWEB_HOST="192.168.1.227"

 

3)、初始化并设置日志文件的全部权

[root@master ~]# touch /var/log/vboxwebservice.log

[root@master ~]# chown root:vboxusers /var/log/vboxwebservice.log 

4)、建立VirtualBox配置目录

[root@master ~]# mkdir /home/root/.VirtualBox

[root@master ~]# chown root:vboxusers /home/root/.VirtualBox/

5)、启动vboxweb-service服务

root@ubuntu:/home/hi# service vboxweb-service start

6)、查看virtualbox web服务启动状态

root@ubuntu:/home/hi# service vboxweb-service status

7)、查看virtualbox web service监听端口

netstat -nap | grep vboxwebsrv

 

7、安装remotebox

1)、下载remotebox

[root@master RemoteBox-1.9]# wget http://remotebox.knobgoblin.org.uk/downloads/RemoteBox-1.9.tar.gz

2)、解压remotebox压缩包

remotebox文件所在路径,解压下载包:

[root@master RemoteBox-1.9]# tar -zxvf RemoteBox-1.9.tar.gz 

3)、运行remotebox

[root@master virtualbox-tool-ref]# RemoteBox-1.9/remotebox 

Can't locate SOAP/Lite.pm in @INC (@INC contains: /home/allshare/virtualbox-tool-ref/RemoteBox-1.9/share/remotebox /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/allshare/virtualbox-tool-ref/RemoteBox-1.9/share/remotebox/vboxService.pm line 10050.

BEGIN failed--compilation aborted at /home/allshare/virtualbox-tool-ref/RemoteBox-1.9/share/remotebox/vboxService.pm line 10050.

Compilation failed in require at RemoteBox-1.9/remotebox line 12.

BEGIN failed--compilation aborted at RemoteBox-1.9/remotebox line 12.

[root@master virtualbox-tool-ref]# 

相关文章
相关标签/搜索