KVM- Create VM from existing Windows installation

Hi,

I am new to KVM. I have two SSDs on my machine. One with Windows 7, the other with CentOS 7.

What I need to do is to access the Win7 installation from KVM on CentOS. I know this is possible as I have seen people doing it, but I can’t seem to find a step-by-step guide that explains how to do it.

Can anyone help, please?

1 Like

install kvm and when you are creating the VM.
Use the other SSD as the drive for the VM.

Use the other SSD as the drive for the VM.

How exactly would I do that? I can’t see an option for it when I am creating the VM. The options I get are Local Install, Network Install, Network Boot and Import Existing Image.

I don’t want to make an image of the Windows installation; I want to use it live from the SSD.

If I go with the Local Install option and get to the point where I select a storage, it expects a *.qcow2, a *.img or a *.qed file, not the actual SSD.

I see an option to create a storage pool from a Pre-Formatted Block Device. Would that be how I would do it? Should I create a pool from the Windows Boot partition?

If that is it, how then I would get the VM to boot from it?

no

post screen shot of this option

Assuming youre using virt-manager, the way it should work is that you dont browse files, you just enter /dev/sda directly into the box when you went with import existing image. Precisely what I’m doing with my physical installation.

I was trying to work up to this… but

id wouldnt use sda, sdb, etc… These references can change if the disk gets plugged into another port, or another disk is added/removed.

The best thing to use is the id of the drive… which can be found under /dev/disk/by-id/

There are several ways to reference something under that directory. I like the wwn-* options.

example:
image

Here is how I passed through my physical drive. Hopefully it works for you.

Find your disk using ls -l /dev/disk/by-id/

Example:

/dev/disk/by-id/ata-KINGSTON_SH103S3120G_50026B652302764F

In virt-manager go into your VM settings… Storage > Select or create custom storage > Paste disk-by-id in the box (Don’t click manage)"

Best of luck :slight_smile:

Thank you for your help, guys. I have tried several options, but I still can’t get the VM to boot.

First, I tried adding the entire disk as the VM storage and boot from it. However, that didn’t work. I got the following error.

I then tried adding the separate partitions of that disk since Windows always creates a ‘System Reserved’ partition.

I then tried booting from the partition that has the bootmgr, but that didn’t work as well. I got the following error.

I think I know what might be the problem, but I need to make sure. When I was reading on how to do this, it looked like that it is not necessary to install the VirtIO drivers in Windows, but I might have misunderstood.

Can I boot an existing Windows installation without installing the VirtIO drivers on it first?

That did not work for me. Though in the case of an UEFI Windows 10 its fairly obvious if your disk controller is at fault. SATA or IDE usually work fine, have had issues with SCSI and VirtIO.

I still have Windows 7. I will try installing the drivers and see what happens.

Thank you very much for your help.

The concept works. I have tested it with another CentOS installation I have. I won’t be able to test it with Windows for now since I have all the regular drivers installed on my machine already and I don’t want to go through the hassle of uninstalling them, which seems to be the only way I can install the VirtIO drivers.

I might test later with another vanilla Windows installation.

Thank you for your help, guys.