You are not logged in.

#1 2014-04-12 19:09:32

MK13
Member
From: Germany
Registered: 2014-04-12
Posts: 80

Virtualize an existing windows 8.1 installation on arch

Hi,

3 days ago I installed arch and I'm very delighted. Originally coming from windows I installed ubuntu on my laptop a few months back. Linux instantly grabbed my attention. So when I decided to buy a new desktop PC I compared various distros and arch was the most promising one. I haven't been disappointed; The learning curve is very good and the distro is really well documented. But now I have a problem where the documentation can't help.

I have the following setup:

- Intel i5 4570s
- SSD for os
  - sda1: EFI boot partition
  - sda2: ext4 with arch installed
  - sda3: swap
  - sda4: microsoft reserved
  - sda5: ntfs with windows 8.1 installed
- HDD for data
- EFI motherboard

Install order: arch -> windows

Before I installed arch I read an article about how to boot virtual in an existing windows installation and nonetheless be able to boot normally into it and have the instances synced. Later I found out: VirtualBox isn't capable of booting an EFI windows installation.

As I read in another blog, other virtualization software like QEMU is able to boot an EFI windows installation with OVMF. So I followed the first article and created a raw image of my windows disks with

VBoxManage internalcommands createrawvmdk -filename w8raw.vmdk --rawdisk /dev/sda -partitions 1,4,5 -relative

and tried to open that image with QEMU via

qemu-system-x86_64 --enable-kvm -pflash OVMF.fd w8raw.vmdk 

I get the following error

Unsupported image type 'partitionedDevice' 

It may be noteworthy that the VBoxManage command produced two files

w8raw.vmdk
w8raw-pt.vmdk

Now my questions:

1) Is it somehow possible to open the created .vmdk file with QEMU?
2) Is it possible to create such an raw image with QEMU too? How? The documentation didn't help me
3) Do you have any other ideas how to archive this?

If you need further information I gladly add them here.

Offline

#2 2014-04-13 09:07:18

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Virtualize an existing windows 8.1 installation on arch

You have created a vmdk file that point to a real disk. The vmdk file does not contains the data in itself; probably qemu cannot open such virtual disk. The raw disk is simply /dev/sda in your case; you can pass it as an argument to qemu (provided you have the necessary permissions to access it), but ensure that the mounted partitions (the one you use in your running linux) are not accessed in any way by Windows (it should be the case if they are not FAT or NTFS and you do not have installed special tools in Windows to read them). Virtualbox can authorize the access of individual partitions of a physical disk (by using the VBoxManage command you mention), but I don't think this trick can be exported to qemu.

You can create a raw image of your disk by using the dd command:

dd if=/dev/sda of=/some-file.raw

but do that from a bootable recovery disk, do not mount /dev/sda while running dd (and have an external hard disk that is big enough to contain the whole image of /dev/sda).

But I doubt you will achieve your real goal. At the very best, Windows will consider that it run on a new hardware within the virtual machine. At best it will ask you to re-register and will cease to work if you boot it directly. Some OEM Windows do a BIOS/UEFI check to verify they have not be copied and will refuse to work in the virtual machine. You might also expect a whole bunch of problems because the same windows will run on two different hardware (virtual and physical). Windows has not been designed to be moved from one machine to another. If you want to have a virtual Windows, I would strongly suggest you to install it from scratch in the virtual machine. VirtualBox has more feature (some of them are really useful: e.g. the Windows additions that provide nice integration between the two machines; USB access, etc.) and is easier to manage than qemu. Just put VirtualBox in BIOS mode and install Windows (all Windows versions accept to be installed in BIOS mode).

Last edited by olive (2014-04-13 09:32:49)

Offline

#3 2014-04-14 17:56:43

MK13
Member
From: Germany
Registered: 2014-04-12
Posts: 80

Re: Virtualize an existing windows 8.1 installation on arch

Hi olive,

thanks for your reply and your time. If I create a raw image of my whole /dev/sda drive and later use that for the VM, won't linux and windows both access the /dev/sda1 EFI boot partition?

I just tried to make a raw disk of /dev/sd4 and /dev/sda5 with dd, and use them with qemu like this

qemu-system-x86_64 --enable-kvm -m 4096 -pflash OVMF.fd -hda windows.raw -hdb msreserved.raw

But in the VM window it says that no boot medium could be found.

I already have a running VM with windows for Office and stuff. The dual boot windows is only for gaming. But with this, I have to maintain two windows installs.

Offline

#4 2014-04-14 18:19:52

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

Re: Virtualize an existing windows 8.1 installation on arch

You can't image a partition and use it as a disk like that. You lose the partition table and bootcode, which is why you see the 'no boot medium' error. Moreover, Windows will expect the 'devices' to be full-fledged hard drives, not partitions.


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

#5 2014-04-14 18:37:51

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,792

Re: Virtualize an existing windows 8.1 installation on arch

I am a bit uncomfortable with this thread.  I do not own or use Windows 8.1, so I do not have a copy of Microsoft's licence agreement for that product.  Regardless, I am fairly certain that to use that product in the manner described in this thread is going to run afoul of that license.  Your version is probably an OEM version with strict limitations on the platform on which it may be run.  Last I checked (IANAL), running Windows on a VM required that you own a shrink wrapped copy.  I could be wrong, but you must verify that what you are trying to do is permitted by your license. 

Our Policy:  https://wiki.archlinux.org/index.php/Fo … e#Legality
I am going to close this thread.  After checking your Microsoft license, if you believe what you are trying to do is in scope of the license, please contact the moderators by reporting this thread and we will evaluate reopening it.

Thanks


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2014-04-14 21:00:05

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,792

Re: Virtualize an existing windows 8.1 installation on arch

I received a polite response from MK13, and have established that they are not using an OEM license and, in my non-lawyer opinion, but based on the license he shared with me, he does have the proper rights to run that product on that machine in this manner.

Thanks for the understanding.
Reopened.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2014-04-14 22:19:23

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Virtualize an existing windows 8.1 installation on arch

Microsoft had some tool that allowed the creation of an image that would fit right into VirtualPC.  It basically does the same thing it is doing here with the raw disk methods of VirtualBox or qemu.  Of course, VirtualPC is a Microsoft product running on Microsoft OS and not Linux.  The notion of taking an existing installation and virtualizing is usually infallible because changing the video card or something like this will fail it to boot.  This is why some of the certification tests of the industry also fail.  Can't just take out the failed video card and reboot.  Good luck!  I think it was the Windows 7 Ultimate that could be booted from virtualized image from an iSCSI or other SAN device.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#8 2014-04-15 10:43:33

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: Virtualize an existing windows 8.1 installation on arch

Hi,

maybe you could also check virtualization via Xen.  This enables you to boot an OS , e.g. windows, directly from harddrive. You won't need any additional files pointing to a physical volume.

Offline

Board footer

Powered by FluxBB