I am trying to create a Windows 7 (32bits)
with virtio
disk and network in a single step using virt-manager.
I've been trying to follow the step-by-step procedure here.
However there is no such thing as the following on Debian
:
# yum install virtio-win
After a quick search on internet this package seems to only be available to RHN subscriber, as per link.
The virtio-win package can be found here in RHN: https://rhn.redhat.com/rhn/software/packages/details/Overview.do?pid=602010. It requires access to one of the following channels: RHEL Client Supplementary (v. 6) RHEL Server Supplementary (v. 6) RHEL Workstation Supplementary (v. 6)
So I am left with what is free out there. Obviously I cannot simply download the *.iso file and mount it as if it was "Floppy Disk". I actually tried and Windows told me that I need to format my drive !
I've also tried adding a secondary CD-ROM and mount virtio-win-0.1-81.iso
, but then Windows installer would refuse to even boot. Seems like kvm/qemu gets confused when system has more than one CD-ROM drive.
So in the end, I am left with a two steps process where I need to mount the Windows iso, install on regular disk, then shutdown and do the virtio stuff as described here, or here.
Isn't there a simplier process (single step) for the non-subscriber of RHN ? I am using a Debian/Jessie amd64 system (Linux has mount/umount).
BONUS POINT: no need to use an intermediate windows system to prepare the ISO file.
Prepare a template VM, modify it with a tool like snf-image-creator to install the virtio drivers and sysprep, and clone it:
sudo snf-mkimage -f --print-metadata --disable-sysprep=shrink --print-syspreps --install-virtio=/mnt/loop/win8/amd64 -o win2012-out.img win2012-template.img
If you want to create each image from scratch, you can slipstream the drivers into your windows ISO, so that they are available during setup.
Here's a rather lenghty howto for Windows 2012 (taken from http://joshrestivo.com/?p=17, redacted some ranty comments by the author), it should be easily adaptable for Windows 7.
Prep
You’ll need:
Details
For ease of explanation, I’ve created the following:
Go ahead and put the windows and virtio iso images in c:\iso.
Using ImgBurn or the tool of your choice, extract the contents of the windows install iso to c:\iso\ms-iso.
Extract the contents of the virtio iso into c:\iso\virtio-iso. Alternatively, you could just mount the iso and reference the appropriate path when you reach step #5.
Next, we’ll use dism to mount the wim image. Run this from an elevated command prompt:
dism /mount-image /imagefile:c:\iso\ms-iso\sources\install.wim /index:1 /mountdir:c:\iso\ms-mount
Time to insert the drivers.
dism /image:c:\iso\ms-mount /add-driver /driver:c:\iso\virtio-iso\WIN8\AMD64 /recurse
If all went well, 5 of 5 drivers will have successfully ‘installed’. Now we seal the deal:
dism /unmount-wim /mountdir:c:\iso\ms-mount /commit
Now we have to run through the same process but this time we’re updating boot.wim so that we can see the virtual drive during the install process.
dism /mount-image /imagefile:c:\iso\ms-iso\sources\boot.wim /index:1 /mountdir:c:\iso\ms-mount dism /image:c:\iso\ms-mount /add-driver /driver:c:\iso\virtio-iso\WIN8\AMD64 /recurse dism /unmount-wim /mountdir:c:\iso\ms-mount /commit
Now all that’s left is to glue the iso back together. In ImgBurn this accomplished by:
A. Mode -> Build
B. In the ‘Source’ section, click the ‘Browse for a folder’ icon. Select c:\iso\ms-iso.
C. In the ‘Destination’ section, click the ‘Browse for a file’ icon. Give your iso a name and put it where you’d like.
D. Under the Options tab on the right, set ‘File System’ to ‘UDF’ and ensure that ‘Recurse Subdirectories’ is checked.
E. Under the Labels tab, set an appropriate label (eg., ‘win2012-virtio’) in the UDF field.
F. Under the Advanced -> Bootable Disc tab:
I. Check the ‘Make Image Bootable’ checkbox
II. Emulation Type: None (Custom)
III. Boot Image: c:\iso\ms-iso\boot\etfsboot.com
IV. Platform ID: 80×86
V. Developer ID: Microsoft Corporation
VI. Load Segment: 07C0
VII. Sectors to Load: 8 (for Vista and earlier, this would be 4)
VIII. Patch Information Table: Unchecked
G. Finally, click the ‘Build Image’ button on the bottom left.
I was facing the same failure. The situation resolves, when I had choose the less disk space and the less RAM for my virtual machine