CentOS6.4下安裝配置phpVirtualBox

來源:互聯網
上載者:User

CentOS6.4下安裝配置phpVirtualBox

環境清單:

CentOS-6.4-x86_64-minimal.iso

dkms-2.2.0.3-1

VirtualBox-4.2.14-86644-Linux_amd64.run

phpvirtualbox-4.2-4

Oracle_VM_VirtualBox_Extension_Pack-4.2.14-86644
點擊清單名可下載

作為一名網維人員,虛擬機器是不可缺少的學習工具,而對於功能強大、高靈活性、跨平台等諸多特點的VirtualBox更是讓我青睞不已。本次配置的是基於web的VirtualBox(phpVirtualBox),如下:

 環境部署

CentOS的安裝 #略過

關閉iptables #略過

關閉Selinux #略過

安裝需要的包:

[root@vqiu~]#yum –y installgccmake unzipperlwgethttpdphpphp-mysqlphp-pearphp-soapaprapr-util-sqliteapr-util-ldapapr-util

1、安裝kernel-devel

[root@vqiu~]#rpm-qa|egrep"^kernel-[0-9]|kernel-devel"

kernel-2.6.32-358.el6.x86_64

安裝kernel相關包

[root@vqiu~]#yuminstall kernel-headers kernel-devel

再執行命令查看,提示已經安裝上了,版本一致(重點),重啟

[root@vqiu~]#rpm-qa|egrep"^kernel-[0-9]|kernel-devel"

kernel-devel-2.6.32-358.11.1.el6.x86_64

kernel-2.6.32-358.el6.x86_64

kernel-2.6.32-358.11.1.el6.x86_64

若嫌上麻煩,可直接執行 yum –y install update

2、安裝DKMS

由於virtualBox預設是在DKMS核心內運行,所以須安裝DKMS

[root@vqiu~]#rpm-ivhhttp://linux.dell.com/dkms/permalink/dkms-2.2.0.3-1.noarch.rpm

3、安裝VirtualBox

1) yum 安裝,推薦此方式

[root@vqiu~]#cd/etc/yum.repos.d/

[root@vqiu~]#wgethttp://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

[root@vqiu~]#yum–y install VirtualBox-4.2

或

2)  官方下載包,將VirtualBox-4.2.14-86644-Linux_amd64上傳到系統中,執行檔案

[root@vqiu~]#sh VirtualBox-4.2.14-86644-Linux_amd64.run

…………

We hope that you enjoy usingVirtualBox.

提示安裝成功了,用以下命令測試,看是否能啟動成功。

[root@vqiu~]#/etc/init.d/vboxdrvsetup

  StoppingVirtualBoxkernel modules[OK]

  Uninstalling oldVirtualBoxDKMS kernel modules[OK]

 Trying to register theVirtualBoxkernel modules using DKMS[OK]

  StartingVirtualBoxkernel modules[OK]

  #這裡通過了,不通過的可以查看下日記/var/log/vbox-install.log 尋找原因。

[root@vqiu~]#useradd-gvboxusers-s /sbin/nologinvbox

[root@vqiu~]#passwdvbox

建立檔案

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

VBOXWEB_USER=vbox

[root@vqiu~]#chkconfig--levels 235vboxweb-service on

[root@vqiu~]#servicevboxweb-service start

   [root@vqiu~]#netstat–tnlp

4、配置phpVirtualBox

[root@vqiu~]#wgethttps://phpvirtualbox.googlecode.com/files/phpvirtualbox-4.2-4.zip

[root@vqiu~]#unzip phpvirtualbox-4.1-7.zip

[root@vqiu~]#mvphpvirtualbox-4.1-7 /var/www/html/vbox

編輯設定檔

[root@vqiu~]#cd/var/www/html/vbox

[root@vqiu~]#cpconfig.php-exampleconfig.php

[root@vqiu~]#viconfig.php

[...]

var$username = ‘vbox’;

var$password = '前面設定的密碼';

安裝擴充包:

[root@vqiu~]#wgethttp://dlc.sun.com.edgesuite.net/virtualbox/4.2.14/Oracle_VM_VirtualBox_Extension_Pack-4.2.14-86644.vbox-extpack

[root@vqiu~]#VBoxManageextpackinstallOracle_VM_VirtualBox_Extension_Pack-4.2.14-86644.vbox-extpack

啟動web

[root@vqiu~]# servicehttpdstart &&chkconfighttpdon

瀏覽器輸入:http://ip/vbox

(預設使用者名及密碼:admin)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.