3

I am attempting to create a VMDK of my Windows Partition (Win 10 x64 Pro - insider preview) on disk /dev/sda, where my Windows partition is /dev/sda1.

Virtual Box has the option of creating a vmdk from a partition via the -partitions

From the doc page found here:

To create a special image for raw partition support (which will contain a small amount of data, as already mentioned), on a Linux host, use the command

VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk
  -rawdisk /dev/sda -partitions 1,5

As you can see, the command is identical to the one for "full hard disk" access, except for the additional -partitions parameter. This example would create the image /path/to/file.vmdk (which, again, must be absolute), and partitions 1 and 5 of /dev/sda would be made accessible to the guest.

My attempt:

please note: to allow for per user creation and editing of disks, I used

sudo usermod -a -G disk cx

where my user is cx

Starting off:

Thus, applying the above commands by:

VBoxManage internalcommands createrawvmdk -filename win_hdd_raw.vmdk -rawdisk /dev/sda -partitions 1

output:

RAW host disk access VMDK file win_hdd_raw.vmdk created successfully.

2 files created when running the createrawvmdk command:

# ls -la win_hdd_raw*

-rw------- 1 cx cx 161280 Nov 23 00:37 win_hdd_raw-pt.vmdk
-rw------- 1 cx cx    929 Nov 23 00:37 win_hdd_raw.vmdk

Loading into VBox, using file win_hdd_raw.vmdk I see:

enter image description here

then firing it up, keeping all settings as default I get the following error:

enter image description here

This error was diagnosed be someone from the comment section of another question I posted.

In the comment section: @Seth resolved it was that the entire hard drive was being used, thus VBox attempted to load grub (my bootloader), this was causing the error I specified above.

Info:

VBoxManage internalcommands listpartitions -rawdisk /dev/sda

VBox partitions:

Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x07  0   /32 /33  1023/254/63        235520         2048
2       0x83  1023/254/63  1023/254/63          1024    482347008
5       0x83  1023/254/63  1023/254/63        173595    484446208
6       0x83  1023/254/63  1023/254/63         32580    839970816
7       0x83  1023/254/63  1023/254/63         14760    906696704
8       0x83  1023/254/63  1023/254/63         15360    936927232
4       0x82  1023/254/63  1023/254/63          4096    968384512

fdisk output

fdisk -l

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 482347007 482344960   230G  7 HPFS/NTFS/exFAT
/dev/sda2       482347008 484444159   2097152     1G 83 Linux
/dev/sda3       484444160 968384511 483940352 230.8G  5 Extended
/dev/sda4       968384512 976773119   8388608     4G 82 Linux swap / Solaris
/dev/sda5       484446208 839968767 355522560 169.5G 83 Linux
/dev/sda6       839970816 906694655  66723840  31.8G 83 Linux
/dev/sda7       906696704 936925183  30228480  14.4G 83 Linux
/dev/sda8       936927232 968384511  31457280    15G 83 Linux

from the above info, one can see that partition "1" refers to a 230Gb partition of type NTFS, which is my Windows Partition.

I do not see if and where I made a mistake,

Any suggestions?

Update after @alinourzad's answer

Enable EFI (Special OSes) - enabled

Running the VM, I get:

enter image description here

WHich is the same/similar issue I had in the question linked to the post on which @Seth commented

2
  • a temporary solution is remove the -partitions 1 and use the entire disk
    – CybeX
    Commented Nov 23, 2016 at 8:47
  • post output of fdisk -l ./win_hdd_raw.vmdk
    – user657451
    Commented Nov 23, 2016 at 18:40

1 Answer 1

0

I would be inclined to scrap the -partitions flag altogether and hand -rawdisk /dev/sda**1** and see what happens.

A workaround would be to dd if=/dev/sda1 of=~/Desktop/win_nt.img then use your tool of choice to convert the .img to .cow or .vmdk

2
  • 1
    thanks for the suggestion, 1. I did try the /dev/sda1 but it output an error (cannot exactly recall the text). 2. Since I have a partition I can boot into (Windows - /dev/sda1), I would also like to boot into it via VBox. The redundancy is due to the fact that it takes far to long to switch OS's, adding to that, I have a hdd space limitation. Currently my solution is to use the raw disk as a whole (eliminating the -partitions 1) and boot via the installed hdd bootloader (grub) as I would normally boot. Until the -partitions 1 issue has been resolved, I shall boot my entire hdd from vbox.
    – CybeX
    Commented Nov 23, 2016 at 19:26
  • 1
    qemu or xen would be resource-lighter options than vbox. booting the same windows install natively and as a vm seems risky.
    – user657451
    Commented Nov 23, 2016 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .