Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Windows 10 qemu/kvm guest win/fails...

  1. #1
    Join Date
    Sep 2012
    Ubuntu Gnome 17.04 Zesty Zapus

    Thumbs up Windows 10 qemu/kvm guest win/fails...

    Starting a thread on the successes or otherwise with Windows 10 qemu/kvm guests, please share your results/recommendations....

    I current run Windows 7 Ultimate in a qemu/kvm guest using legacy Seabios...this is primarily my corp desktop. I qualified for the free upgrade to Windows 10 so I've been playing around with various solutions pre and post official release.

    Windows 10 Pre-Release (Insider Previews / Technical Previews)

    • Very early Tech Prev seemed to work fine using the available virtio drivers from redhat.
    • However the later Insider Preview releases caused me some headaches

    Windows 10 Official-Release (clean installation from .iso file)

    • Used the media creation tool MS released to download the installation media (.iso)
    • Used the latest OVMF build from here
    • Configured the guest to copy my host CPU specs and set the topology for 1x socket, 2x cores, 2x threads. (lshw: Intel(R) Core(TM) i7-4790S CPU @ 3.20GHz)
    • Used the IDE bus for the windows .iso installation media and the virtio drivers (grabbed the latest from
      • NOTE: I used the win8.1 amd64 virtio drivers, no complaints or issues noticed thus far

    • This pretty much gives me a functional Windows 10 qemu/kvm guest which seems as per-formant as my Windows 7 legacy.

    The problem is you can't just activate the Windows 10 clean installation using the Windows 7 Product Key...Microsoft want you to upgrade your earlier version to qualify for the free Windows 10 copy (see

    Windows 10 Official-Release (upgrade from Windows 7)

    • Firstly, the Windows 10 upgrade tool in the taskbar of my Windows 7 guest said my hardware wasn't compatible because of the 'Redhat Display Adapter'
      • You have to force the issue here by using the media creation tool and creating either an .iso (as per above) or a USB installer, either is fine just execute the setup program from the media to bypass the upgrade tool

    • So this is where I start getting issues

    EDIT (2nd Aug @ 19:43)

    • So I attempted a clean install of Windows 7 first, turns out that Win7 boot is buggy when using OVMF as it consistently powers off shortly after the windows boot logo appears. I can't find the trigger for the bug but by altering the CPU config for the guest you can get a successful boot i.e. switch the processor type after each failed boot...however rebooting after a successful boot seems to causes the issue again...I just keep switching guest processor settings to workaround this.
    • Anyways for this test I persisted, completed the install and got to Win7 desktop...applied the virtio drivers etc but didn't do any windows updates.
    • I used the .iso install media I created from the prior tests and ran the executable
    • The installer does its stuff, completes its first pass to 100% (copying files I think)...then it reboots...
    • The (re)boot up looks like windows 10 but then I get a black screen and all activity ceases i.e. no io, cpu cycles etc.
    • I force a restart which (re)boots into Windows 7 and the Windows 10 Upgrade dialogue appears saying "The installation failed in the SAFE_OS phase with an error during BOOT operation."

    EDIT (3rd Aug @ 20:18)

    • Okay so now I'm completely battered...
    • I've tried pretty much every variation/combination of OVMF, SeaBIOS, Q35, i440FX, no virtio drivers, virtio drivers...the same error message presents mid Windows 10 installation which points back to a driver issue.
    • I have a Macbook Pro which I run Parallels on for a Win desktop too, I'd previously upgrade my Windows 8.1 installation to Windows 10 without issue so I moved my Windows 7 vm onto that and upgraded it...without issue.
    • *Work around* found
    • To be fare the setuperr.log on the Windows 10 install contained a lot of detail that I'm sure the right forum could have appraised but I haven't explored that and likely wont.
    • SIDE NOTE: In all my testing with Win7 i could never get Windows Update to work...just kept checking for updates. This was a new problem which I never experienced when using Win7 for my daily tasks, I'm speculating here but I think that MS must check as part of the Windows Update process whether the Product Key as been through an update to Windows 10 previous or not. The reason being is that to test the whole process prior to using kvm/qemu I revived an old physical machine I had spare, put a clean Windows 7 on it, activated and then upgraded it.

    CONCLUSION: For me I'm writing off an upgrade of Windows 7 using kvm/qemu. I've successfully done this using Parallels on my Mac so will move this installation on their, which means I can move my Windows 8.1 installation off my Mac and onto kvm/qemu...which will be my next test.

    EDIT (8th Aug @ 16:44)

    • Maybe someone could try the solution okky found for Windows 8.1 below for upgrading their Windows 7 guest, please post back results if you do.

    Windows 10 Official-Release (upgrade from Windows 8.1)

    EDIT (8th Aug @ 16:31)

    • So a kind forum member (okky-htf) posted their solution for upgrading Windows 8.1 to Windows 10 and its worked for me. See post #2 in this thread for the full details (
    • Summary is to change the CPU type to (core2duo), add a feature flag (nx) and to hide KVM from the guest, then complete the upgrade...once finished you can revert the changes.
      • QEMU: -cpu core2duo,+nx,kvm=off
      • Libvirt:

        <hidden state='on'/>
    <cpu mode='custom' match='exact'>
      <model fallback='allow'>core2duo</model>
      <feature policy='require' name='nx'/>

    • Its possible the 'kvm=off' is superfluous as I'd guess okky is using this as he has an Nvidia VGA passthrough solution. If someone else attempts without this please post a reply with the results.

    CONCLUSION: So the forum has done it again, proves the power of community if you ask me.
    Last edited by KillerKelvUK; August 8th, 2015 at 04:48 PM.

  2. #2
    Join Date
    Aug 2015

    Re: Windows 10 qemu/kvm guest win/fails...

    Hi, KillerKelvUK!

    Just want to share my experience which I think we have similarities. I know it sounds silly, but try changing the CPU model to "core2duo,+nx,kvm=off" just before executing the update. Yes, you read that right, "core2duo" My Windows 8.1 always crashed when trying to update to Windows 10, something saying about thread not safe. After I changed the CPU model to "core2duo,+nx,kvm=off" the update went smoothly. After I successfully updated to Windows 10, I changed back the CPU model to "host,kvm=off" and it never crashes again when booting.

    For the sake of completeness, here's my QEMU script.

    # QEMU name and PID
    OPTS="-name windows-10-pro"
    OPTS="$OPTS -pidfile /tmp/"
    # Processor
    OPTS="$OPTS -cpu host,kvm=off"
    OPTS="$OPTS -smp 8,sockets=1,cores=4,threads=2"
    OPTS="$OPTS -enable-kvm"
    # Machine
    OPTS="$OPTS -machine type=pc-i440fx-2.1,accel=kvm"
    #OPTS="$OPTS -machine type=q35,accel=kvm"
    # The following setting enables S3 (suspend to RAM). OVMF supports S3
    # suspend/resume. Disable when using Q35
    OPTS="$OPTS -global PIIX4_PM.disable_s3=0"
    # Memory
    OPTS="$OPTS -m 16G"
    OPTS="$OPTS -mem-path /dev/hugepages"
    OPTS="$OPTS -mem-prealloc"
    OPTS="$OPTS -balloon none"
    # Hardware clock
    OPTS="$OPTS -rtc clock=host,base=utc"
    # Sound hardware
    export QEMU_AUDIO_DRV=pa
    OPTS="$OPTS -soundhw hda"
    # Graphic card passthrough (Gigabyte GeForce GTX 980 G1 Gaming)
    OPTS="$OPTS -device vfio-pci,host=01:00.0,multifunction=on"
    OPTS="$OPTS -device vfio-pci,host=01:00.1"
    # USB 3.0 passthrough (NEC/Renesas)
    OPTS="$OPTS -device vfio-pci,host=03:00.0"
    # USB 2.0 passthrough (NEC)
    OPTS="$OPTS -device vfio-pci,host=0a:01.0"
    # Keyboard layout
    OPTS="$OPTS -k en-us"
    # Boot priority
    OPTS="$OPTS -boot order=c"
    # OVMF
    OPTS="$OPTS -drive if=pflash,format=raw,readonly,file=/data/machines/windows-10-pro/ovmf/OVMF_CODE-pure-efi.fd"
    OPTS="$OPTS -drive if=pflash,format=raw,file=/data/machines/windows-10-pro/ovmf/OVMF_VARS-pure-efi.fd"
    # System drive
    OPTS="$OPTS -drive id=disk0,if=none,cache=unsafe,format=raw,file=/data/machines/windows-10-pro/disks/disk0-system.img"
    OPTS="$OPTS -device driver=virtio-scsi-pci,id=scsi0"
    OPTS="$OPTS -device scsi-hd,drive=disk0"
    # 1st Game drive
    OPTS="$OPTS -drive id=disk1,if=none,cache=none,aio=native,format=raw,file=/dev/disk/by-id/ata-Hitachi_HDS721050CLA660_JP1570FR1ZWP7K"
    OPTS="$OPTS -device driver=virtio-scsi-pci,id=scsi1"
    OPTS="$OPTS -device scsi-hd,drive=disk1"
    # 2nd Game drive
    OPTS="$OPTS -drive id=disk2,if=none,cache=none,aio=native,format=raw,file=/dev/disk/by-id/ata-Hitachi_HDS5C3020ALA632_ML0220F30NX2DD"
    OPTS="$OPTS -device driver=virtio-scsi-pci,id=scsi2"
    OPTS="$OPTS -device scsi-hd,drive=disk2"
    # Windows 10 Pro installer
    OPTS="$OPTS -drive id=cd0,if=none,format=raw,readonly,file=/data/iso/OS/Windows10Pro/Windows_10_Professional_64_Bit.iso"
    OPTS="$OPTS -device driver=ide-cd,bus=ide.0,drive=cd0"
    # Virtio driver
    OPTS="$OPTS -drive id=virtiocd,if=none,format=raw,file=/data/iso/VirtIO/virtio-win-0.1.105.iso"
    OPTS="$OPTS -device driver=ide-cd,bus=ide.1,drive=virtiocd"
    # OVMF emits a number of info / debug messages to the QEMU debug console, at
    # ioport 0x402. We configure qemu so that the debug console is indeed
    # available at that ioport. We redirect the host side of the debug console to
    # a file.
    #OPTS="$OPTS -global isa-debugcon.iobase=0x402 -debugcon file:/tmp/windows_10_pro.ovmf.log"
    # QEMU accepts various commands and queries from the user on the monitor
    # interface. Connect the monitor with the qemu process's standard input and
    # output.
    OPTS="$OPTS -monitor stdio"
    # A USB tablet device in the guest allows for accurate pointer tracking
    # between the host and the guest.
    OPTS="$OPTS -device piix3-usb-uhci -device usb-tablet"
    # Network
    OPTS="$OPTS -netdev tap,vhost=on,ifname=$VM,script=/usr/local/bin/vm_ifup_brlan,id=brlan"
    OPTS="$OPTS -device virtio-net-pci,mac=52:54:00:xx:xx:xx,netdev=brlan"
    # Disable display
    #OPTS="$OPTS -vga qxl"
    OPTS="$OPTS -vga none"
    OPTS="$OPTS -serial null"
    OPTS="$OPTS -parallel null"
    #OPTS="$OPTS -monitor none"
    OPTS="$OPTS -display none"
    #OPTS="$OPTS -daemonize"
    # QEMU Guest Agent
    OPTS="$OPTS -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0"
    OPTS="$OPTS -device virtio-serial"
    OPTS="$OPTS -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0"
    sudo taskset -c 0-7 qemu-system-x86_64 $OPTS
    For the record, my distro is Arch Linux. Good luck!

  3. #3
    Join Date
    Sep 2012
    Ubuntu Gnome 17.04 Zesty Zapus

    Re: Windows 10 qemu/kvm guest win/fails...

    Hi okky, thanks for the share...have made the changes to my 8.1 guest and attempting this now...fingers crossed

  4. #4
    Join Date
    Sep 2012
    Ubuntu Gnome 17.04 Zesty Zapus

    Re: Windows 10 qemu/kvm guest win/fails...

    Hey hey hey...okky rocks, it worked first time after making the changes. Thank you kind person!

  5. #5
    Join Date
    Aug 2015

    Re: Windows 10 qemu/kvm guest win/fails...

    Hi, glad it worked for you too!
    I think I still save the Windows 8.1 image before the upgrade, let me try it with just "core2duo" tonight.
    Just as you have suspected, the "kvm=off" flag is a workaround for my NVIDIA GPU, I need it so I can passthrough it without NVIDIA driver block it.
    As for the "+nx" flag, it was there after a lot of googling trying to work out the crash, probably not needed also.

  6. #6
    Join Date
    Aug 2008

    Re: Windows 10 qemu/kvm guest win/fails...

    Has anyone had success with the QEMU guest agent in win 10?

  7. #7
    Join Date
    Aug 2015

    Re: Windows 10 qemu/kvm guest win/fails...

    hello everyone, I managed to update my 8.1 VM to Windows 10, by just setting the CPU type to core2duo and the CPU count to 2.

    After the update was over I was able to restore the number of CPU's to 8. I also tried to change the CPU type to Haskel, Nehalem and kvm64 without any success. Each time the VM boots it shuts down with an error complaining about an uncaught thread exception.

    Anyway, the final result is that it works so thanks a lot guys for the help.

  8. #8
    Join Date
    Sep 2012
    Ubuntu Gnome 17.04 Zesty Zapus

    Re: Windows 10 qemu/kvm guest win/fails...

    Quote Originally Posted by chaseadam View Post
    Has anyone had success with the QEMU guest agent in win 10?
    Been wanting to give guest agent a try for a while so thought I'd use you as my excuse

    As this is new to me I'll explain what I did to make me think I have it working...

    • Installed the windows qemu guest agent package from the fedora virtio drivers located here
    • Used virt-manager and added the guest agent channel 'org.qemu.guest_agent.0' as a pty device, the libvirt xml looks like this...

        <channel type='pty'>
          <target type='virtio' name='org.qemu.guest_agent.0'/>
          <address type='virtio-serial' controller='0' bus='0' port='2'/>
    • When the guest is run the source path for the channel is created which for me was pointing to '/dev/pts/7'
    • used socat on my host to connect to the serial device so I can interact with the guest agent. My command was 'sudo socat /dev/pts/7 -' the "-" on the end was important but I don't understand its significance yet.
    • That was it, the below is me issuing some commands into the agent from my host...

    kelvin@blackserver:~$ sudo socat /dev/pts/7 -
    {"execute": "guest-info"}
    {"return": {"version": "0.12.1", "supported_commands": [{"enabled": true, "name": "guest-set-vcpus"}, {"enabled": true, "name": "guest-get-vcpus"}, {"enabled": true, "name": "guest-network-get-interfaces"}, {"enabled": true, "name": "guest-suspend-hybrid"}, {"enabled": true, "name": "guest-suspend-ram"}, {"enabled": true, "name": "guest-suspend-disk"}, {"enabled": true, "name": "guest-fstrim"}, {"enabled": true, "name": "guest-fsfreeze-thaw"}, {"enabled": true, "name": "guest-fsfreeze-freeze"}, {"enabled": true, "name": "guest-fsfreeze-status"}, {"enabled": true, "name": "guest-file-flush"}, {"enabled": true, "name": "guest-file-seek"}, {"enabled": true, "name": "guest-file-write"}, {"enabled": true, "name": "guest-file-read"}, {"enabled": true, "name": "guest-file-close"}, {"enabled": true, "name": "guest-file-open"}, {"enabled": true, "name": "guest-shutdown"}, {"enabled": true, "name": "guest-info"}, {"enabled": true, "name": "guest-set-time"}, {"enabled": true, "name": "guest-get-time"}, {"enabled": true, "name": "guest-ping"}, {"enabled": true, "name": "guest-sync"}, {"enabled": true, "name": "guest-sync-delimited"}]}}
    {"execute": "guest-shutdown"}
    I couldn't get the binary 'qemu-ga' to connect and interact in the same way as 'socat', this is likely user error as I'm still learning this. Also a lot of the online material says that the virtio-serial device will be created under '/dev/virtio-ports/' (e.g. however I could not replicate this, instead it was the virt-manager console which populated the source path for the channel device (/dev/pts/7) when the guest was started.

    Final point is that fedora have released updated virtio drivers for windows 10 so I'd start with these, for the above I was still using the 105 release and installing the win8.1/amd64 drivers. EDIT: Mis-read the changelog, there is an updated virtio driver set but this isn't a win10 release.
    Last edited by KillerKelvUK; August 15th, 2015 at 03:52 PM.

  9. #9
    Join Date
    Aug 2015

    Re: Windows 10 qemu/kvm guest win/fails...

    Quick report about another successful upgrade from Windows 8.1 to Windows 10 with additional problems.

    Thanks to okky-htf's post I've also managed to get the Windows 10 Upgrade started (from Win8.1, having a bluescreen during after the first reboot).
    But I got stuck after the next reboot. He starts "Installing features and drivers", reboots suddenly without a message or bluescreen after staying a while at 32% / 6% and afterwards he reverts the installation.

    What I did: change CPU to core2duo, tried both 4 cores and 2 cores
    What might have helped: changing to my original setup directly after the next reboot (using core2duo exactly for one bootup) or updating the virtio scsi, network and serial drivers from 0.1.100 to 0.1.109.

    Other data: i440fx mainboard, virtio-blk hdd, AMD GPU passthrough, no kvm-hiding needed

    Now I can log in to Windows 10... thanks!

  10. #10
    Join Date
    Feb 2012

    Re: Windows 10 qemu/kvm guest win/fails...

    Hi KillerKelvUK,

    Thank you so much for your detailed documentation about Windows 10 in KVM. I have struggled with it for a week and it seems there is very little discussion about this topic.

    Anyway I would like to post my success with upgrading from Windows 7 to Windows 10 in KVM.

    I set my processor to be core2duo, +nx and Storage to be on IDE bus. I tried to upgrade using virtio driver it will go BSOD when rebooted. Upon that stage, I tried to switch all different kind of drivers and none of them can successfully revive Windows 10.

    I had one other try, I used Virtualbox to boot Windows 7 and upgrade from there. And when it can successfully upgrade to Win10, it will show Invalid Boot Device error when switching back to KVM no matter what driver is used.

    I was about to give up but one last try using IDE emulation in Win7 before any part of the upgrading took place. And the upgrading process was perfect.

    FYI my disk configuration is as follows:
    <disk type='block' device='disk'>
    <driver name='qemu' type='raw' cache='none' io='native'/>
    <source dev='/dev/baishi/win10'/>
    <target dev='hda' bus='ide'/>
    <address type='drive' controller='0' bus='0' target='0' unit='0'/>

    My conclusion, it seems that during upgrading, Windows tried to disable some drivers (especially virtio driver for Win7) and the KVM SATA driver is not proper enough for Windows to prepare proper SATA driver in Win10 and thus it will fail to boot up.

    Just documenting my experience and hope it can help some other poor soul.

Page 1 of 2 12 LastLast

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts