Virtualbox: using physical harddisk

Raw hard disk access, both for entire disks and individual partitions, is implemented as part of the VMDK image format support. As a result, you will need to create a special VMDK image file which defines where the data will be stored. After creating such a special VMDK image, you can use it like a regular virtual disk image. Official instructions here.

Create the vmdk image:

VBoxManage internalcommands createrawvmdk -filename </path/to/file.vmdk> -rawdisk </dev/sda>

In order to gain the direct access to the disk, on Debian based distro, we need to be part of the disk group:

usermod -a -G disk <our-user-name>

Then logout and login

Now we are ready to create a new virtual machine where </path/to/file.vmdk> will be the real disk.

 

No Comments

No comments yet.

RSS feed for comments on this post.

Leave a comment

WordPress Themes