Windows 7 on QEMU/KVM

Installing Windows 7

  1. Create a script that contains
    #!/bin/sh
    export QEMU_AUDIO_DRV=alsa
    DISKIMG=/some/dir/win7.img
    CDROM=/dev/sr0
    VIRTIMG=/some/dir/virtio-win-0.1.126.iso
    qemu-system-x86_64 --enable-kvm \
    -drive file=${DISKIMG},if=virtio
    -m 1500 \
    -cdrom ${CDROM} \
    -drive file=${VIRTIMG},index=3,media=cdrom \
    -net nic,model=virtio -net user \
    -usb -device usb-ehci,id=ehci \
    -device usb-host,vendorid=0x046d,productid=0x082b,bus=ehci.0,port=1 \
    -rtc base=localtime,clock=host -smp cores=1,threads=1 \
    -usbdevice tablet -soundhw ac97 -cpu host -vga std
  2. Browse to ${VIRTIMG} when you are asked about disk driver using virtio
  3. Download and install Realtek AC97

Configurations

Adding USB Device

Configuring Samba

Commands List

References