Posted: . At: 11:46 PM. This was 10 years ago. Post ID: 7091
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to install Windows 7 in a qemu KVM virtual machine and enjoy a fast Windows desktop in a window.

The qemu KVM hypervisor allows a Linux user to install a virtualized operating system that will run very fast indeed once installed.

To install the qemu KVM hypervisor; enter this command.

sudo apt-get install qemu-kvm qemu-utils

Then create a raw disk image to house your Windows operating system.

qemu-img create -f raw win7.img 30G

This will take no time at all and this will only require special drivers to be loaded with the hypervisor to enable Windows to use the raw disk image.

Download the ISO image here: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso. This is loaded by our script to load our complete hypervisor setup.

Here is our script. I am using a Windows 7 Ultimate ISO I had on my hard disk. This is installed in the VM.

#!/bin/sh
 
export QEMU_AUDIO_DRV=alsa
DISKIMG=~/win7.img
WIN7IMG=~/Downloads/win7.iso
VIRTIMG=~/Downloads/virtio-win-0.1-81.iso
qemu-system-x86_64 --enable-kvm -drive format=raw,file=${DISKIMG},if=virtio -m 4096 \
-net nic,model=virtio -net user -cdrom ${WIN7IMG} \
-drive file=${VIRTIMG},index=3,media=cdrom \
-rtc base=localtime,clock=host -smp cores=4,threads=4 \
-usbdevice tablet -soundhw ac97 -cpu host -vga vmware

Once the Virtual Machine has started, and you get to the disk partitioning section, load the drivers from the virtio ISO disk and choose the SCSI driver. This will enable you to partition the drive and continue with the installation. Below is what you should end up with. I know I should not have the crappy Driver Detective software installed, but it is only a VM. The networking drivers are also on the virtio ISO and may be installed after the installation is complete. Just use Device Manager to take care of that. Networking is like Virtualbox in NAT mode. The internal guest OS will have an IP address, but you cannot ping it from the host. But Internet access works like a charm. Installing Firefox is recommended though. Internet Explorer is not very secure.

Windows 7 in the qemu KVM.
Windows 7 in the qemu KVM.

Give this a try and see how you go!

3 thoughts on “How to install Windows 7 in a qemu KVM virtual machine and enjoy a fast Windows desktop in a window.”

  1. It is my config 2021 the best:
    export QEMU_AUDIO_DRV=alsa
    DISKIMG=win7.img
    WIN7IMG=win7.iso
    VIRTIMG=virtio-win-0.1.208.iso
    qemu-system-x86_64 –enable-kvm \
    -drive file=${DISKIMG},index=0,media=disk,format=raw,if=virtio \
    -drive file=${WIN7IMG},index=2,media=cdrom \
    -drive file=${VIRTIMG},index=3,media=cdrom \
    -nic user,model=virtio-net-pci \
    -rtc base=localtime,clock=host -smp cpus=8 \
    -usbdevice tablet -device AC97 -cpu max -vga virtio \
    -boot order=d -m 8096

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.