Let’s say you have a dual boot system with a Windows 10 installation on 1 disk and a Linux installation on another disk. With Virtualbox, it’s possible to use the Windows 10 installation as a guest from within a Linux host. It works surprisingly well. These are the steps:
1. Create the raw disk image
For VirtualBox to use the physical hard disk instead of a virtual disk, we need to establish access to it. This is done by creating a small .vmdk file that is linked to this hard disk. Use
sudo fdisk -l to determine the drive name. Be carefull not to use your host installation, this will lead to unrepairable corruption.
sudo VBoxManage internalcommands createrawvmdk -filename /home/user/win10dual.vmdk -rawdisk /dev/sdb
2. Create the VM
For this to work, Virtualbox needs to be started as root
sudo VirtualBox. Add a new Windows 10 virtual machine as usual, but do not create a virtual hard disk. Instead,
use an existing virtual hard disk file, add the vmdk we just created and select it.
Next we need to specify if Windows uses
EFI boot or
BIOS/MBR legacy boot
For better fullscreen support I disable the mini toolbar in Fullscreen / seamless mode.
Now we’re ready to boot!
3. Guest additions
Last step is to install guest additions.
Devices > Insert Guest Additions CD image…
Or download it from here, after selecting the right VirtualBox version.
Now we can use our dual boot Windows 10 installation as a Virtualbox guest in Linux. In fullscreen, with shared folders and everything. This was surprisingly easy to accomplish.
For more information, like mounting specific partitions instead of an entire hard disk. Look over here.
It’s safer to create the vmdk file using uuid.
ls -l /dev/disk/by-id
Recreate the vmdk file
sudo VBoxManage internalcommands createrawvmdk -filename /home/user/win10dual.vmdk -rawdisk /dev/disk/by-id/ata-WD_SDSSDHII10030G_15453543540454353