Virtio install Windows 7 KVM (x64/x86) on Fedora 14

January 25, 2011

Fedora 14 has version of Libvirt 0.8.7 and qemu-0.13.0-1 installed via Rawhide Preview Repo. However, straightforward attempt to virt-install Windows 7 on virtio boot device fails to detect device after viostor.sys gets preloaded. It’s a known bug [1]. Actually, thread at Red Hat Bugzilla – Bug 656353 contains required patch , but doesn’t contain any explanation how to rebuild and reinstall required package python-virtinst-0.500.4-1.fc14.noarch.rpm. Detailed workaround for this issue follows bellow as well as build of new package python-virtinst-0.500.5-1.fc14.noarch.rpm based on recent release virtinst 0.500.5 (Friday January 14, 2011)
Download and install python-virtinst-0.500.4-1.fc14.src.rpm. Apply patch bellow to /root/rpmbuild/SOURCES/virtinst-0.500.4/virtinst/Installer.py per Red Hat Bugzilla – Bug 656353 ( [1] ) and recreate /root/rpmbuild/SOURCES/virtinst-0.500.4.tar.gz. Then
# cd ../SPECS
# rpmbuild -bb ./python-virtinst.spec

--- aaa/virtinst/Installer.py	2010-08-24 00:05:33.000000000 +0400
+++ bbb/virtinst/Installer.py	2011-01-24 23:03:13.142553167 +0300
@@ -236,6 +236,20 @@
     # Private methods
     def _get_bootdev(self, isinstall, guest):
         raise NotImplementedError
+    def _build_boot_order(self, isinstall, guest):
+        bootorder = [self._get_bootdev(isinstall, guest)]
+
+        # If guest has an attached disk, always have 'hd' in the boot
+        # list, so disks are marked as bootable/installable (needed for
+        # windows virtio installs, and booting local disk from PXE)
+        for disk in guest.get_devices("disk"):
+            if disk.device == disk.DEVICE_DISK:
+                bootdev = self.bootconfig.BOOT_DEVICE_HARDDISK
+                if bootdev not in bootorder:
+                    bootorder.append(bootdev)
+                break
+
+        return bootorder
 
     def _get_osblob_helper(self, guest, isinstall, bootconfig):
         def get_param(obj, paramname):
@@ -287,6 +301,8 @@
         @type isinstall: C{bool}
         """
         bootdev = self._get_bootdev(isinstall, guest)
+        bootorder = self._build_boot_order(isinstall, guest)
+
         if isinstall:
             bootconfig = self._install_bootconfig
         else:
@@ -298,7 +314,7 @@
 
         bootconfig = copy.copy(bootconfig)
         if not bootconfig.bootorder:
-            bootconfig.bootorder = [bootdev]
+          bootconfig.bootorder = bootorder
 
         return self._get_osblob_helper(guest, isinstall, bootconfig)

Now reinstall python-virtinst-0.500.4-1.fc14.noarch.rpm
# cd ../RPMS/noarch
# yum reinstall python-virtinst-0.500.4-1.fc14.noarch.rpm
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Reinstall Process
Examining python-virtinst-0.500.4-1.fc14.noarch.rpm: python-virtinst-0.500.4-1.fc14.noarch
Resolving Dependencies
–> Running transaction check
—> Package python-virtinst.noarch 0:0.500.4-1.fc14 set to be reinstalled
–> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
Package Arch Version Repository Size
===================================================================================================================
Reinstalling:
python-virtinst noarch 0.500.4-1.fc14 /python-virtinst-0.500.4-1.fc14.noarch 1.7 M

Transaction Summary
===================================================================================================================
Reinstall 1 Package(s)

Total size: 1.7 M
Installed size: 1.7 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : python-virtinst-0.500.4-1.fc14.noarch 1/1

Installed:
python-virtinst.noarch 0:0.500.4-1.fc14

Complete!

Another option based on virtinst 0.500.5 released on Friday January 14, 2011 :-
# cd ../SOURCES
# wget http://virt-manager.org/download/sources/virtinst/virtinst-0.500.5.tar.gz
# cd ../SPECS
# Update in python-virtinst.spec
Version: 0.500.5
Save
# rpmbuild -ba ./python-virtinst.spec
# cd ../RPMS/noarch
# yum install python-virtinst-0.500.5-1.fc14.noarch.rpm

New version of python-virtinst-0.500.5-1.fc14.src.rpm should be available for download
via https://bugzilla.redhat.com/show_bug.cgi?id=656353
Now run virt-install :-

virt-install --connect qemu:///system --virt-type kvm \
--name W7VIRT64 --ram 4096 --disk path=/dev/vg_virtuals/vm01,bus=virtio \
--disk /usr/tmp/virtio-win-1.1.16.vfd,device=floppy \
--os-variant win7 \
--cdrom /usr/tmp/Win7_64.iso --vcpus 2










References
1.https://bugzilla.redhat.com/show_bug.cgi?id=656353


Virtio install Windows 7 KVM (x64/x86) on Ubuntu 10.04.1 Server via DNJL PPA

January 20, 2011

First of all setup DNJL PPA to upgrade KVM/QEMU up to Qemu 0.12.5 & Libvirt 0.8.3 on Ubuntu Lucid Server and download the most recent Fedora virtio-win drivers from http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin as floppy and ISO image. Notice , that same virt-install will run fine on KVM Server Ubuntu 10.10 due to required versions of Libvirt & Qemu appear to be installed by default.

root@ServerLNX:~# add-apt-repository ppa:dnjl/virtualization
Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –primary-keyring /etc/apt/trusted.gpg –keyserver keyserver.ubuntu.com –recv 5C1F788FDE6E8657FF5864FFD18C7A1DF6E6BED2
gpg: requesting key F6E6BED2 from hkp server keyserver.ubuntu.com
gpg: key F6E6BED2: public key “Launchpad ppa” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)

Add to /etc/apt/sources.list

deb http://ppa.launchpad.net/dnjl/virtualization/ubuntu lucid main
deb-src http://ppa.launchpad.net/dnjl/virtualization/ubuntu lucid main

Save

# apt-get update
# apt-get upgrade

Check packages installed

root@ServerLNX:~# dpkg -l |grep qemu
ii kvm 1:84+dfsg-0ubuntu16+0.12.5+noroms+0ubuntu1.1~dnjl1~lucid0 dummy transitional pacakge from kvm to qemu-
ii qemu-common 0.12.5+noroms-0ubuntu1.1~dnjl1~lucid0 qemu common functionality (bios, documentati
ii qemu-kvm 0.12.3+noroms-0ubuntu9.2 Full virtualization on i386 and amd64 hardwa
root@ServerLNX:~# dpkg -l |grep libvirt
ii libvirt-bin 0.8.3-1ubuntu4+dnjl1~lucid0 the programs for the libvirt library
ii libvirt0 0.8.3-1ubuntu4+dnjl1~lucid0 library for interfacing with different virtu

Without step bellow i was unable to attach virtio-win-1.1.16.vfd as floppy before W7 (x64) KVM start up

root@ServerLNX:~# apt-get remove kvm qemu-kvm
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
kvm qemu-kvm ubuntu-virt-server
0 upgraded, 0 newly installed, 3 to remove and 3 not upgraded.
After this operation, 8,483kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database … 160403 files and directories currently installed.)
Removing kvm …
Removing ubuntu-virt-server …
Removing qemu-kvm …
qemu-kvm stop/waiting
Processing triggers for ureadahead …
ureadahead will be reprofiled on next reboot
Processing triggers for man-db …
root@ServerLNX:~# apt-get install kvm qemu-kvm
Reading package lists… Done
Building dependency tree
Reading state information… Done
=> The following extra packages will be installed:
=> libvdeplug2
The following NEW packages will be installed:
kvm libvdeplug2 qemu-kvm
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 2,969kB/2,985kB of archives.
After this operation, 8,536kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/universe libvdeplug2 2.2.3-3 [13.0kB]
Get:2 http://ppa.launchpad.net/dnjl/virtualization/ubuntu/ lucid/main qemu-kvm 0.12.5+noroms-0ubuntu1.1~dnjl1~lucid0 [2,956kB]
Fetched 2,969kB in 10s (277kB/s)
Selecting previously deselected package libvdeplug2.
(Reading database … 160361 files and directories currently installed.)
Unpacking libvdeplug2 (from …/libvdeplug2_2.2.3-3_amd64.deb) …
Selecting previously deselected package qemu-kvm.
Unpacking qemu-kvm (from …/qemu-kvm_0.12.5+noroms-0ubuntu1.1~dnjl1~lucid0_amd64.deb) …
Selecting previously deselected package kvm.
Unpacking kvm (from …/kvm_1%3a84+dfsg-0ubuntu16+0.12.5+noroms+0ubuntu1.1~dnjl1~lucid0_amd64.deb) …
Processing triggers for ureadahead …
Processing triggers for man-db …
Setting up libvdeplug2 (2.2.3-3) …

Setting up qemu-kvm (0.12.5+noroms-0ubuntu1.1~dnjl1~lucid0) …
qemu-kvm start/running

Proceed with install W7 KVM on virtio bootup device

virt-install --name W7VIRT64 --ram 4096 --disk /dev/sda8,bus=virtio \
--disk /usr/tmp/virtio-win-1.1.16.vfd,device=floppy --os-variant win7 \
--cdrom /usr/tmp/Win7_64.iso --cpu 2












Set up virtio network driver





Virtio install Windows 7 KVM (x64/x86) on Scientific Linux 6 (alpha 4)

January 11, 2011

Download and install virtio-win-1.1.16-0.el6.noarch.rpm via http://rghost.net/3412907
Before starting install KVM make some changes to “Details”
1. Attach virtio-win-1.1.16.vfd as floppy.
2. Change type of boot up device to “Virtio”







Load virtio.sys driver from floppy to detect boot up device :-





Complete install as usual :-





Shutdown KVM , change type of bridge “br0″ to “virtio” and attach CDROM virtio-win-1.1.16.iso to KVM. Then load KVM with broken Network , load “Device manager” and “Update driver for Ethernet Adapter” via attached RH CDROM





Set up RH VirtIO SCSI&Network drivers on Windows 7, Windows XP KVMs at KVM-QEMU Instance on F14

January 8, 2011

Create Windows KVM via virt-manager as usual. Download Latest VirtIO Win drivers from Fedora. Location is http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/. Notice also , that the last virtio-win-1.1.16-0.el6.noarch.rpm ( Last Redhat virtio signed windows driver ) been installed on Scientific Linux 6, allows to perform install Windows 7 KVM directly on “virtio” boot up device via loading drivers from virtio-win-1.1.16.vfd been attached as floppy to KVM before installation starts up. Virtio-win-1.1.16-0.el6.noarch.rpm may be downloaded in meantime at http://rghost.net/3412907. View for details
Virtio install Windows 7 KVM (x64/x86) on Scientific Linux 6 (alpha 4)
Download files virtio-win-1.1.11-0.vfd and ISO image virtio-win-1.1.11-0.iso to Fedora’s FS. Create fake qcow2 file :-

# cd /vms
# qemu-img create -f qcow2 fake.qcow2 1G

Procedure bellow is specific for 32-bit version of W7, 64-bit version requires KVM shut down (via my experience) to add fake.qcow2 disk and virtio-win-1.1.16.iso as CDROM. Then load KVM and Update broken SCSI driver ( “Device Manager”) via attached CD.
Start Windows KVM and switch to “Details”
1. Attach virtio-win-1.1.11-0.iso as CDROM to KVM
2. Add fake.qcow2 as “virtio” disk





Now switch to “Console” . “Add New Hardware” Wizard should be already up and running. Install required driver from attached
CDROM.







Shutdown Windows KVM . Remove fake qcow2 disk and change type Windows boot up disk to “Virtio”



Start up Windows KVM and make sure driver has been properly installed



Same procedure works for 32-bit version Windows 7 KVM









Shutdown Windows 7 KVM . Remove fake disk and switch type of boot up device to “Virtio”



Boot up Windows 7 KVM again and make sure RH VirtIO SCSI Driver has been properly installed



To install RH Virtio Ehernet Adapter via same CDROM :
1. Change bridge type “br0″ to “Virtio”
2. Start KVM with broken network
3. Go to “Control Panel=>Devices Management
4. Update Network driver via Fedora’s CDROM attached







Final Windows 7 KVM XML profile :-

<domain type='kvm'>
<name>W7Virtio</name>
<uuid>b45da320-34d7-55c6-dd3a-c66214d1f1b8</uuid>
<memory>4194304</memory>
<currentMemory>4194304</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='rhel6.0.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/root/Downloads/virtio-win-1.1.11-0.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
<disk type='block' device='disk'>
<driver name='qemu' type='raw'/>
<source dev='/dev/sdb10'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:d9:c9:5f'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='vga' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>


2010 in review

January 2, 2011

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads Wow.

Crunchy numbers

Featured image

The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 180,000 times in 2010. If it were an exhibit at The Louvre Museum, it would take 8 days for that many people to see it.

In 2010, there were 44 new posts, growing the total archive of this blog to 111 posts. There were 176 pictures uploaded, taking up a total of 86mb. That’s about 3 pictures per week.

The busiest day of the year was September 9th with 1,135 views. The most popular post that day was GNOME 3 at Xen 4.0.1 (2.6.32.21 pvops) on top of F14 (rawhide).

Where did they come from?

The top referring sites in 2010 were wiki.xensource.com, linuxtoday.com, wiki.xen.org, librenix.com, and lxer.com.

Some visitors came searching, mostly for xen grub2, grub2 xen, suse 11.3, ubuntu 10.04 xen, and ubuntu server.

Attractions in 2010

These are the posts and pages that got the most views in 2010.

1

GNOME 3 at Xen 4.0.1 (2.6.32.21 pvops) on top of F14 (rawhide) September 2010

2

Set up Ubuntu 10.04 Server PV DomU at Xen 4.0 Dom0 (pvops 2.6.32.12 kernel) Dom0 on top of Ubuntu 10.04 Server April 2010
60 comments

3

Set up Libvirt 0.8.1 & Xen 4.0.1 Dom0 (2.6.32.15 pvops) on top of Ubuntu 10.04 Server via Daniel Baumann Virtualization PPA June 2010
2 comments

4

Loading Xen via GRUB2 on top Ubuntu Karmic Server (alpha 4) August 2009
27 comments

5

Virt-install&Virt-manager at Xen 4.0 (2.6.32.12 pvops) Dom0 on top Ubuntu Karmic Koala Server March 2010
10 comments


Follow

Get every new post delivered to your Inbox.