tech:import_vm_vdi_qcow2
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:import_vm_vdi_qcow2 [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:import_vm_vdi_qcow2 [2026/06/04 13:41] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | Voir document | ||
| + | * import_vm_vdi_qcow2.odt FIXME | ||
| + | |||
| + | # Import VM (VDI QCOW2) | ||
| + | |||
| + | ## VDI vers RAW | ||
| + | |||
| + | ~~~ | ||
| + | $ VBoxManage clonehd --format RAW / | ||
| + | |||
| + | VBoxManage: error: Cannot register the hard disk '/ | ||
| + | VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), | ||
| + | VBoxManage: error: Context: " | ||
| + | ~~~ | ||
| + | |||
| + | ** Cette erreur disparaît en root** | ||
| + | |||
| + | |||
| + | ~~~ | ||
| + | $ time VBoxManage clonehd --format RAW / | ||
| + | |||
| + | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | ||
| + | Clone hard disk created in format ' | ||
| + | |||
| + | real 2m59.942s | ||
| + | user 0m1.272s | ||
| + | sys 0m1.084s | ||
| + | ~~~ | ||
| + | |||
| + | ** Le format RAW de gérant pas le <lang en> | ||
| + | |||
| + | ~~~ | ||
| + | $ ls -lh ~/ | ||
| + | -rw------- 1 root root 8,0G avril 1 11:38 / | ||
| + | -rw------- 1 jibe jibe 1,6G mars 7 14:54 / | ||
| + | ~~~ | ||
| + | |||
| + | ## Conversion RAW vers QCOW2 | ||
| + | |||
| + | ~~~ | ||
| + | $ time qemu-img convert -f raw ~/ | ||
| + | real 2m17.464s | ||
| + | user 0m5.684s | ||
| + | sys 0m26.528s | ||
| + | ~~~ | ||
| + | |||
| + | La taille de l' | ||
| + | ~~~ | ||
| + | $ ls -lh wheezy1.qcow2 | ||
| + | -rw-r--r-- 1 jibe jibe 1,5G avril 1 12:06 wheezy1.qcow2 | ||
| + | ~~~ | ||
| + | |||
| + | ## Conversion OVA / OVF | ||
| + | |||
| + | Un OVA est une archive TAR | ||
| + | ~~~bash | ||
| + | tar xvf plop.ova | ||
| + | ~~~ | ||
| + | |||
| + | Lister les formats pris en charge | ||
| + | ~~~bash | ||
| + | qemu-img -h | tail -n1 | ||
| + | ~~~ | ||
| + | |||
| + | Conversion du VMDK en QCOW2 | ||
| + | ~~~bash | ||
| + | qemu-img convert -O qcow2 plop-disk1.vmdk plop.qcow2 | ||
| + | ~~~ | ||
| + | |||
| + | ## info sur l' | ||
| + | |||
| + | ~~~bash | ||
| + | qemu-img | ||
| + | ~~~ | ||
| + | |||
| + | ## Création d'un VMDK | ||
| + | |||
| + | ~~~bash | ||
| + | wget https:// | ||
| + | xz --decompress Fedora-Cloud-Base-31-1.9.x86_64.raw.xz | ||
| + | qemu-img convert -f raw -O vmdk -o adapter_type=lsilogic, | ||
| + | printf ' | ||
| + | ~~~ | ||
| + | |||
| + | ## Conversion VMDK vers VMDK (VMDK2VMDK) | ||
| + | |||
| + | Par exemple suite à | ||
| + | ~~~bash | ||
| + | openstack image save plop --file plop.vmdk | ||
| + | ~~~ | ||
| + | |||
| + | Conversion VMDK vers VMDK | ||
| + | ~~~bash | ||
| + | qemu-img convert -O vmdk plop.vmdk plop2.vmdk | ||
| + | ~~~ | ||
| + | |||
| + | ## Resize VDI | ||
| + | |||
| + | ~~~winbatch | ||
| + | VBoxManage.exe modifyhd D: | ||
| + | ~~~ | ||
| + | |||
