misc.log

日常茶飯事とお仕事と

Sun xVM VirtualBoxを試してみる

www.virtualbox.org

Sunが配布している仮想PC運用環境、VirtualBoxを試してみることにした。VMWareの便利さと普及によるノウハウの蓄積は有用だけど、有償であることがネックで手が出ない人、VirutalPCはWindows以外ではちょっと...という人向けの無償環境としては良いのではないかと思って。

ダウンロードは「http://www.virtualbox.org/wiki/Downloads」から行え、現時点ではVersion 2.1.0がWindowsLinuxSolarisOS X用として配布されている。早速x86用のWindows版をダウンロードして、WindowsXP(32bit日本語版、Core2Duoで稼働、VT=On)にインストールしてみる。インストール後に表示される「ようこそVirtualBox登録フォームへ!」でいきなりエラー。Sunにユーザー登録するのに入力した氏名とメールアドレスの発送で、Connection refusedと表示されてしまった。特にネットワークの設定も間違っていないし、VirtualBox自体にはそのような設定もないみたい。

とりあえずそこはパスして新規のVM作成などは行えたので、そのまま先に進んでみる。

Windows 2000 Professionalを選ぶ

実際の業務で、ウチの会社が直面しがちなのは新しい技術よりもむしろ「過去の案件のサポートを行いたいけど環境が無い」というもの。というわけでWindows 2000を選んでインストールしてみることにした。新しいバーチャルマシンの作成という項目を選ぶ中で、OSを聞いてくる。そこにもきちんとWindows 2000は掲載されている(なんとWindows 3.1まで載っている)。
というわけで、早速メディアを入れて起動。一通りの作業を終え、シリアルナンバーも入れて....

再起動。

またやってみる。シリアルナンバーも入れて....再起動。なんでー??4回目でヘルプを見てみる。

11.2.2. Windows 2000 installation failures
When installing Windows 2000 guests, you might run into one of the following issues:

  • Installation reboots, usually during component registration.
  • Installation fills the whole hard disk with empty log files.
  • Installation complains about a failure installing msgina.dll.

These problems are all caused by a bug in the hard disk driver of Windows 2000. After issuing a hard disk request, there is a race condition in the Windows driver code which leads to corruption if the operation completes too fast, i.e. the hardware interrupt from the IDE controller arrives too soon. With physical hardware, there is a guaranteed delay in most systems so the problem is usually hidden there (however it should be possible to reproduce it on physical hardware as well). In a virtual environment, it is possible for the operation to be done immediately (especially on very fast systems with multiple CPUs) and the interrupt is signaled sooner than on a physical system. The solution is to introduce an artificial delay before delivering such interrupts. This delay can be configured for a VM using the following command:


VBoxManage setextradata VMNAME
"VBoxInternal/Devices/piix3ide/0/Config/IRQDelay" 1


This sets the delay to one millisecond. In case this doesn't help, increase it to a value between 1 and 5 milliseconds. Please note that this slows down disk performance. After installation, you should be able to remove the key (or set it to 0).

まぁ要するに、本来のハードウェアだと想定されていたIDEバイスへの問いかけに対する応答のディレイが、仮想環境だと非常に短いために動作が狂ってしまっていると。で、VirtualBoxの管理コマンドでディレイを噛ますパラメータを設定すればOK。

このコマンドを発行するには、VirtualBoxの命令にパスが届いていないと行けないので、面倒であればコマンドプロンプトからVirtualBoxがインストールされているフォルダまで移動して実行すればOK。VMNAMEのところには、仮想PC作成時に設定したバーチャルマシンの名前、空白が入っているならダブルクォートで囲って記入すればOK。

この設定を行ったあと、インストール作業がループしているバーチャルマシンを一旦リセットして実行しなおせばうまくいく。そのまま異常動作の中で勝手に起きる再起動では、上記命令で打ち込んだパラメータは読み込まれないようなので注意が必要。

それにしても、わざわざこんなトラブルがあるゲストOSを選ぶとは、自分もなかなかインストールが下手だなぁと再認識。

無償なのか?

「個人または評価用途であれば、バイナリー版の利用が無償で可能」とあるが、これは業務用で自分のPCに入れて使う場合にも適用できるのだろうか?

Licensing: FAQ, #6


What exactly do you mean by personal use and academic use in the Personal Use and Evaluation License?


Personal use is when you install the product on one or more PCs yourself and you make use of it (or even your friend, sister and grandmother). It doesn't matter whether you just use it for fun or run your multi-million euro business with it. Also, if you install it on your work PC at some large company, this is still personal use. However, if you are an administrator and want to deploy it to the 500 desktops in your company, this would no longer qualify as personal use. Well, you could ask each of your 500 employees to install VirtualBox but don't you think we deserve some money in this case? We'd even assist you with any issue you might have.


Use at academic institutions such as schools, colleges and universities by both teachers and students is covered. So in addition to the personal use which is always permitted, academic institutions may also choose to roll out the software in an automated way to make it available to its students and personnel.

大規模企業いの職場PCの自分のPCにインストールして使う、これは個人利用の範囲と書いてある。でも、管理者として500台のPCに導入して利用する場合、これはもう個人利用とは言えないとある。