In various previous post we saw installation of Linux machines on KVM. But sometime we need to install Windows virtual machine for various reasons, so i thought why should not try Installing Windows OS on KVM platform on Ubuntu 16.04 LTS. Windows XP is most basic windows machine, With same way we could Install any windows OS on KVM platform

For installing Windows XP on KVM , its better you have windows XP iso and product key which we need during installation. We documented various steps which we followed for installing Windows XP and mentioned below…

SetUP

we have Ubuntu 16.04 physical machine having KVM platform details as mention below.

root@jarvis:~# lsb_release -d
Description:	Ubuntu 16.04.3 LTS

root@jarvis:~# uname -r
4.4.0-101-generic

root@jarvis:~# kvm --version
QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.16), Copyright (c) 2003-2008 Fabrice Bellard

So, with this setup we are going to see How we could install Windows XP. For same first need to create virtual Disk for same over which we start installing.

Creating Virtual Disk

Here for this setup we are going to use qcow2 format of disk, which has advantage over raw file format which could cause problem after reboot in between windows OS installation.So we create qcow2 file format with mentioned below way.

# qemu-img create -f qcow2 /data/vm_images/windows_xp/system.img 30G
Formatting '/data/vm_images/windows_xp/system.img', fmt=qcow2 size=32212254720 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16

This will create sparse file with very small size in mentioned given path.

Iso image Installation

As mentioned above we should have windows iso which we would use for installation.

# ll /images/Windows_XP_Professional_64-bit.iso 
-rw-r--r-- 1 libvirt-qemu kvm 561M Jul 26  2014 /images/Windows_XP_Professional_64-bit.iso

Now we need to start VM installation with same Iso image.

For start installation through KVM platform on Ubuntu16.04, we could start it like below mentioned way.

# virt-install --name windows_xp --ram 1024 --file /data/vm_images/windows_xp/system.img  --cdrom /images/Windows_XP_Professional_64-bit.iso

Starting install...
Creating domain...                                                                     |    0 B  00:00:00     
Domain installation still in progress. Waiting for installation to complete.
Domain has shutdown. Continuing.
Starting domain...                                                                     |    0 B  00:00:00     
Domain installation still in progress. Waiting for installation to complete.
Domain has shutdown. Continuing.
Domain creation completed.
Restarting guest.

So with this we can install Windows XP through this console, this would open another graphical console for Windows installation
Below is first screen come up once Virtual machine boot from windows XP iso. We have press enter over here and accept EULA with F8 button.

This will ask to create partition on disk, so that we could able to install OS over same disk partition.

After partition, format that partition and copy installation file that will initiate a reboot that will proceed with installation of files

After reboot this screen comes, which comes with some basic customisation and Questions

Once installation finished, it will ready to login.

In same way we could install any other windows OS on KVM platform