You are not logged in.

#1 2013-12-12 19:03:17

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Simulate virtual disk with MBR using linear RAID

On this site, https://wiki.archlinux.org/index.php/QE ... d_guest_OS, there is a good deal of information about how to access the file system of Qemu guests from the host. I have a KVM/Qemu Linux system with both Linux and Windows guests, and I would like to consider using one of the methods described there for utilizing an entire partition for installing a Windows guest. Specifically, in the main section labeled as "Using any real partition as the single primary partition of a hard disk image" and the subsection labeled as "Simulate virtual disk with MBR using linear RAID", I see that guests can be installed entirely on a host partition instead of in an image file. It is not clear to me from reading that section whether the method can be used for Windows guests or it can be applied only to a Linux guest. I would appreciate get clarification of that point. Specifically, I would like to make use of that method for installing a 64-bit Windows 7 Professional system on a PC. Is that method applicable for doing so? Thanks.

Offline

#2 2013-12-12 19:22:57

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Simulate virtual disk with MBR using linear RAID

I'd bet it would work. There's nothing magical about the MBR. If you can begin the installation that should be enough to know if it will work.

FYI, if you're thinking of doing this for performance it might not be worth it. I have a Win7 VM on a qcow2 image (on xfs formatted partition) using the virtio driver. The Windows Experience subscore for the "Primary Hard Drive" is 5.9. That seems to be a commonly cited 'best score' for 7200RPM platter drives.

Also, your link is broken.

Last edited by alphaniner (2013-12-12 19:27:59)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2013-12-12 19:44:16

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: Simulate virtual disk with MBR using linear RAID

Yes, you can use a partition or logical volume or RAID device (or combination thereof, in short: any block device) instead of an image file. Regardless of what is running inside of the VM - the OS inside the VM does not know the difference.

What you can not do is boot a Windows that was physically installed on the box, inside a VM. That is, you can, but it will complain about changed hardware and such. Windows is still picky as ever about that.

Offline

#4 2013-12-12 23:37:13

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Re: Simulate virtual disk with MBR using linear RAID

I suppose the link was broken because it was long? Either that or my messages, being a new member registered in this forum, do not allow for posting website addresses? So here, hopefully, is the base address for a shorter one, and it should be preceded with an 'https://',  "wiki.archlinux.org/index.php/QEMU#Installing_QEMU". About halfway down there is a section with the heading "Using any real partition as the single primary partition of a hard disk image" and the subsection labeled as "Simulate virtual disk with MBR using linear RAID", discussing how guests can be installed entirely on a host partition instead of in an image file. However, again, I cannot tell whether it applies only to Linux guests or not.

> " if you're thinking of doing this for performance..."

Yes, that was my primary reason for considering it because that point was made in this article:  "...Using a raw partition for a virtual machine will improve performance, as the read and write operations do not go through the file system layer on the physical host." So your system, which is performing at peak values in spite of using qcow compression, would not likely benefit substantially by switching to a dedicated partition with an uncompressed, NTFS file system? I am certainly not doubting you, but I am not sure that your situation represents what is typical. I would be surprised to hear that compression has not degraded your throughput noticeably.

Offline

#5 2013-12-13 02:53:01

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: Simulate virtual disk with MBR using linear RAID

qcow is not necessarily compressed, that's just an option

my personal experience is that block devices (LV in my case) give best performance by far

but as always, with performance questions, you should do your own benchmarks that reflect your situation

Offline

#6 2013-12-13 14:43:27

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Simulate virtual disk with MBR using linear RAID

My qcow2 image is not compressed. I didn't even know compression was an option, honestly.

$ qemu-img info Win7sp1_0.qcow 
image: Win7sp1_0.qcow
file format: qcow2
virtual size: 50G (53687091200 bytes)
disk size: 9.6G
cluster_size: 65536
Snapshot list:
ID        TAG                 VM SIZE                DATE       VM CLOCK
1         1382925156                0 2013-11-21 17:36:40   00:00:00.000

Don't get me wrong, using a block device directly makes sense to me. In another virtualization scenario, I passed through an entire SAS HBA to get the best possible performance from a hard drive. I'm just saying that in my case, an image seems to perform pretty impressively, so using a block device may not be worth it.

But if you want to use a block device, just do it already!* tongue It should only take ~5 minutes to know whether or not it will work (ie. if you get past the partitioning stage of the installer). I'm pretty sure you still have to select an interface (the 'if=' option) with a raw block device, and I'd recommend you use virtio. For that you'll need drivers.

* Or do both and share your benchmarks. wink


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#7 2013-12-15 04:01:06

Archibald-X
Member
Registered: 2013-12-12
Posts: 8

Re: Simulate virtual disk with MBR using linear RAID

> "My qcow2 image is not compressed. I didn't even know compression was an option, honestly."

I totally believe you. I just think your situation would not be typically true for most cases. If you can get great IO with an image file, more power to you. I would like to do it both ways to see how it goes too. Did you use an installation media for Win7 or were you able to use P2V? Yes, I would likely use virtio but that depends a bit on how cooperative Qemu becomes and how nicely these two beasts can play together. Assuming my link works, the Windows drivers are available here: http://www.linux-kvm.org/page/WindowsGu … ad_Drivers.

Or here:  https://alt.fedoraproject.org/pub/alt/v … mages/bin/

Offline

Board footer

Powered by FluxBB