Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

A few days ago 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. Unfortunately 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.

share|improve this question

migrated from serverfault.com Apr 11 at 17:31

This question came from our site for professional system and network administrators.

1 Answer 1

up vote 0 down vote accepted

There is one issue with VBoxManage createrawvmdk for UEFI systems. However, I'll answer the questions first.

Answers

Is it somehow possible to open the created .vmdk file with QEMU?

It appears not, since no one replied to this email. QEMU/KVM supports regular, non-raw VMDK though.

Is it possible to create such an raw image with QEMU too? How? The documentation didn't help me

No.

Do you have any other ideas how to archive this?

You can follow the guide on Arch Linux's wiki on how to manually create a disk which points to your real partitions. I can't find out, however, how can you make some partitions to be accessed as zero. You can however skip them on your 'new' disk.

Other

VBoxManage createrawvmdk does not support UEFI systems as of April 2014. You can however use vasi/vmdk-raw-parts to generate the same thing.

After you generate it, you can use VMware Player, however since the GUI of Player is weird you won't be able to attach it right away -- you'll have to create one with VMware Player and edit the .VMX file (I prefer the vmdk-raw-parts because output seems clearer, but VMware Player also generates one).

Regular warnings

Don't try any of this if you don't have backups and are prepared to blow your disk ;)

Additional stuff

Currently I'm trying to achieve the same thing using all the info I've referred here and the site Use a real Windows 7 partition in Virtualbox / KVM / VMware Player under Linux combined.

Just one last thing, weren't you curious about the files created by VirtualBox?

  • w8raw.vmdk --> text file defining your disk layout
  • w8raw-pt.vmdk --> copy of your MBR. It is referred inside w8raw.vmdk

vasi/vmdk-raw-part's creates similar ones, with better names. Out of curiosity, GPT disks have partition info both at the beginning and at the end of the disk, and in addition have checksums applied.

share|improve this answer
    
Thanks for your answer Pedro! I tried the steps from the tutorial and used vmdk-disk-part to create the vmdk file. But when I want to assign the disk to my virtual machine in VMPlayer I get the error The path "/home/marius/windows8raw/windows8raw/windows8raw.vmdk" cannot be written to. Please enter another path and try again. The vmdk file is located in my home dir with -rwxr-xr-x 1 marius marius. Do you have any ideas how to fix that? –  Marius K. Apr 21 at 16:35
    
Log: pastebin.com/xd7hDrQZ –  Marius K. Apr 21 at 17:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.