creating VMDK file for raw disk access by virtualbox on linux host
Posted 05-19-2014 at 03:32 PM by dr_agon
Recently I repartitioned my harddrive and had to recreate VMDK file which is used to access some of my physical partitions by guest machine.
You can do it using the command
The result did not satisfy me, because guest machine required RW access to entire /dev/sda.
Looking for description of VMDK format I have found this.
So, I modified the lines in VMDK file replacing /dev/sda by /dev/sda1 and sda3 respectively, and removed the offset.
Example:
original line:
new line:
Now I can grant RW permissions only to selected partitions (I described it in my earlier blog).
You can do it using the command
Code:
$ sudo vboxmanage internalcommands createrawvmdk -filename test.vmdk -rawdisk /dev/sda -partitions 1,3
Looking for description of VMDK format I have found this.
So, I modified the lines in VMDK file replacing /dev/sda by /dev/sda1 and sda3 respectively, and removed the offset.
Example:
original line:
Code:
RW 61432497 FLAT "/dev/sda" 63
Code:
RW 61432497 FLAT "/dev/sda1"