Rootserver Sponsor

webtropia"

Donations

Please support your operating system's further development:

donate"

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
finottiOffline
Post subject: [Solved] Converting Virtual Box VM to qemu/kvm  PostPosted: 10.11.2016, 19:59



Joined: 2010-09-12
Posts: 493

Status: Offline
I know this is a long shot, but here it goes: I just tried to convert a Virtual Box (Windows) VM to qemu.

I've followed these steps: https://utappia.org/2016/04/20/how-to-m ... rtmanager/

I had no errors during the process and my converted qcow2 HD seems to be OK:

      Code:

finottim83[~/qemu]$ qemu-img check Win7_64bit.qcow2
No errors were found on the image.
540340/542544 = 99.59% allocated, 0.00% fragmented, 0.00% compressed clusters
Image end offset: 35417423872


finottim83[~/qemu]$ qemu-img info Win7_64bit.qcow2
image: Win7_64bit.qcow2
file format: qcow2
virtual size: 33G (35556163584 bytes)
disk size: 33G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false



I made sure that my "Disk Bus" is "VirtIO" and the format is qcow2.

But I get "No bootable device." error message. (I'm using virt-manager, BTW.)

You can see some configurations of the VM here:

      Code:

finottim83[~/qemu]$ virsh -c qemu:///system dumpxml win7
<domain type='kvm'>
  <name>win7</name>
  <uuid>3f0ed739-cdd3-4a5d-8423-615730687e26</uuid>
  <memory unit='KiB'>20578304</memory>
  <currentMemory unit='KiB'>20578304</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
    <vmport state='off'/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Haswell-noTSX</model>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
    <timer name='hypervclock' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/home/finotti/qemu/Win7_64bit.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:f5:da:18'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'>
      <listen type='address'/>
      <image compression='off'/>
    </graphics>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='3'/>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>


I could install a Debian ISO into a new VM without problems.

Here is some info on the system:

      Code:

finottim83[~/qemu]$ infobash -v3
Host/Kernel/OS  "finottim83" running Linux 4.8.0-6.slh.1-aptosid-amd64 x86_64 UEFI64 [ aptosid 2013-01 Ἑσπερίδες - kde-full - (201305050307) ]
CPU Info        8x Intel Core i7-4790 @ 8192 KB cache flags( sse3 ht nx lm vmx ) clocked at [ 3694.262 MHz ]
Videocard       Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller  X.Org 1.18.4  [ 1920x1200@59.95hz, 1280x1024@60.02hz ]
Network cards   Intel I217-LM
Processes 334 | Uptime 23:03 | Memory 7196.3/31977.3MB | HDD Crucial_CT512M55,WDC WD5000AAKX-0,ATAPI-6 Bridge C Size 2012GB (23%used) | Client Shell | Infobash v3.50


Any ideas or suggestions?


Last edited by finotti on 11.11.2016, 18:38; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: Converting Virtual Box VM to qemu/kvm  PostPosted: 10.11.2016, 22:18



Joined: 2010-09-12
Posts: 493

Status: Offline
OK, after further inspection, it seems like my qcow2 disk was corrupted. I repeated the process and now I get to boot. Now the problem is that I cannot boot into Windows. It takes me to "Windows failed to start. A recent hardware or software change might be the cause." I cannot "start windows normally" as it gives me BSOD (quickly) and goes back to the recovery screen. When I choose "Launch start up repair", I cannot fix it with "start up repair".

It seems like a lost cause, but if anyone has suggestions, I'd appreciate it...
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: Converting Virtual Box VM to qemu/kvm  PostPosted: 10.11.2016, 22:45



Joined: 2010-08-25
Posts: 962

Status: Offline
Windows doesn't provide VirtIO drivers, so you need to use non-VirtIO drivers (e.g. IDE) first to install the required drivers. There might also be (driver) conflicts with eventually installed VirtualBox guest support.

The same goes for a fresh windows installation using VirtIO drivers, just that the windows installer offers you to provide the required drivers just before selecting your target disks.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject: RE: Converting Virtual Box VM to qemu/kvm  PostPosted: 11.11.2016, 18:38



Joined: 2010-09-12
Posts: 493

Status: Offline
Thanks!!! That did it! All seems to be working now.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio