I am trying to install windows 7 64bit as a kvm guest. I read here that I should install the virtio scsi driver during installation.
I use virt-install
to start my installation from the command line
virt-install --connect qemu:///system \
--name win7vnc --ram 2048 --vcpus=2 --cpuset=auto \
--disk path=win7.img,bus=virtio
--network=network=default,model=virtio,mac=RANDOM
--graphics vnc,port=5900
--disk device=cdrom,path=../../isos/virtio-win-0.1-81.iso
--disk device=cdrom,path=../../isos/win7_sp1_ult_64bit/Windows\ 7\ SP1\ Ultimate\ \(64\ Bit\).iso
--os-type=windows --os-variant=win7 --boot cdrom,hd
The installation start fine and as expected windows do not detect a hard disk. So I load driver and the disk is indeed detected. The problem is it only has 99MB capacity, while I created the disk to be 100GB with the command
qemu-img create -f qcow2 win7.img 100G
what could be wrong and the capacity is not correct?
EDIT: picture of the problem
in the end, i set disk settings as if I will create a new disk at the time the
virt-install
command is run, even though I have a disk image ready in advance. so I run:i have written a little shell script to automate installation of Windows 7 in KVM that works for Ubuntu Linux 12.04 as host system:
http://torsten-traenkner.de/linux/create_virtual_machine_with_windows_7.sh.tgz
With a little video:
https://www.youtube.com/watch?v=xwHmdAWkbx4
The script creates a sparse file as a raw disk image. This has the advantage that the virtual disk does not use the complete real disk space at once and that you can mount the raw image easily. If the script does not work for your Linux distribution you can look inside the script to see how it's done.
I wrote up my experience here:
http://www.returnbooleantrue.com/2015/04/making-your-windows-kvm-guest-boxes-fly.html
You can certainly add VirtIO after you finish installing windows.