As an alternative to using virtual disk images as described in Chapter 5, Virtual Storage, Oracle VM VirtualBox can also present either entire physical hard disks or selected partitions as virtual disks to virtual machines. With Oracle VM VirtualBox, this type of access is called raw hard disk access. It enables a guest operating system to.
Now, you want to take your physical hard drive and have VirtualBox treat it like a virtual machine disk. Start by finding the mount point of your hard drive. Open up Disk Utility. Press Command +. Create a New VM from within VirtualBox Manager and choose 'Use an existing virtual disk file' which points to your newly created VDI file. After it is created open Settings for the VM. Under System Motherboard make sure only Hard Disk and Optical is selected, Optical is at the top of the boot order and 'Enable EFI (special OSes only)' is ticked. Migrate from a virtual machine (VM) to a physical system; Using a raw host hard disk from a guest; Using a Physical Hard Drive with a VirtualBox VM; VirtualBox: using physical partition as virtual drive; I think I can do that, but I'm not sure about the result for my issue.
Oracle VirtualBox course
This comes from the good article here, or in the VirtualBox documentation.
Virtualization has been a tremendous help to developers such as myself. It keeps us from having to keep a pile of hard drives/machines all running different operating systems. And while this is great, there are some times when you might want to use a raw hard drive. For example, if you pull a hard drive out of an existing system and want to keep the OS/data intact but use it as a virtual machine inside another host OS.
Well, you can set up VirtualBox to use a physical hard drive inside a VM. This method is called “raw hard disk access.” This allows you to mount or boot a secondary hard drive or external USB as your storage device inside the VM.
Warning: Do not attempt to mount or boot the partition that runs the host OS with a VM, as that can lead to severe data corruption. And no matter which drive or partition you want to mount, it’s always a good idea to back up any existing data on it before continuing.
Creating the Virtual Machine:
You’ll first want to create a virtual machine within the VirtualBox GUI. Choose all options like normal, but when asked about the virtual hard drive, select Do not add a virtual hard drive.
Next, you’ll need to find the path and drive number of the physical drive you’d like to mount:
In Windows, open Disk Management. You’ll see the associated drive numbers on the left and will identify them later as PhysicalDrive0, PhysicalDrive1, etc.
In Linux, run the following command:
sudo fdisk -l. You’ll see a listing of the partitions. Make note of the desired drive in the format of dev/sda0, dev/sda1, etc.
In Max OS X, use the following command:
diskutil list. You’ll see a listing of the partitions. Make note of the desired drive in the format of /dev/disk0, /dev/disk1, etc.
Now open the CLI of your OS. If you’re using Windows as the host OS you will also need to go to the root directory of VirtualBox using the following command: cd C:Program FilesOracleVirtualBox
Virtualbox Use Physical Disk In Computer
Creating the VirtualBox Hard Drive:
Now you can run the command to create the virtual hard drive file that points to your desired physical drive. For each of the following examples ensure that you input the desired names between the arrows and replace the number or pound sign with your desired drive number.
You often must be administrator to run this command. Make sure your cmd.exe is running as administrator. This also means you must start VirtualBox as administrator to use these drive links.
VBoxManage internalcommands createrawvmdk -filename 'C:UsersVirtualBox VMs.vmdk' -rawdisk .PhysicalDrive#
VBoxManage internalcommands createrawvmdk -filename '.vmdk' -rawdisk /dev/sda
For Mac OS X:
VBoxManage internalcommands createrawvmdk -filename '.vmdk' -rawdisk /dev/disk#
Virtualbox Use Physical Disk Ubuntu
This VMDK will be a very small file that simply points to your physical drive. Now you can attach the VMDK to your VM. To do so, open the VirtualBox GUI, select the desired VM, click Settings, clickStorage, click Add Hard Disk button, select Choose existing drive, and then select the VMDK file you just created.