LoginSignup
1
1

More than 5 years have passed since last update.

[メモ] phpVirtualBox を Windows+xamppにて

Posted at

image.png

概要

  • phpVirtualBox という、VirtualBoxのVM設定GUIのWebブラウザから操作できるものを使ってみよう。
  • phpvirtualbox
    A web interface to manage and access Virtualbox machines.

  • Consoleは、Flashプラグインがー、といわれて、使えなかった..

  • Remote Desktopがつかえる。(けど、まだ、ほかのPCからは接続できていない..設定が必要?)

環境

  • ホスト Windows 7 64bit

    • # 実際に確認したのは、Windows 10 64bit 上で、VirtualBoxにて、Windows 7 64bit 動かしたので、そのVMは、32bit OSのみ....
  • 使用ソフト

    • VirtualBox 5.2.8
    • VBoxVmService 5.2
    • Bitnami-XAMPP 7.2.1
    • phpVirtualBox (developブランチの commit-id: e706f2334483a6a2b091cb29baa8872f0d27bbb8 現時点の最新コミット)

手順

インストール

  1. Chocolatey

    1. cmd.exe を管理者で開く
    2. コピペ

      コピペ
      @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
      
    3. cmd は閉じずに次へ

  2. 必要なソフトのインストール(git, VirtualBox, VBoxVmService, xampp)

    こぴぺ
    cinst -y git virtualbox VBoxVmService Bitnami-XAMPP
    
  3. お好みのソフト(エディタ ブラウザなど)をインストール

    こぴぺ
    
    cinst -y VisualStudioCode googlechrome chocolateygui
    
    # エディタ ?
    #cinst -y notepadplusplus
    
    # Vagrant ? 
    #cinst -y vagrant powershell
    
    
  4. Windows 再起動
    とりあえず、ソフトをインストールしたら、ね。

設定

  1. C:\vms\VBoxVmService.ini
    RunWebService=yes

    VBoxVmService.ini
    ...
    RunWebService=yes
    PauseShutdown=5000
    ...
    
  2. C:\xampp\php\php.ini
    "extension=soap"を検索して、先頭の;を外す

    VBoxVmService.ini
    ...
    ;extension=snmp
    
    extension=soap
    ;extension=sockets
    ...
    

phpVirtualBoxのインストール

  1. エクスプローラーで、C:\xampp\htdocs フォルダを開く
  2. 空いているところで、右クリックして、Git Bash Here
  3. gitクローンして、config.phpの準備

    #クローン
    git clone https://github.com/phpvirtualbox/phpvirtualbox
    
    # 移動
    cd ./phpvirtualbox
    
    # 設定をコピー
    cp -v config.php-example config.php
    
  4. C:\xampp\htdocs\phpvirtualbox\config.php を編集
    Windowsのユーザ名、パスワードを設定

    設定例
    ...
    /* Username / Password for system user that runs VirtualBox */
    //var $username = 'vbox';
    //var $password = 'pass';
    var $username = 'vagrant';
    var $password = 'vagrant';
    ...
    

その他設定

  1. cmd.exeを管理者で開いて、以下コピペ。
cmdにコピペ
rem VirtualBoxの認証関係?の設定
C:
cd "\Program Files\Oracle\VirtualBox"
VBoxManage setproperty vrdeauthlibrary default
VBoxManage setproperty websrvauthlibrary default


rem VmServiceControlをサービスとして登録(されてると思うけど)
cd "\vms"
VmServiceControl.exe -i
VmServiceControl.exe -k
VmServiceControl.exe -s

rem Apacheをサービスとして登録
cd "\xampp\apache"
apache_installservice.bat 

実行

  1. ブラウザを開いて、http://<インストールしたPCのipアドレス>/phpvirtualbox にアクセス。
    -例1 (インストールしたPCでのブラウザ): http://localhost/phpvirtualbox

  2. ユーザ名 / 初期パスワードは、admin / admin にてログイン.
    image.png

  3. うまくいくとこんな感じ
    image.png

その他

  • File > Preferences > Languageから、日本語を設定したら... こんなエラーに。(ほかの言語でもだめっぽい?)
    クッキーをクリアしよう..(Chromeだったら、Ctrl+Shift+Del) image.png
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1