2

First, some background:

I suppose I've found a bug with KVM, at least on my system.

When I try to install Windows XP via virt-manager, the installer aborts/reboots.

But if I run a raw qemu-system-i386 command (see below), it succeeds.

From looking at the logs in /var/log/libvirt/qemu/..., the key difference is the "accel=kvm" argument (equivalent to -enable-kvm).

So, narrowing it down, this command succeeds:

qemu-system-i386 \
    -m 512 \
    -usb \
    -cdrom path/to/WinXP_CD.iso \
    -boot d \
    "$image"

But this next command results in an infinite series of reboots. The XP installer starts, but after scanning the system, just reboots rather than proceeding:

qemu-system-i386 \
    -enable-kvm \
    -m 512 \
    -usb \
    -cdrom path/to/WinXP_CD.iso \
    -boot d \
    "$image"

Perhaps you don't believe I have KVM working properly on my system. But, I can install other OSes (eg: FreeBSD) using KVM just fine. This seems to be XP-specific.

So now, my questions:

  1. How do I force libvirt to NOT use KVM for a chosen VM? Ideally via virt-manager, but I'm fine with virsh too. I imagine somewhere in the mess of XML is some setting, but I'm not terribly familiar.

  2. aside: any idea where I should log this bug? Against KVM? Libvirt? QEMU?

jwd
  • 10,837
  • 3
  • 43
  • 67

2 Answers2

2

Well, I managed to hack around this, but I'm sure there's a more pretty way.

Basically, that -enable-kvm option corresponds to the type="kvm" value in your domain XML file. See libvirt documentation.

But there seems to be no way to change this from virt-manager. I'm not familiar enough with virsh yet to do it that way either. So, I just manually edited my XML file like so:

$ sudoedit /etc/libvirt/qemu/myxp.xml 

I did this while virt-manager was closed. When I opened it, the setting did not seem to stick. For some reason, I seemed to need to run:

$ sudo virsh define /etc/libvirt/qemu/myxp.xml

to get it to stick.

Anyway, after that little dance, then in virt-manager, in the `Overview' tab for my VM, it says "Hypervisor: QEMU TCG", where it had "KVM" before.

And now, the XP installer works!

Again, probably a better way, but good enough for now.

Presumably, performance will be poorer with KVM disabled. I still don't know who to send a bug, or whether this is a QEMU or KVM issue, at its core.

jwd
  • 10,837
  • 3
  • 43
  • 67
  • All you need to do is type `virsh edit myxp` assuming that's your VM name. Use `virsh list` to list all VMs. Then edit domain like normal. This method will check the edited domain for proper formatting and warn if incorrect, but note, I have had to "force" it before when it said it was incorrect, but it wasn't. I forget what it was, but it was definitely an edge case. – FreeSoftwareServers Aug 20 '19 at 12:21
  • @FreeSoftwareServers: ah, thanks. Yes, I'm already getting familiar with `virsh edit` as I proceed down this path. I get the feeling that the UI is really more of a read-only dashboard; the good stuff is in the config file (as usual :) – jwd Aug 20 '19 at 16:35
  • I'm a big fan of GUI's for VM Management, but yes, Virt-Manager is limited. For advanced features you need the CLI like CPU-Pinning/HugePages Ram/Special Qemu CLI Arguments etc, but most things can be done in Virt-Manager. I also like using Virt-MGR to create VM's then virsh to edit them. – FreeSoftwareServers Aug 22 '19 at 07:10
0

You can change

<domain type="kvm">    

to

<domain type="qemu">    

as as stated in the documentation. To edit xml of VM in virt-manager you should activate xml editing in parameters and press "xml" tab.

tts.035
  • 11
  • 2