Booting a virtual machine from a physical Windows disk partition

I am a long time Linux user (Mint being my preferred distro) and have dual booted Windows and Linux on every computer I have owned in the last decade. Recently, I have been using Linux Mint 19.3 as my primary operating system, booting into it more often than Windows 10. I do still use Windows regularly; it is my preferred operating system for playing games and for .NET development with Visual Studio. Switching between each operating system required a reboot of my machine, and I contemplated creating a new virtual machine instance for Windows 10 (using Oracle’s VirtualBox) so I could target Linux and Windows at the same time. However, this would require going through the Windows installation process from scratch, configuring everything to my liking, installing all the software and development tools I require, etc. This approach would be an acceptable solution, but I would then have two separate Windows machines, one virtual and one physical. I didn’t want to maintain two separate Windows environments for daily use. I also didn’t necessarily want to make the switch to use Windows in a VM 100% of the time, I still wanted to be able to boot into Windows. So I pondered the question “can I create a virtual machine from the existing Windows 10 installation on my hard drive?” After some quick Googling, I was surprised to learn that the answer is “yes!” I found this post from Jamie Scaife’s blog and this question on to be particularly helpful. Such a solution is ideal for me – I can boot into Linux Mint for my regular daily use and run the Windows 10 VM from there to do .NET development and other Windows-specific tasks. I can also boot directly into Windows if I choose. The concept is pretty straight forward – A Virtual Machine Disk file (VMDK) points to the physical partition, and that file is used to create a virtual machine. Here’s how I set it up:

The first step is to identify the disk which contains my Windows installation. As I mentioned above I’m using Linux Mint 19.3, so this can be accomplished with the lsblk command or the “Disks” GUI application included with Mint:


As you can see, I have multiple disks each with multiple partitions. I know that my Windows partition is formatted as NTFS and is about 300 GB in size, so I was able to determine that device /dev/sda2 is my Windows installation. Note that the device name may differ on your machine. In my Windows installation, I also have a secondary disk with a NTFS partition for storage (I call it my “XtraDisk”) mapped to the “X:\” drive (clever name & drive letter, I know). That partition is device /dev/sdb1.

The next step was to grant my username full read and write permission to the disk. This is done by first creating a new group account called “win10disk”:

sudo groupadd win10disk

Then I added my username to the group with command “usermod.” The “-a” option appends the user (matt) to the group, the “-G” option specifies the group (win10disk).

sudo usermod -a -G win10disk matt

Next, I determined the UUID of my Windows disk and my XtraDisk using command “udevadm” and searching for “UUID”:

sudo udevadm info /dev/sda2 | grep UUID

sudo udevadm info /dev/sdb1 | grep UUID

The output I’m interested in when running each command looks something like this, where “E:” indicates a device environment variable with the name “ID_PART_TABLE_UUID” and its value after the equals sign:



I then created two files called “win10disk.rules” and “win10xtradisk.rules” in the udev rules directory:

sudo touch /etc/udev/rules.d/win10disk.rules

sudo touch /etc/udev/rules.d/win10xtradisk.rules

I edited the contents of each file to contain the following:


ENV{ID_PART_TABLE_UUID}=="05e17bc2", GROUP="win10disk"


ENV{ID_PART_TABLE_UUID}=="226eafff", GROUP="win10disk"

In each file, the “ID_PART_TABLE_UUID” environment variable is checked (== operator), and “GROUP” is assigned the “win10disk” group I created. I then saved the rules files, and rebooted my machine back into Linux Mint. Before I created the virtual machine, I needed to create two Virtual Machine Disk (VMDK) files that represent the Windows installation disk and my storage “XtraDisk” disk. These files are essentially pointers to the physical disks themselves. To create a VirtualBox raw disk image, use the VBoxManage command, specifying location in the -filename argument and the device name for the -rawdisk argument. Note again the different device names for each, “/dev/sda” and “/dev/sdb” – these may be different on your computer:

VBoxManage internalcommands createrawvmdk -filename /home/matt/VirtualBox VMs/disks/Win10/Win10VirtualDisk.vmdk -rawdisk /dev/sda

VBoxManage internalcommands createrawvmdk -filename /home/matt/VirtualBox VMs/disks/Win10/Win10VirtualXtraDisk.vmdk -rawdisk /dev/sdb -partitions 1

The first disk I created, Win10VirtualDisk.vmdk will use the entire disk on /dev/sda. This second disk I created, Win10VirtualXtraDisk.vmdk, uses only one partition as specified by the -partitions argument. I then opened VirtualBox and clicked “New” to create a new virtual machine. I will be using my Windows VM for .NET development with Visual Studio 2019 which can be quite a resource hog, so I allocated 16 GB of RAM to this VM. Remember that the host machine still needs sufficient hardware resources to run the VM, so set this option accordingly. Under the “Hard Disk” option, I set option “Use an existing virtual disk file” and selected the “Win10VirtualDisk.vmdk” I just created:

I then clicked “Create” and the virtual machine was ready to go. Before booting, I want to make sure my “XtraDisk” is available so it can be mapped to the “X:\” drive on boot. I opened the machine’s settings, selected the “Storage” menu option, and under “Storage Devices” I clicked the “Add hard disk” (green plus) button next to the SATA Controller. I clicked “Choose existing disk” and selected file “Win10VirtualXtraDisk.vmdk” I created earlier.

While in the settings, I allocated 4 CPU cores to this VM, set the video memory to the maximum 128 MB, and changed the network adapter to bridged. The virtual machine is now ready to boot! When I start the machine, I’m presented with the GRUB boot menu and must select the Windows 10 operating system.

There are a couple important things I want to highlight first before booting the virtual machine. The first is that you should not boot the VM into the same operating system and partition which is currently running the host (Linux Mint 19.3 Cinnamon in my example). I’m not 100% sure what are the implications of doing so are, but I imagine there is a high potential for disk corruption and/or loss of data. Best case scenario is that fsck could be used to repair the file system, worst case scenario would be a complete loss of data, requiring a reformat of the entire disk and re-installation of both operating systems. To avoid accidentally booting into Linux on this VM, I set the default GRUB menu selection to Windows. This is especially helpful, as Windows sometimes like to restart on its own after an update, and if you are not paying attention you want the VM to boot back into Windows.

Secondly, I want to point out that you should unmount any disks that are also in use by the Windows VM to avoid data corruption. I set the “XtraDisk” partition to automatically mount on Linux Mint startup, so before booting the Windows VM, I unmount this.

Once the Windows VM was booted up, I verified that my “X:\” drive was mapped and I was able to access files on that disk. I also have a network share mapped to the “H:\” drive and verified that was working and files were accessible.

That’s pretty much it! I now have a seamless transition between Linux and Windows without the need to reboot my machine, but still also have the option to boot directly into the same Windows instance on system startup. One additional thing to note is that depending on the version of Windows you are running, the change in hardware may prompt you to re-activate Windows with your license key.

edit: June 18, 2020

Adding a quick addendum to this post regarding Windows activation: I discovered that I am able to edit the UUID of my VM and set it to the same value as the UUID originally used by my Windows installation. While booted into Windows normally, I ran this command to obtain the UUID:

wmic csproduct get UUID

I then edited the uuid property under the <Machine> element of the .vbox file which contains my Windows virtual machine, setting its value to the same UUID I obtained above:

This should eliminate any issues Windows may have with prompting for re-activation when switching between booting the VM and booting normally.

34 thoughts on “Booting a virtual machine from a physical Windows disk partition

  1. Hey, Thanks for this post, sounded promising. I’ve must have done something wrong as I’m stuck at the UEFI Interactive shell 2.2 after “map No mapping found” error message.
    Could you give me a hint? Thanks

    Liked by 1 person

        1. Yes i can do “exit” at the shell and when I go in “Boot Manager” I can only choose UEFI devices. If I disable UEFI on VM configuration it just won’t boot either with black screen. Same thing if click to choose boot device and select hard disk while UEFI disable in VM config.


  2. I eventually fixed the issue bu creating the virtual disk with command “VBoxManage internalcommands createrawvmdk -filename ./Win10VirtualDisk.vmdk -rawdisk /dev/sda” instead of “sda1”. Now I am getting into GRUB menu.
    Thanks for your help and support.

    Liked by 1 person

    1. Thanks for it.
      I was wondering about it, when the guide mentioned mounting the partition, and then mentioned booting into grub. Didn’t make sense ๐Ÿ˜‰
      Maybe it should be corrected in the post.

      Other than that, awesome guide! Thank you!


  3. Hi Matt,
    Thanks for this useful post.
    I’m stuck in the ‘Creating the raw disk image’ step with this message : “VBoxManage: error: Cannot open the raw disk ‘/dev/sda4’: VERR_ACCESS_DENIED”. It’s fine as su, but then I face permission rights issue when creating the VM and pointing at the ‘existing virtual hard disk file’…
    NB : Linux Mint 19.3 as host, Windows 8 as guest.
    Thank you in advance for your help!

    Liked by 1 person

      1. Thank you for your reply.
        Yes I did.
        I unmounted the drives and saved the VMDK file on my home directory, so I could then go through the entire process (VM creation and setup in VirtualBox). But when I boot the VM, I get a black screen with a prompt in the upper left corner, that’s all…
        Would it be due to a wrong ID_PART_TABLE_UUID ? Or ?
        Thx again for helping – would appreciate to switch from Mint to Win without logging out and rebooting ๐Ÿ˜‰


  4. Hi Matt,
    Yes I did a reboot. The user ‘yan’ is in the ‘win8disk’ group.
    I’ve recreated the VMDK files, the VM in VirtualBox but when I boot it I still get a black screen with a lonesome prompt… no GRUB menu at all…
    I guess I’ll have to make an ISO from my Win disk and then create a VM from it. Which will require uselessly another 70Gb of disk space. Unless you have an idea of what’s going wrong. Thanks again for your help.


    1. Hi Yan,
      To create the VMDK file have you tried the create commande with only the device withoutr the device sumber such as the command: โ€œVBoxManage internalcommands createrawvmdk -filename ./Win10VirtualDisk.vmdk -rawdisk /dev/sdaโ€ ? For evrything else I followed Matt instructions and it works like a charm.
      It did solved my issues although somehow different from yours, but it’s worth a try.


      1. Hi GEO34980,
        Thx for helping. I ran the VBoxManage command line, which created the VMDK files. I both tried ‘/dev/sda4’ (Win boot partition) and ‘/dev/sda’ to get to the GRUB menu but none worked – the second one even led to a boot loader error msg.
        Is it due to UEFI or something ? Btw, my Win and Linux partitions are logical (same physical drive).
        Thx again GEO34980 and everyone for giving a hand ๐Ÿ˜‰
        PS : GEO34980, are you French ?


    2. Did you ever resolve your issue? My experience is exactly the same! The only thing different about my system (ThinkPad X1 Yoga laptop) is that my internal drive is an SSD, and uses /dev/nvme0n1 as the drive with /dev/nvme0n1pe as the Windows 10 partition. Please let me know. Thanks!


      1. I eventually fixed the issue (nov 2nd see above) by creating the virtual disk with command โ€œVBoxManage internalcommands createrawvmdk -filename ./Win10VirtualDisk.vmdk -rawdisk /dev/sdaโ€ instead of โ€œsda1โ€. Now I am getting into GRUB menu.

        Liked by 1 person

      2. Sorry GEO34980 — I thought I was replying to YAN’s message about that solution not working. ๐Ÿ˜€

        However, I do see something to try, since my internal drive is described as (using lsblk) :

        nvme0n1 259:0 0 477G 0 disk
        โ”œโ”€nvme0n1p1 259:1 0 260M 0 part /boot/efi
        โ”œโ”€nvme0n1p2 259:2 0 16M 0 part
        โ”œโ”€nvme0n1p3 259:3 0 102.9G 0 part
        โ”œโ”€nvme0n1p4 259:4 0 1000M 0 part
        โ””โ”€nvme0n1p5 259:5 0 372.8G 0 part /

        where p1 is the boot partition, p3 is the Win10 partition, and p5 is linux. I’ve tried creating virtual drives mapped to nvme0n1p3, nvme0n1p1, and nvme0n1 (the last two had the same value for ID_PART_TABLE_UUID) and got either a blinking cursor or a message saying no boot media.

        HOWEVER, I have not tried mapping to /dev/nvme0 — perhaps that is the actual device (I saw it listed in something I was looking at) similar to your /dev/sda

        Thanks for the reply!


      3. I got mine working using the “sda” solution. My issue was that I had not checked the “Enable EFI” checkbox under System settings for the virtual machine. Once I did that it worked GREAT on the configuration where I defined the drive at the device level (as opposed to the partition level).


      4. Did anyone using this configuration experience a loss of ability to boot off the Windows drive recently? My Windows “machine” did an update recently when I shut down, and after the next time I used it (completed updates on THAT startup) it will now no longer boot into Windows — this goes both for the Virtualbox “machine” AND if I reboot my laptop and select Windows from the actual boot menu.

        Liked by 1 person

        1. Derek – I have experienced similar issues where I was unable to boot into either or both operating systems after an update. It sounds like you are still seeing the GRUB boot menu, correct? And if you select the Windows option, you are not able to boot into it? Are you seeing any error messages at any point?


      5. If I select the “Windows boot” option, the screen flashes and it’s right back to the same menu but with the top/default “mint boot” selection highlighted. No error messages (or if so they are gone before I can see them).

        When I tried actually booting the laptop into Windows, the next time I tried booting into Mint I got dumped into a console screen that said my linux partition needed to have fschk manually run on it, so I did and there were a slew of issues to correct. After that, the first time I tried booting into Mint I ended up at the Lenovo bios screen, saved it, and then things work as before as far as booting Mint. The Windows option still did nothing.

        Seems like it’s related to the update here:
        I have an SSD in my laptop.

        I’m still able to mount the Windows partition as a drive in Mint and the contents are there, so this seems to be just an issue with the boot mechanism.


        1. Oh wow, I was not aware of this new Windows update issue. I haven’t booted up my Windows disk in a little while, so I have not received the “KB5001330” update and can’t comment as of yet how if affected my virtual/dual boot setup. If you have your Windows install disk handy, I’d boot into that, select Troubleshoot > Advanced options > and run the “Startup Repair” utility. There is also an option for “Uninstall Updates” where you could also try uninstalling update KB5001330.


          1. Good suggestion! I made a “Windows repair” USB stick when I first got my laptop, so I could boot it into that and see — I’m always a little leery of Windows tools, because I fear they will step on GRUB.

            I will try this and let you know the results. Thanks!

            Liked by 1 person

  5. After changing the UUID in the .vbox file, you have to also add the same UUID in the appropriate section in ~/.config/VirtualBox/VirtualBox.xml otherwise it won’t work.


    1. Hi Yan,
      Yes I am French, my Linux and Windows partition are on the same drive. Windows and Linux are booting legacy boot. Grub fetch for Windows on sda1. Partition 1 is MB, partition 2 is Windows, partition 3 is Windows system reserved, partition 4 is Linux.


      1. Salut GEO34980,
        I’m French too ๐Ÿ˜‰ My config is more or less the same as yours, legacy boot too.
        Maybe we can keep on sharing to find out what’s going wrong with my VMs in French without trolling Matt’s blog? Feel free to email me at depensesAROBASElavachePOINTcom. Merci d’avance !
        Other people’s bright ideas remain welcome ๐Ÿ˜‰


  6. Thanks Matt! I have been trying to solve this exact problem as I get ready to finally switch to Linux as my daily driver. I have been searching “down the rabbit hole” the last few days and this is the most helpful guide by a large margin. I will let you know if I have troubles not previously listed above but for now, thank you sir! ๐Ÿ˜‰

    Liked by 1 person

      1. Hi Matt,
        Thanks! I actually do have a question: I am not sure I understand your warning here…

        I am currently booted up in Fedora and getting ready to attempt a launch of the windows partition using Virtual Box or Virt Manager. I followed the steps you listed above and all seems good so far. But I am afraid to click launch based on this warning you gave. Am I okay here? Do I need to put this off another day and back everything up?

        “There are a couple important things I want to highlight first before booting the virtual machine. The first is that you should not boot the VM into the same operating system and partition which is currently running the host (Linux Mint 19.3 Cinnamon in my example). Iโ€™m not 100% sure what are the implications of doing so are, but I imagine there is a high potential for disk corruption and/or loss of data. Best case scenario is that fsck could be used to repair the file system, worst case scenario would be a complete loss of data, requiring a reformat of the entire disk and re-installation of both operating systems. To avoid accidentally booting into Linux on this VM, I set the default GRUB menu selection to Windows. This is especially helpful, as Windows sometimes like to restart on its own after an update, and if you are not paying attention you want the VM to boot back into Windows.”


        1. The warning applies when you boot the same operating system virtually as you are currently running natively. So in your case, Fedora is the host OS – you wouldn’t want to start a virtual machine that points to the same location on disk as the host OS which is currently running. This explains it a bit better, but you would basically be accessing the partition twice and likely cause file corruption:

          In your case, however, it will be fine. If you have a dual boot setup with Windows and Fedora, when you boot into Fedora you are perfectly fine to start the virtual machine that points to the Windows partition on your disk. And the opposite is true as well – you can boot natively into Windows and then start a VM that points to your Fedora partition.


          1. Oh okay, gotcha! That was what I assumed, but I got lost in the wording because I’m still a bit of a noob. ๐Ÿ˜‰
            Plus I’ve had my fair share of disasters. Hence I decided now is a good time to do my backups anyway. I will do that before running the tests. In a week I will have the new hardware for the PC upgrade, which is when I will officially switch to Linux while keeping the old Windows disk in there for this purpose. Thanks!

            Liked by 1 person

  7. Hi Matt, great guide.
    I am having an issue with the System UUID, I changed it as per the edit in the end of your post however now It won’t boot in the VM (bad system config error) but if I boot normally on my primary machine it works. Is it something to do with Boot Manager?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s