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
.
These instructions are provided for educational use only and without guarantees. If you lose data because of this, blame yourself, and only follow them if you know what you are doing.
You'll need some info on the position of partitions on the disk. Run sudo gpt -r show /dev/disk1
in the terminal, replacing disk1
with the disk you want to add.
I'll refer to the info from this command later. My output:
$ 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
You'll need to start by changing DiskDescriptor.xml
. I have included my original xml and the changed xml in this gist for reference.
Generate a new guid for the disk and placing it between <UID>
and </UID>
under <Disk_Parameters>
. You can easily generate a UIID using DuckDuckGo by searching for "guid generator". DuckDuckGo should provide a new GUID as instant answer.
Also generate another guid for the <Image>
entries under <StorageData>
. It seems that Parallels uses the same GUID for all <Image>
entries across different <Storage>
entries.
You probably renamed your disk file (the .hdd
file). If not, you should. Also update the name of your disk in the xml file.
For the <Storage>
entries with <Type>Bootcamp_UID</Type>
, change the UID to the UID of the target partitions. For me these partitions are disk1s1
and disk1s2
You can get the UID
of the partitions by running diskutil info disk1s2
. Example output:
$ diskutil info /dev/disk1s2
Device Identifier: disk1s2
Device Node: /dev/disk1s2
Whole: No
Part of Whole: disk1
Volume Name: Data
Mounted: No
Partition Type: Microsoft Basic Data
File System Personality: NTFS
Type (Bundle): ntfs
Name (User Visible): Windows NT File System (NTFS)
OS Can Be Installed: No
Media Type: Generic
Protocol: SATA
SMART Status: Verified
Volume UUID: 0B5D2D8C-80FB-4AA7-B33B-DAEF0C568E22
Disk / Partition UUID: A5B8DEFC-5B16-499C-B8C8-97B3A8287427
Partition Offset: 16777216 Bytes (32768 512-Byte-Device-Blocks)
Disk Size: 500.1 GB (500090011648 Bytes) (exactly 976738304 512-Byte-Units)
Device Block Size: 512 Bytes
Volume Total Space: 0 B (0 Bytes) (exactly 0 512-Byte-Units)
Volume Free Space: 0 B (0 Bytes) (exactly 0 512-Byte-Units)
Read-Only Media: No
Read-Only Volume: Not applicable (not mounted)
Device Location: Internal
Removable Media: Fixed
Solid State: Yes
Hardware AES Support: No
The ID will be under Disk / Partition UUID
. Note that this is different for every partition. You should make sure there are Storage
entries for every partition on the disk. Place the UID under <File>
.
You also need to change the <Start>
and <End>
values for each <Storage>
entry, except for PhysicalMbr.hds
and PhysicalGpt.hds
. You can find these in your gpt -r show
output. The value for <End>
can be calculated by adding the start
and size
values in the command output for the given partition.
For PhysicalGptCopy.hds
, you need to set <Start>
to the value listed as start in your gpt -r show
output, and set <End>
to the value of <Start>
+ 33.
This is my finished <Storage>
entry for my data partition:
<Storage>
<Start>32768</Start>
<End>976771072</End>
<Blocksize>2048</Blocksize>
<Image>
<GUID>{b0f161f5-b065-4d7c-8df0-b2dc974922fa}</GUID>
<Type>Bootcamp_UID</Type>
<File>A5B8DEFC-5B16-499C-B8C8-97B3A8287427</File>
</Image>
</Storage>
Parallels stores a copy of the MBR and GPT, I think to protect the real MBR & GPT. You need to dump these for the disk you want to add.
In the last command, replace the skip value (976773135 in my case) with the start
value in your gpt -r show
command.
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
- Open the configuration of your Boot Camp VM (make sure it is not powered on)
- Go to "Hardware"
- Click the + button to add a new device, and choose "Hard Disk"
- Choose "Existing image file" as type
- Choose your edited disk file
- Click "OK" to add the file to your VM. You will get an error stating that the disk file is invalid. This is expected.
- Quit Parallels
- Locate the
<Hdd>
entry for your disk in theconfig.pvs
file of your VM using a text editor. - Change it to look like mine (see below). Note the added
<Partition>
entry, and also make sure to change the other properties like needed.
<Hdd dyn_lists="Partition 4" id="4" InterfaceType_patch="0">
<Uuid>{991ec375-1215-40bf-826e-48d45f53b16d}</Uuid>
<Index>1</Index>
<Enabled>1</Enabled>
<Connected>1</Connected>
<EmulatedType>3</EmulatedType>
<SystemName>Samsung SSD 860 EVO 500GB Media (disk1).hdd.hdd</SystemName>
<UserFriendlyName>Samsung SSD 860 EVO 500GB Media (disk1).hdd</UserFriendlyName>
<Remote>0</Remote>
<InterfaceType>2</InterfaceType>
<StackIndex>1</StackIndex>
<DiskType>0</DiskType>
<Size>476940</Size>
<SizeOnDisk>0</SizeOnDisk>
<Passthrough>0</Passthrough>
<SubType>0</SubType>
<Splitted>1</Splitted>
<DiskVersion>0</DiskVersion>
<CompatLevel>level2</CompatLevel>
<Partition dyn_lists="" id="3">
<SystemName>/dev/disk1s2</SystemName>
</Partition>
<DeviceDescription></DeviceDescription>
<AutoCompressEnabled>1</AutoCompressEnabled>
<OnlineCompactMode>0</OnlineCompactMode>
</Hdd>
That was it for me – my boot camp VM now has access to my data partition.
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 thatDisk / 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 mainconfig.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 fromconfig.pvs
, cause sometimes Parallels fully rewrites it with kind of wrong information. I have Parallels Desktop Version 14.1.2 (45479).