Lunes, 25 Marzo 2013 00:17

Convertir maquinas virtuales de Microsoft Virtual PC a KVM

Valora este artículo
(0 votos)

Lo primero es conocer el hardware que tiene instalado la maquina virtual que deseemos migrar, el Virtual PC tiene unos ficheros de configuración por maquina con la extensión .vmc que están codificados en UTF16 los tenemos que convertir para poder abrirlos con el siguiente comando:

iconv -f utf-16 -t utf-8 origen.vmc |dos2unix >origen.xml

Donde podemos ver la memoria “ram_size”, el tipo de tarjeta de red  “virtual_network” su mac ”ethernet_card_address” los discos duros instalados “ide_controller” y cualquier otro hardware adicional necesario.

Un fichero de ejemplo:

Ver código
  1. <?xml version="1.0" encoding="UTF-16"?>
  2. <!-- Microsoft Virtual Machine Options and Settings -->
  3. <preferences>
  4.         <version type="string">2.0</version>
  5.         <alerts>
  6.                 <notifications>
  7.                         <no_boot_disk type="boolean">true</no_boot_disk>
  8.                 </notifications>
  9.         </alerts>
  10.         <hardware>
  11.                 <memory>
  12.                         <ram_size type="integer">650</ram_size>
  13.                 </memory>
  14.                 <pci_bus>
  15.                         <ethernet_adapter>
  16.                                 <controller_count type="integer">1</controller_count>
  17.                                 <ethernet_controller id="0">
  18.                                         <virtual_network>
  19.                                                 <id type="bytes">xxxxxxxxxxxxxxxxxxxxxxxx</id>
  20.                                                 <name type="string">Realtek RTL8168C(P)/8111C(P) PCI-E Gigabit Ethernet NIC</name>
  21.                                         </virtual_network>
  22.                                         <ethernet_card_address type="bytes">001122334455</ethernet_card_address>
  23.                                 </ethernet_controller>
  24.                         </ethernet_adapter>
  25.                         <video_adapter>
  26.                                 <vram_size type="integer">8</vram_size>
  27.                         </video_adapter>
  28.                         <ide_adapter>
  29.                                 <ide_controller id="1">
  30.                                         <location id="0">
  31.                                                 <drive_type type="integer">2</drive_type>
  32.                                                 <pathname>
  33.                                                         <absolute type="string" />
  34.                                                         <relative type="string" />
  35.                                                 </pathname>
  36.                                         </location>
  37.                                 </ide_controller>
  38.                                 <ide_controller id="0">
  39.                                         <location id="0">
  40.                                                 <drive_type type="integer">1</drive_type>
  41.                                                 <pathname>
  42.                                                         <absolute type="string">C:\origen.vhd</absolute>
  43.                                                         <relative type="string">.origen.vhd</relative>
  44.                                                 </pathname>
  45.                                                 <undo_pathname>
  46.                                                         <absolute type="string" />
  47.                                                         <relative type="string" />
  48.                                                 </undo_pathname>
  49.                                         </location>
  50.                                 </ide_controller>
  51.                         </ide_adapter>
  52.                 </pci_bus>
  53.                 <standard>
  54.                         <name type="string">Virtual PC 2007</name>
  55.                         <version type="string">0001.0000.0000</version>
  56.                 </standard>
  57.                 <super_io>
  58.                         <floppy id="0">
  59.                                 <pathname>
  60.                                         <absolute type="string" />
  61.                                         <relative type="string" />
  62.                                 </pathname>
  63.                         </floppy>
  64.                         <floppy>
  65.                                 <auto_detect type="boolean">true</auto_detect>
  66.                         </floppy>
  67.                         <parallel_port>
  68.                                 <port_shared type="boolean">false</port_shared>
  69.                                 <port_type type="integer">0</port_type>
  70.                         </parallel_port>
  71.                         <serial_port>
  72.                                 <connect_immediately type="boolean">false</connect_immediately>
  73.                         </serial_port>
  74.                 </super_io>
  75.                 <bios>

Luego una vez localizadas las imágenes la convertimos con

qemu-img convert -f vpc -O raw origen.vhd destino.img

en algunas distribuciones se usa esta otra forma:

kvm-img convert -f vpc -O raw origen.vhd destino.img

Ahora ya podemos crear la maquina virtual con todos los parámetros necesarios, en caso de ser una maquina virtual Windows se tendrá que realizar unos pasos porque de otro modo no funcionara.

  • Necesitamos arrancar con un CD de utilidades del estilo de Hiren's Boot y arrancar el mini Windows XP y luego ejecutar el dentro del menú Registy la opción Fix hard disk controller (fix_hdc.cmd) para no ver el pantallazo azul nada mas arrancar, porque el Windows tiene la manía de crear un registro especial desde de donde se instala lo maquina.
  • Desinstalar el programa Virtual Machine Addditions
  • En caso de que el ratón dentro de la maquina virtual deje de funcionar habrá que eliminar la opción de tablea gráfica USB EVTouch
Leer 4965 veces Modificado por última vez en Viernes, 29 Marzo 2013 13:05

Escribir un comentario


Código de seguridad
Refescar