windows 7 as kvm guest installation with virtio drivers - detected virtio scsi disk shows wrong capacity

19,868

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:

virt-install --connect qemu:///system \
    --name win7vnc --ram 2048 --vcpus=2 --cpuset=auto \
    --disk path=win7.img,bus=virtio,size=100,format=qcow2 \
    --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 
Share:
19,868

Related videos on Youtube

nass
Author by

nass

Updated on September 18, 2022

Comments

  • nass
    nass almost 2 years

    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

    enter image description here

    • Michael Hampton
      Michael Hampton almost 10 years
      Does your virtual disk already have a partition table on it? Use DISKPART to erase it.
    • nass
      nass almost 10 years
      @MichaelHampton hi there! could you please elaborate on DISKPART abit ? (invocation, usage, etc) because I cannot find any info on diskpart wrt kvm. thanks
    • Michael Hampton
      Michael Hampton almost 10 years
      Why would you? It's a Windows command!
    • nass
      nass almost 10 years
      there seems to be NO more space. really. DISKPART shows the same please see the added image
    • nass
      nass almost 10 years
      hm ok I found a solution. I start the installation by suggesting size and format for the disk image.
    • nass
      nass over 9 years
      @MichaelHampton hi there, can I get your input to yet another problem I am facing with KVM and mostly internet access of the guest. The question is here unix.stackexchange.com/questions/158077/… , but I would like to discuss it in chat room if possible.
  • Esa Jokinen
    Esa Jokinen about 9 years
    Instead of just linking to your site you should add the main solution to you answer. Then, you can add your blog as a reference.