Convert XEN image files to VirtualBox image files: различия между версиями

Материал из support.qbpro.ru
imported>Vix
Нет описания правки
imported>Vix
Нет описания правки
 
(не показана 1 промежуточная версия этого же участника)
Строка 23: Строка 23:
Let's assume that we have raw image of the sdb device:
Let's assume that we have raw image of the sdb device:


$ sudo dd if=/dev/sdb of=./sdb.raw
$ sudo dd if=/dev/sdb of=./sdb.raw


To use it with VirtualBox we need to convert it to the VDI format:
To use it with VirtualBox we need to convert it to the VDI format:


$ VBoxManage convertdd sdb.raw sdb.vdi --format VDI
$ VBoxManage convertdd sdb.raw sdb.vdi --format VDI


To use it with VMware we need to convert it to the VMDK format:
To use it with VMware we need to convert it to the VMDK format:


$ VBoxManage convertdd sdb.raw sdb.vmdk --format VMDK
$ VBoxManage convertdd sdb.raw sdb.vmdk --format VMDK


Convert between VDI/VMDK formats:
Convert between VDI/VMDK formats:


$ VBoxManage clonehd sdb.vdi sdb.vmdk --format VMDK
$ VBoxManage clonehd sdb.vdi sdb.vmdk --format VMDK


$ VBoxManage clonehd sdb.vmdk sdb.vdi --format VDI
$ VBoxManage clonehd sdb.vmdk sdb.vdi --format VDI


Convert to the RAW image:
Convert to the RAW image:


$ VBoxManage clonehd sdb.vdi sdb.raw --format RAW
$ VBoxManage clonehd sdb.vdi sdb.raw --format RAW


Alternative solution to get back raw image after applying modifications is to use qemu-img command from qemu package:
Alternative solution to get back raw image after applying modifications is to use qemu-img command from qemu package:


$ qemu-img convert -f vmdk sdb.vmdk -O raw sdb.raw
$ qemu-img convert -f vmdk sdb.vmdk -O raw sdb.raw


Now we can write image to the device:
Now we can write image to the device:


$ sudo dd if=./sdb.raw of=/dev/sdb
$ sudo dd if=./sdb.raw of=/dev/sdb


ИСТОЧНИКИ:
<hr>
* [http://blog.sleeplessbeastie.eu/2012/04/29/virtualbox-convert-raw-image-to-vdi-and-otherwise/ взято тут]
* [http://blog.sleeplessbeastie.eu/2012/04/29/virtualbox-convert-raw-image-to-vdi-and-otherwise/ взято тут]
* [http://rat.admin.lv/?paged=2 полезное]

Текущая версия от 18:20, 27 февраля 2019

Пример

VBoxManage convertfromraw -format VDI xenvista.img VBoxVista.vdi

VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Converting from raw image file="xenvista.img" to file="VBoxVista.vdi"...
Creating dynamic image with size 10485760000 bytes (10000MB)...

Пример2

еще один вариант:

VBoxManage convertdd the_disk.img the_disk.vdi

Разные примеры

VirtualBox command-line interface (VBoxManage) provides an easy way to convert raw disk image to the VDI/VMDK format and otherwise.

Let's assume that we have raw image of the sdb device:

$ sudo dd if=/dev/sdb of=./sdb.raw

To use it with VirtualBox we need to convert it to the VDI format:

$ VBoxManage convertdd sdb.raw sdb.vdi --format VDI

To use it with VMware we need to convert it to the VMDK format:

$ VBoxManage convertdd sdb.raw sdb.vmdk --format VMDK

Convert between VDI/VMDK formats:

$ VBoxManage clonehd sdb.vdi sdb.vmdk --format VMDK
$ VBoxManage clonehd sdb.vmdk sdb.vdi --format VDI

Convert to the RAW image:

$ VBoxManage clonehd sdb.vdi sdb.raw --format RAW

Alternative solution to get back raw image after applying modifications is to use qemu-img command from qemu package:

$ qemu-img convert -f vmdk sdb.vmdk -O raw sdb.raw

Now we can write image to the device:

$ sudo dd if=./sdb.raw of=/dev/sdb

ИСТОЧНИКИ: