Messages in cipher reflected in the looking glass

http://blogs.sun.com/thaniwa/date/20080221 2008年 2月 21日 木曜日

(JA) VirtualBox on 32bit Solaris Express

巷(というかSunのブログ)で話題のVirtualBoxをちょっといじってみました。
私の環境は64bitマシンではなく、32ビットマシンなので、ビルドも行う必要があります。
ということで、メモ書き程度にまとめておきます。
とりあえず、要点は

  • Subversion でソースを取得。
    VirtualBox-1.5.6_OSE.tar.bz2はビルドできません。
    VirtualBox-1.5.6-1_OSE.tar.bz2は試してません。
  • VirtualBoxのサイトのビルド方法では無理
    そのうち更新されるかもしれませんが、ビルド方法が多少変わってます。 (依存するライブラリが変更されている)
  • QT3は自力でコンパイル。
    Solaris 10 Companion の QT3の流用を試みたけど、 QT3のライブラリ依存関係で問題が出たため、これを使ってビルドはできませんでした…。orz

既に先人がいたので、それを参考にしてます。 http://blogs.sun.com/JoeBonasera/entry/using_the_virtualbox_hypervisor_on

QT3のビルド

bash-3.2$ gunzip -c qt-x11-free-3.3.8b.tar.gz | tar xvf -
bash-3.2$ cd qt-x11-free-3.3.8b
bash-3.2$ ./configure -v -prefix /usr/local -platform solaris-g++ -thread \
 -shared -stl -largefile -tablet -sm -disable-sql -qt-imgfmt-jpeg \
 -qt-imgfmt-png -qt-imgfmt-mng -qt-libjpeg -qt-libpng -qt-libmng -qt-zlib
bash-3.2$ export QTDIR=`pwd`
bash-3.2$ export PATH=$PATH":/usr/sfw/bin:/usr/ccs/bin:$QTDIR/bin"
bash-3.2$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/sfw/lib:/usr/ccs/lib:$QTDIR/lib"
bash-3.2$ gmake
bash-3.2$ gmake install


Subversionでソースのダウンロード

svn co http://virtualbox.org/svn/vbox/trunk vbox

プロキシを利用している場合、~/.subversion/servers を次のように変更すれば、 ダウンロード可能。

[global]
# http-proxy-exceptions = *.exception.com, www.internal-site.org
# http-proxy-host = defaultproxy.whatever.com
# http-proxy-port = 7000
http-proxy-host = xxx.xxx.xxx.xxx
http-proxy-port = 8888
# http-proxy-username = defaultusername
# http-proxy-password = defaultpassword
# http-compression = no
# No http-timeout, so just use the builtin default.
# No neon-debug-mask, so neon debugging is disabled.
# ssl-authority-files = /path/to/CAcert.pem;/path/to/CAcert2.pem

VirtualBoxのビルド

作業は bash で行いましょう。

bash-3.2$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/local/lib" QTのディレクトリを追加
bash-3.2$ ./configure --with-qt-dir=/usr/local --with-gcc=/usr/sfw/bin/gcc \
 --with-g++=/usr/sfw/bin/g++ --build-libxml2
bash-3.2$ source env.sh
bash-3.2$ kmk all

VirtualBoxのカーネルドライバのインストール

コンパイルが終わるとカーネルドライバをインストールする必要があります。

bash-3.2$ cd src/VBox/HostDrivers/Support/solaris
bash-3.2$ su
bash-3.2# ./mod.sh
bash-3.2# ln -s /devices/pseudo/vboxdrv\@0:vboxdrv /dev/vboxdrv ←これ重要

mod.sh 内部に定義があるので、たぶん要りませんがうまくいかない場合、 これらも行いましょう。

bash-3.2# add_drv vboxdrv
bash-3.2# chmod a+rw /devices/pseudo/vboxdrv*

後は、念のため、

reboot -- -r 

で再起動。

VirtualBoxの実行

bash-3.2$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/local/lib:/usr/sfw/lib:/usr/ccs/lib"
bash-3.2$ ./env.sh
bash-3.2$ cd out/solaris.x86/release/bin
bash-3.2$ ./VirtualBox

とこんな感じ。

さすがにこれだと面倒なので、自分用の32bit版のパッケージを作るとか、 ビルド用の specファイル(rpm用)を作るとか考えようかと、時間があれば。
こんなのも作ってるし。
http://blogs.sun.com/thaniwa/page/SolarisJa

投稿されたコメント:

コメント
コメントは無効になっています。