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]# 

相關文章
相關標籤/搜索