
Once you have obtained the drive number, you are ready to open the CLI of your operating system. The format for disks in Linux is dev/sda0, dev/sda1, etc. Linux: To list the partitions in Linux, the “sudo fdisk -l” command is used. The drive names will be displayed in the format /dev/disk0, /dev/disk1, and so on. Mac OS X: Enter the “diskutil list” command which returns a list of the available disk partitions. They will be identified as PhysicalDrive0, PhysicalDrive1, etc. Windows: Open Disk Management where the drive numbers will be displayed on the left side. Use the appropriate method for your host operating system. You will need to identify the drive number and path of the physical drive you intend to mount. Choose the “Do not add a virtual hard drive” option.
Use your regular configuration except for the selection of a virtual hard drive.
The first step is to use the VirtualBox user interface to create a virtual machine. Avoid mounting or booting the partition running the host operating system, as it may result in substantial data corruption. Note: You should always backup your data before attempting to mount drives or partitions in your virtual machine. We will demonstrate how to accomplish this on Windows, Mac OS X, and Linux host operating systems.
The advantages of this method include giving users the ability to boot their system from an external USB drive or additional hard disk. This is where the whole VirtualBox physical hard drive is mounted.
We will be discussing the method known as VirtualBox raw hard disk access. You can designate specific partitions to be mounted or choose to use the complete disk. VirtualBox enables you to mount all or part of a hard drive. At times, it may be more beneficial to mount or boot a physical hard drive directly from a guest VM.
One option is to use the contents of a physical drive to create a virtual hard disk image. There are multiple methods of accessing the data on a hard drive from within virtual environments.