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 brianweigit! I'm sorry, but i cannot find
create
in the arguments forprl_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.htmSeems that saying "for now", you ment the latest, 15 version of Parallels. That's a good news! Thank you!