他のVMのイメージ作りたいなぁ。

あまり需要がないのか、ボクのグーグル検索スキルな無いだけなのかよくわからないが直ぐに該当のページが見つからなかったのでメモ書き。


[Ubuntuの場合]

 $ VBoxManage internalcommands converthd -srcformat VDI|VMDK|VHD|RAW -dstformat VDI|VMDK|VHD|RAW 変換前ファイル.VDI|VMDK|VHD|RAW 変換後ファイル.VDI|VMDK|VHD|RAW

[VHDからVDIへの変換例]

 $ VBoxManage internalcommands converthd -srcformat VHD -dstformat VDI hoge.vhd hoge.vdi

これさえ分かれば、残りのパターンも楽勝だね♪

[Windowsの場合]
Windowsは何故かパスが通っていなかったので。

 cd "C:\Program Files\Oracle\VirtualBox"
 VBoxManage.exe internalcommands converthd -srcformat VDI|VMDK|VHD|RAW -dstformat VDI|VMDK|VHD|RAW 変換前ファイル.VDI|VMDK|VHD|RAW 変換後ファイル.VDI|VMDK|VHD|RAW


Ubuntu*1/Windows*2共に変換前/後ファイルの場所は指定できる。


当たり前だけど、コンバートを行うファイルのサイズが大きければ、それなりに時間がかかります。

*1:例:/hdd-image/hoge.vhd /hdd-image/hoge.vdi

*2:例:c:\hdd-image\test.vhd c:\hdd-image\test.vdi