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.

Using Virtual Box, how can I install an OS to a secondary, physical disk, and boot it in both (at separate times) Virtual Box, and as a typical secondary OS install?

share|improve this question
@ЯрославРахматуллин Huh? –  Petah Oct 29 '12 at 22:39
Jaroslav Rashmatullin.. –  Air Jun 29 '14 at 9:54

2 Answers 2

up vote 20 down vote accepted

I made a smug comment ("Straight forward") when this question was originally posted and found myself at this page some months later looking for the same answer

Straight forward instructions

Today, I managed to boot from physical drives. This achievement required;

  • 60 min straight forward reading
  • 30 min writing this
  • 20 min trying different options in VirtualBox

    Dear reader, your attention is directed at the fact that it is equally straight forward to kill your data when the disc is accessed in this manner. The procedure on how to accomplish this is left as an exercise...

Pics (it did happen :)

grub 2

1. Create vmdk drives that read from real drives

To create an image that represents an entire physical hard disk (which will not contain any actual data, as this will all be stored on the physical disk), on a Linux host, use the command

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

You must have read access to the physical disk device file /dev/sda. To accomplish this you can either change the owner and access rights of the device file or run VBoxManage internalcommands createrawvmdk… as root (put sudo before the command).

On a Windows host, instead of the above device specification, use e.g. \\.\PhysicalDrive0. On a Mac OS X host, use e.g. /dev/disk1 (and unmount all partitions on disk1).

(all on one line)
C:\VirtualBoxDrives>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
    internalcommands createrawvmdk
    -filename C:\VirtualBoxDrives\raw-0.vmdk 
    -rawdisk \\.\PHYSICALDRIVE0

RAW host disk access VMDK file C:\VirtualBoxDrives\raw-0.vmdk created successf..


2. Assign the vmdk drives to a VM

VM -> Settings -> Storage -> add ide / sata -> Choose existing disk -> browse



3. Set one of the Writethrough modes.

File -> Virtual Media Manager -> e.g raw-0.vmdk -> [modify] -> (o) Writethrough

  • repeat for all drives

set writethrough


3. Reorder boot-priority (semi optional)

VM -> Settings -> System -> Boot order

[./] Hard Disk
[./] CD/DVD
[  ] Floppy
[  ] Network

VM -> Settings -> Storage -> Controller: SATA -> e.g. raw-5.vmdk -> Hard Disk: Sata Port 0


Relevant chapters (manual)

  • Chapter 9. Advanced topics

    • 9.9. Advanced storage configuration
      • 9.9.1. Using a raw host hard disk from a guest
      • Access to entire physical hard disk
  • Chapter 5. Virtual storage

    • 5.2. Disk image files (VDI, VMDK, VHD, HDD)
    • 5.3. The Virtual Media Manager
    • 5.4. Special image write modes

Enumerating physical drives in Windows:

C:\Users\win7>wmic diskdrive list brief

Caption                               DeviceID            Model                                 Partitions  Size
Samsung SSD 840 EVO 250GB ATA Device  \\.\PHYSICALDRIVE3  Samsung SSD 840 EVO 250GB ATA Device  6           250057228288
ST1000DM003-1CH162 ATA Device         \\.\PHYSICALDRIVE1  ST1000DM003-1CH162 ATA Device         5           1000202273280
ST1000DM003-1CH162 ATA Device         \\.\PHYSICALDRIVE2  ST1000DM003-1CH162 ATA Device         5           1000202273280
ST1000DM003-1CH162 ATA Device         \\.\PHYSICALDRIVE0  ST1000DM003-1CH162 ATA Device         5           1000202273280
WDC WD1000DHTZ-04N21V0 ATA Device     \\.\PHYSICALDRIVE5  WDC WD1000DHTZ-04N21V0 ATA Device     6           1000202273280
WDC WD1000DHTZ-04N21V0 ATA Device     \\.\PHYSICALDRIVE4  WDC WD1000DHTZ-04N21V0 ATA Device     5           1000202273280
ST1000DM 003-1CH162 SCSI Disk Device  \\.\PHYSICALDRIVE6  ST1000DM 003-1CH162 SCSI Disk Device  5           1000202273280
share|improve this answer
Thanks very much for the clear step by step instructions. One problem I have had however is that the virtual .vmdk file can be owned by me as a user but when I start VirtualBox and it tries to access it an error is generated. This appears to be because the physical /dev/sda is owned by root. I tried changing ownership but no joy - still same error. Starting VirtualBox as root does work (though I'm always cautious about running any application as root, and one such as this with the potential for so much to go wrong scares me silly). –  user339549 Jun 28 '14 at 17:44
Most distros have a special group such as "disk" or "block". Bock devices in /dev/sd? should be writable by users belonging to one of those groups. Check the docs for your distro. –  Ярослав Рахматуллин Jun 28 '14 at 20:44
Here's a link to similar instructions: sysprobs.com/… –  Air Jun 29 '14 at 9:54

The VirtualBox documentation refers to accessing a raw hard disk:


share|improve this answer
Link only answers are less than optimal and are definitely not deserving of acceptance when a better answer is available. *wink wink* –  Ярослав Рахматуллин May 20 '14 at 20:58

Your Answer


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.