Skip to content

Instantly share code, notes, and snippets.

@Obbut
Last active September 7, 2024 02:33
Show Gist options
  • Save Obbut/b0a94d96bf2a8069f1c470696ab7f9f2 to your computer and use it in GitHub Desktop.
Save Obbut/b0a94d96bf2a8069f1c470696ab7f9f2 to your computer and use it in GitHub Desktop.
Adding a second physical disk to Parallels

Adding a second physical disk to Parallels Desktop 14

I wanted my (NTFS) data disk to be accessible from my boot camp Parallels VM. Parallels provides no support for this, so I tried it myself.

I duplicated the disk file that Parallels created and started poking around, and after half an hour or so, had success. This is what you need to do.

My boot camp disk is at /dev/disk0. My data disk is at /dev/disk1.

You'll need to start by changing DiskDescriptor.xml.

My original Boot Camp `DiskDescriptor.xml` ``` 976773168 969021 512 512 16 63 0 {00000000-0000-0000-0000-000000000000} {631365f5-35af-43ae-a911-aeddf03d7444} Samsung SSD 970 EVO 500GB Media (disk0).hdd level2 1 0 0 0 0 0 0 0 0 1 2048 {5fbaabe3-6958-40ff-92a7-860e329aab41} Plain PhysicalMbr.hds 1 34 2048 {5fbaabe3-6958-40ff-92a7-860e329aab41} Plain PhysicalGpt.hds 1024000 1226752 2048 {5fbaabe3-6958-40ff-92a7-860e329aab41} Bootcamp_UID AD55BF00-12E6-40D6-A22C-B7EFA3AF8442 1259520 976773120 2048 {5fbaabe3-6958-40ff-92a7-860e329aab41} Bootcamp_UID 6F7BF837-3DE7-4070-B244-30E8D72CBD33 976773135 976773168 2048 {5fbaabe3-6958-40ff-92a7-860e329aab41} Plain PhysicalGptCopy.hds {5fbaabe3-6958-40ff-92a7-860e329aab41} {00000000-0000-0000-0000-000000000000} ```

Dump PhysicalMbr.hds,

sudo dd if=/dev/disk1 bs=512 count=1 of=./PhysicalMbr.hds
sudo dd if=/dev/disk1 bs=512 count=33 skip=1 of=./PhysicalGpt.hds
sudo dd if=/dev/disk1 bs=512 count=33 skip=976773135 of=./PhysicalGptCopy.hds

To determine gpt copy offset:

sudo gpt -r show /dev/disk1

Sample output for this case:

$ sudo gpt -r show /dev/disk1
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34      32734      1  GPT part - E3C9E316-0B5C-4DB8-817D-F92DF00215AE
      32768  976738304      2  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
  976771072       2063         
  976773135         32         Sec GPT table
  976773167          1         Sec GPT header
@itxprs
Copy link

itxprs commented Jan 23, 2020

Hello! This really works, thank you very much! As for me, i needed this knowledge to connect to the Bootcamp OS my third hard disk with НFS+ partition as physical disk and it worked using your guide and after doing a couple of days of testing. Now, my guest Windows 7 can see and do read-write to connected HFS+ with very fast Paragon HFS+ windows driver inside it. I will post some key info here, maybe someone with my case will find it usefull.
Firstly of all, this is my setup from diskutil list listing to be at least understandable:

/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *240.1 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS MacOSX 239.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3

/dev/disk1 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *499.3 GB disk1
1: EFI EFI 209.7 MB disk1s1
2: Apple_HFS DATA 498.9 GB disk1s2

/dev/disk2 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *120.0 GB disk2
1: Windows_NTFS 120.0 GB disk2s1

disk0 is my macOS main SSD, disk2 is second SSD with so called "Bootcamp" with Windows7. disk1 is my usual HDD storage, partitioned as GUID to be available to get that Disk / Partition UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX as the target for desired partition /dev/disk1s2.

Using all that your tricks Obbut, i was able to get physical access to /dev/disk1s2, but Parallels Desktop 14 immediately after starting wrote an error with something like "Cannot load from Bootcamp cause /dev/disk1s2 is unsupported type". So, after few days of investigation i found a problem in main config.pvs file. In the config's section for my second HDD for guestOS there was property
<EmulatedType>3</EmulatedType> . As understood 3 goes for NTFS or FAT32 file systems. After changing in to 2, Parallels was finally able to start normally and Paragon HFS+ in guestOS could successfully mount that partition. Now, when i go into guestOS, my /dev/disk1s2 automatically unmounts, and when i quit Windows, it mounts back for macOS. Also i've changed
<Connected> from 1 to 0 and <AutoCompressEnabled> from 1 to 0. And it is better to remove write access from config.pvs, cause sometimes Parallels fully rewrites it with kind of wrong information. I have Parallels Desktop Version 14.1.2 (45479).

@brianweigit
Copy link

Hi oubbt, for now, there are internal tools builded in parallels desktop that could create hdd file associate with physical hard disk.

the command line as following :
/Applications/Parallels\ Desktop.app/Contents/MacOS/prl_disk_tool create -p --hdd /Users/Brian/Parallels/我的\ Boot\ Camp.pvm/WindowsE.hdd --ext-disk-path /dev/disk5

then use mgmt GUI mount this in your bootcamp virtual machine.

@itxprs
Copy link

itxprs commented Mar 5, 2020

Hello brianweigit! I'm sorry, but i cannot find create in the arguments for prl_dist_tool utility. Neither in my Parallels 14 setup, nor in official docs http://download.parallels.com/doc/psbm/v5/rtm/Parallels_Command_Line_Reference_Guide/30741.htm
Seems that saying "for now", you ment the latest, 15 version of Parallels. That's a good news! Thank you!

@brianweigit
Copy link

Hello brianweigit! I'm sorry, but i cannot find create in the arguments for prl_dist_tool utility. Neither in my Parallels 14 setup, nor in official docs http://download.parallels.com/doc/psbm/v5/rtm/Parallels_Command_Line_Reference_Guide/30741.htm
Seems that saying "for now", you ment the latest, 15 version of Parallels. That's a good news! Thank you!

I didn't test it in PD14, but only in 15 version of PD, and thank you for your guidance and it inspiring me.

@kunalbatra101
Copy link

Can anyone help me with the same. i have 1 SSD and 1 HDD, i am unable to do that. can anyone help me with that how to do it. Thanks in advance.

@kunalbatra101
Copy link

@bra

Hi oubbt, for now, there are internal tools builded in parallels desktop that could create hdd file associate with physical hard disk.

the command line as following :
/Applications/Parallels\ Desktop.app/Contents/MacOS/prl_disk_tool create -p --hdd /Users/Brian/Parallels/我的\ Boot\ Camp.pvm/WindowsE.hdd --ext-disk-path /dev/disk5

then use mgmt GUI mount this in your bootcamp virtual machine.

Hello,
i am able to find prl_disk_tool , but what's next still unable to see my 2 hdd in vm.

@kunalbatra101
Copy link

Hello! This really works, thank you very much! As for me, i needed this knowledge to connect to the Bootcamp OS my third hard disk with НFS+ partition as physical disk and it worked using your guide and after doing a couple of days of testing. Now, my guest Windows 7 can see and do read-write to connected HFS+ with very fast Paragon HFS+ windows driver inside it. I will post some key info here, maybe someone with my case will find it usefull.
Firstly of all, this is my setup from diskutil list listing to be at least understandable:

/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *240.1 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS MacOSX 239.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3

/dev/disk1 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *499.3 GB disk1
1: EFI EFI 209.7 MB disk1s1
2: Apple_HFS DATA 498.9 GB disk1s2

/dev/disk2 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *120.0 GB disk2
1: Windows_NTFS 120.0 GB disk2s1

disk0 is my macOS main SSD, disk2 is second SSD with so called "Bootcamp" with Windows7. disk1 is my usual HDD storage, partitioned as GUID to be available to get that Disk / Partition UUID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX as the target for desired partition /dev/disk1s2.

Using all that your tricks Obbut, i was able to get physical access to /dev/disk1s2, but Parallels Desktop 14 immediately after starting wrote an error with something like "Cannot load from Bootcamp cause /dev/disk1s2 is unsupported type". So, after few days of investigation i found a problem in main config.pvs file. In the config's section for my second HDD for guestOS there was property
<EmulatedType>3</EmulatedType> . As understood 3 goes for NTFS or FAT32 file systems. After changing in to 2, Parallels was finally able to start normally and Paragon HFS+ in guestOS could successfully mount that partition. Now, when i go into guestOS, my /dev/disk1s2 automatically unmounts, and when i quit Windows, it mounts back for macOS. Also i've changed
<Connected> from 1 to 0 and <AutoCompressEnabled> from 1 to 0. And it is better to remove write access from config.pvs, cause sometimes Parallels fully rewrites it with kind of wrong information. I have Parallels Desktop Version 14.1.2 (45479).

hello, itxprs
i have made all the changes you told, still struggling with the same.

can you help me for the same? thanks in advance.

@kunalbatra101
Copy link

How to rectify this error please help me with that.

Error New

@SdotVdot
Copy link

You can use Parallels 12 to generate this .xml. Have you tried?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment