Accessing to a "physical" partition from a VM

Discussion in 'Linux Guest OS Discussion' started by AntoineE, Feb 6, 2017.

  1. AntoineE

    AntoineE Bit Poster


    I need to access to a "physical" partition (GUID parition table / ext4 filesystem) from a Linux VM as I do with my Boot Camp partition from my Windows 10 VM.

    VMware Fusion comes with a simple tool named rawdiskCreator that allows the user to create a virtual disk pointing to the partition which he wants to access.

    I tried to add a "Hard disk" with a "Boot camp" type, but only 2 of my 4 partitions are accessible from there. I also tried to import a .vmdk created with the VMware rawdiskCreator tool but Parallels Desktop gave me the following error: "To use a virtual machine with Boot Camp as its hard disk, create it using Parallels Desktop.".
    Any idea on how to do that?

    Thanks in advance.
    Last edited: Feb 6, 2017
  2. PaulChris@Parallels

    PaulChris@Parallels Product Expert Parallels Support

    Hi AntoineE, Please create a virtual machine with BootCamp partition so that you are able to see those drives. Parallels Mounter allows you to browse the contents of your virtual machines and virtual hard disks directly in the Finder, without starting Parallels Explorer. You can mount the virtual disks to access to a physical partition.
  3. AntoineE

    AntoineE Bit Poster

    Hi PaulChris,
    I don't need to access to my virtual drives content from my host OS, I just need to access to an existing partition on my SSD from my Linux guest OS as I do with Windows 10 and my BootCamp partition.

    I will explain my problem better. My SSD is partitioned as below:
    - Partition 1, 2 and 3 = Default partitions for EFI, OSX and OSX recovery
    - Partition 4 = ext4 partition with Debian Linux
    - Partition 5 = NTFS partition with Windows 10

    For Windows 10, I created my VM using the "Use Windows from Boot Camp" option so I can access to my partition 5 (NTFS/Win 10) from my VM and boot on it without any problem.

    For Debian:
    - With VMware I just need to use the rawdiskCreator tool on my partition 4 then I can attach it to my VM as a pseudo-virtual disk.
    - With Parallels Desktop:
    1. I can't import my VM from VMware otherwise I get the following error: "To use a virtual machine with Boot Camp as its hard disk, create it using Parallels Desktop.".
    2. I can't access to my partition 4 using: Add a Hard Disk -> Type: Boot Camp. Parallels only shows me partition 1 (disk0s1) and partition 5 (disk0s5) as you can see on the screenshot below.
  4. Sol_Noblehart

    Sol_Noblehart Bit Poster

    I am having a similar issue, in that, I want to create a VM that accesses the internal extFS4 partition (also disk0s4), but it is not listed in the drop down menu, as shown in a similar screen grab:

    This used to work in Parallels 10, but with older versions of OS X, so I assume the problem has arisen with Apple's implementation of APFS and SIP.

    I've spoken with Parallels support, even letting them take control of my computer, but they said "This is not possible," and "We will look into it further, since you said you were able to do it in previous versions of Parallels." Guess we'll wait and see.

    I have seen other posts about more-or-less tricking Parallels by changing the GPT Typecode, as seen here, but I have not tried this yet, as I don't know where to make this change. Hope this helps move us closer to a solution.
    Last edited: Mar 18, 2018
  5. Sol_Noblehart

    Sol_Noblehart Bit Poster

    I've gotten a little closer to booting my physical Ubuntu partition thru Parallels 13 on my Mac, but haven't the expertise to finalize the solution. I've surmised the issue is with Parallels' generic BIOS versus the new Grub2 boot process, but I don't know how to nail down a work-around. Here's what I've tried so far...

    I figured out how to change the typecode of my Linux/Ubuntu/ExtFS 4 partition. It's just a matter of booting into a live OS from which you can launch gparted, like Ubuntu itself or PartedMagic, then changing the partition's bootflag to "mcsftdata." The partition will then show up in the drop down menu when selecting boot partitions in Parallels.

    I then tried creating an iso of the grub environment within the Ubuntu partition (natively), as described in step two of this lifehacker post (but with customizations for my setup), then used that iso as the first boot option (mounted CD) in Parallels, but that didn't work...I think because I'm not using the correct directories to create the iso... This tactic could be the solution if I can figure out the correct directories.

    The thing is, during installation, Ubuntu now places a small, initial boot loader on the EFI partition, a loader that seems to redirect to /boot/grub/grub.cfg, which does most of the heavy lifting. I don't know that I can create an iso that will pull from both the EFI partition and the root directory this way. Back in the day (when booting a physical linux partition like it was the bootcamp partition actually worked), it seems all the necessary boot files were on the root linux partition, probably in /boot/grub. You just had to select that partition in Parallels and away you went.

    So, I figured the iso image simply needs to act as EFI and redirect the boot process to /boot/grub/grub.cfg, which meant the iso just needed to be a basic Grub2 iso. I downloaded the supergrub2disk iso and used that as the initial bootloader (mounted CD). It takes a moment, but eventually scans my Ubuntu partition and finds all the kernels; however, none of them actually work. Some result in kernel panics; others show the Ubuntu splash screen, only to end in the "rescue mode" terminal. I imagine the grub.cfg file could be edited in some way to allow for both native and VM booting, but have no idea how to make said changes.

    I also thought my fstab or video drivers might be causing the panics and "rescue mode' activation, but after digging into those files, didn't see any noticeable issue. Nothing but the root Ubuntu partition is listed in the fstab and I'm using the standard xorg video drivers that basically serve as safe mode anyway.

    At this point, the only options I can think to try is to use RepairBoot in Ubuntu to purge Grub2 and reinstall Grub (legacy), but I'm afraid of wiping out the MBR and not being able to get back into the Windows partition (natively or otherwise), which has happened many times in the past.

    Any suggestions...besides just creating a stand-alone Ubuntu VM? Booting the physical partition used to "just work" and I want it to work again. Parallels needs to get on the ball because the quickest and easiest solution appears to be simply moving on to VMWare...
  6. S.V.

    S.V. Bit Poster


Share This Page