VirtualBoxでvdiファイルのコピーを作る方法


MicrosoftのVirtual PC 2007の感覚で仮想ハードディスクのコピーを作りそれに対して新規バーチャルマシンを作ろうとすると、「ハードディスクの登録に失敗した」と言うエラーメッセージが出ます。

右図から分かることは既に登録されているから駄目だとのこと。

これに対する手がかりはユーザマニュアルの「The Virtual Disk Manager」あたり。

3.5. The Virtual Disk Manager
You can also duplicate hard disk image files on the same host to quickly produce a second virtual machine with the same operating system setup. However, you should only make copies of virtual disk images using the utility supplied with VirtualBox; see Section 8.14, “VBoxManage clonevdi”. This is because VirtualBox assigns a unique identity number (UUID) to each disk image, which is also stored inside the image, and will refuse to work with two images that use the same number. If you do accidentally try to reimport a disk image which you copied normally, you can make a second copy using VirtualBox's utility and import that instead.

8.14. VBoxManage clonevdi
This command duplicates a registered virtual hard disk image to a new image file with a new unique identifier (UUID). The new image can be transferred to another host system or imported into VirtualBox again using the Virtual Disk Manager; see Section 3.5, “The Virtual Disk Manager”.
これらの情報で大体の概念は掴めましたが、具体的な記述がないので、かなり試行錯誤しましたが、うまく行きましたので紹介します。 (但しwindowsXP/Vistaの場合)
(1)ウィンドウズの「スタート/すべてのプログラム/アクセサリ」の中の「コマンドプロンプト」を選択します。
(2)表示されたDOS画面で
・Windows Vista --> C:\Users\UserName>
・Windows XP --> C:\Documnet and Settings\UserNamne>  のあとに
cd c:\program files\innotek virtualbox を入力してEnterを押すと
c:\Program Files\innotek VirtualBox> となります。そこでこの>に続いて
vboxmanage clonevdi filename1.vdi filename2.vdi のように入力したらEnter、これで
VirtualBox Command Line〜というのが出たら成功です。
なお filename1.vdiは現存するvdiファイル名 で通常は,VirtualBox\VDIに置かれています。そして filename2.vdiは複製した後のファイル名 です。なお新しく作成されたvdiファイルはVDIフォルダに置かれます。

ここでcdとはchange directoryの意味でウィンドウズ風に言うと「カレントフォルダを変える」と言う命令です。
この複製に必要なファイルは「VBoxManage.exe、VBoxDDU.dll、VBoxRT.dll、VBoxXML.dll」の4個ですので、これらを例えばプロンプトの初期フォルダ(上の例ではC:\Users\Owlnet)にコピペで入れて置くとcdをやらずに済みます。

前のページに戻る    次のページに進む
 

 

Copyright(C) Owlnet All Rights Reserved.