VMware Communities
ser2018
Contributor
Contributor

Adding a physical disk: problem booting

I am trying to add a physical disk as an IDE disk to a virtual machine with VMWare Fusion. For that, I use vmware-rawdiskCreator to create a .vmdk file that will represent a connection to my external hard drive, following the procedure at TechReminders: Add physical disk to VMware Fusion guest OS. It seems to go well (no errors), but when booting the VM there is an error window ("Operation not permitted" : "Cannot open the disk '...MyVM.vmwarevm/rawDiskFile.vmdk' or one of the snapshot disks it depends on. Module 'Disk' power on failed. Failed to start the virtual machine."). Looking at the vmware.log file within the virtual machine file I see these types of errors:

2018-09-29T16:38:12.426+01:00| vmx| I125: DISKLIB-DSCPTR: Opened [0]: "rawDiskFile-pt.vmdk" 0 (0xa)

2018-09-29T16:38:12.426+01:00| vmx| I125: DISKLIB-DSCPTR: Opened [1]:  (0xa)

2018-09-29T16:38:12.426+01:00| vmx| I125: DISKLIB-DSCPTR: Opened [2]:  (0xa)

2018-09-29T16:38:12.430+01:00| vmx| I125: RawDiskAuthReadPrivilegesDictionary: processing 'always ask' UIDs: ''

2018-09-29T16:38:12.430+01:00| vmx| I125: RawDiskAuthReadPrivilegesDictionary: processing 'never ask' UIDs: '501'

2018-09-29T16:38:12.430+01:00| vmx| I125: DISKLIB-FLAT  : opening raw device /dev/rdisk2

2018-09-29T16:38:12.504+01:00| vmx| I125: DISKLIB-FLAT  : Unmounted "/dev/disk2" on open.

2018-09-29T16:38:12.504+01:00| vmx| I125: FILE:open error on /dev/rdisk2: Operation not permitted

2018-09-29T16:38:12.504+01:00| vmx| I125: AIOGNRC: Failed to open '/dev/rdisk2' : Operation not permitted (10002) (0x10103).

2018-09-29T16:38:12.504+01:00| vmx| I125: OBJLIB-FILEBE : FileBEOpen: can't open '/dev/rdisk2' : Operation not permitted (65540).

2018-09-29T16:38:12.504+01:00| vmx| I125: DISKLIB-FLAT  : "/dev/rdisk2" : failed to open (65545): ObjLib_Open failed.

Any idea would be great!

0 Kudos
13 Replies
bluefirestorm
Champion
Champion

I have used this VMware KB https://kb.vmware.com/kb/2097401 as a guide to create raw disk for Fusion VMs (Windows 10 and Linux); the external drive is an SSD in a USB 3.0 enclosure. I used "sata" instead of "ide" though.

Try changing the Boot Camp privileges prompt. Go to the VM settings, Advanced and change the "Administrative Privileges for Boot Camp disks" to "Always Ask". Maybe yours is set to "Never ask" at the moment and it results of being denied access to the raw disk.

2018-09-29T16:38:12.430+01:00| vmx| I125: RawDiskAuthReadPrivilegesDictionary: processing 'always ask' UIDs: ''

2018-09-29T16:38:12.430+01:00| vmx| I125: RawDiskAuthReadPrivilegesDictionary: processing 'never ask' UIDs: '501'

2018-09-29T16:38:12.504+01:00| vmx| I125: FILE:open error on /dev/rdisk2: Operation not permitted

0 Kudos
ser2018
Contributor
Contributor

Thank you for the nice idea. I tried both possibilities (setting the "Administrative Privileges for Boot Camp disks" to "Always Ask" -it was set to "Never ask"- and using sata instead of ide), both independently and in combination. However, the problem is still the same.

Any other ideas?

Just in case it helps, I indicate the relevant output of "diskutil list":

/dev/disk2 (external, physical):

  #:                      TYPE NAME                    SIZE      IDENTIFIER

  0:      GUID_partition_scheme                        *256.1 GB  disk2

  1:                        EFI EFI                    209.7 MB  disk2s1

  2:                Apple_APFS Container disk3        123.8 GB  disk2s2

  3:                Apple_APFS Container disk4        132.0 GB  disk2s3

/dev/disk3 (synthesized):

  #:                      TYPE NAME                    SIZE      IDENTIFIER

  0:      APFS Container Scheme -                      +123.8 GB  disk3

                                Physical Store disk2s2

  1:                APFS Volume SDD-M              71.7 GB    disk3s1

  2:                APFS Volume Preboot                42.0 MB    disk3s2

  3:                APFS Volume Recovery                512.4 MB  disk3s3

  4:                APFS Volume VM                      1.1 GB    disk3s4

The command "/Applications/VMware\ Fusion.app/Contents/Library/vmware-rawdiskCreator print /dev/disk2" returns the following:

NrStartSize Type Id Sytem

-- ---------- ---------- ---- -- ------------------------

12048409600  GPT EE Efi System
2411648  241894000  GPT EE Unknown

3  242305648  257812504  GPT EE Unknown

Where "SDD-M" is the volume I want to access. For that purpose, I am using the create command as follows:

/Applications/VMware\ Fusion.app/Contents/Library/vmware-rawdiskCreator create /dev/disk2 2 /Volumes/Datos/BACKUPS-NO-TIME-MACHINE/VM/WMWare/M-SSD/M-SSD.vmwarevm/rawDiskFile ide

(also tried with "sata" instead of "ide", as well as other combinations)

I can mount and access the volume SDD-M with no problem in the host system.

Maybe I need to define the volume as a "Boot Camp partition" somehow? I have not used the Boot Camp Assistant and I had no intention of using it, as I think it is for a different purpose.

Thank you.

0 Kudos
bluefirestorm
Champion
Champion

I assume your host is at least High Sierra or Mojave as the partitions that you have listed are on APFS. What about your Fusion version?

It looks like the raw disk that you want to create also contains either High Sierra or Mojave.

I am still on macOS Sierra 10.12.6 with Fusion 8.5.10. In both the Windows VM and Linux VM raw disks, I used "fullDevice" instead of specifying a specific partition. The Linux raw disk was created on another (non-Apple) laptop and the Linux VM raw disk booted up without any obvious problem under Fusion 8.5.x. And then I wiped out this Linux installation and installed it with the Windows 10 OS. So it was like having a Windows Bootcamp Partition running as a Fusion VM but on an external USB SSD drive. I could even boot up the Windows 10 OS that was running as VM with raw disk from the external USB SSD on the physical MacBook Pro by holding the "Option" key. This was just an experiment and not for a permanent setup.

So perhaps you should try "fullDevice". High Sierra and Mojave might also have security restrictions in accessing the disk. Check the Security settings whether any VMware kext is being blocked.

Sorry to digress, it has also crossed my mind to create a raw disk from an old 2010 MacBook Pro with High Sierra installed in an SSD. But since the 2014 MacBook Pro that I have is still on Sierra with Fusion 8.x, I may have to wait until I have a High Sierra or Mojave host with Fusion 11.x until I give that a try.

0 Kudos
ser2018
Contributor
Contributor

Thank you very much for the ideas.

I am using Fusion 10 and High Sierra. The security settings seem to be fine. I am not sure that I can use the "fullDevice" option, as one of the partitions of the external disk needs to be mounted on the host system.

Thank you.

0 Kudos
bluefirestorm
Champion
Champion

Does the raw disk creator utility allow you to create a fullDevice raw disk based on the synthetic /dev/disk3 ?

0 Kudos
ser2018
Contributor
Contributor

Thanks a lot for this idea! After some temporary failures ("Unable to create the source raw disk: Unknown object error (6475).") that might be related to the fact that the volume was probably mounted in the host system (I am not completely sure if this was the reason), I managed to create the fullDevice raw disk pointing to /dev/disk3. Moreover, I start the VM and I don't get the error anymore.

The problem now is that the partition does not boot (despite selecting that disk as startup disk). Maybe it is because it does not know which partition contains the volume to boot? I tried to create the raw virtual disk specifying the partition (with "vmware-rawdiskCreator create /dev/disk3 1"), but then I get this error:

Unable to open "/dev/disk3": 16

Unable to determine partition start sector(s).

Just in case it is useful, /Applications/VMware\ Fusion.app/Contents/Library/vmware-rawdiskCreator print /dev/disk3 returns:

Unable to open "/dev/disk3": 16

(I executed this after doing the previous steps, so I wonder if maybe it is unable to open because some ohter process opened it already, even though the volume is mounted?)

The solution seems closer but not yet...

Thanks.

0 Kudos
continuum
Immortal
Immortal

As far as I know no version of Fusion does support APFS formatted raw devices at the moment.
See related discussions like
VMWare Fusion 10, Attach physical APFS volume to Mac VM


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
bluefirestorm
Champion
Champion

@ser2018,

Some good news (sort of) as I was able to boot up the SSD from the 2010 MacBook Pro that has High Sierra 10.13.6 with APFS partitions. But I do not know if you will be able to replicate with Fusion 10.x/High Sierra host and disk partitions you have with your external disk.

I attached the SSD to the same USB 3.0 enclosure that I had used previously. When I attach the USB 3.0 enclosure, only "SD480" is mounted on the macOS Sierra host.

/dev/disk2 (external, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *480.1 GB   disk2

   1:                        EFI EFI                     209.7 MB   disk2s1

   2:                 Apple_APFS Container disk3         479.9 GB   disk2s2

/dev/disk3 (synthesized):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      APFS Container Scheme -                      +479.9 GB   disk3

                                 Physical Store disk2s2

   1:                APFS Volume SD480                   223.4 GB   disk3s1

   2:                APFS Volume Preboot                 20.0 MB    disk3s2

   3:                APFS Volume Recovery                516.1 MB   disk3s3

   4:                APFS Volume VM                      4.3 GB     disk3s4

I went about this in certainly a lazy and almost haphazard way as I simply replaced the virtual disk VMDK of an existing macOS High Sierra VM with the raw disk. I created a fullDevice based on /dev/disk2 with sata option.

I probably encountered the same errors as you did.

| vmx| I125: RawDiskAuthReadPrivilegesDictionary: processing 'always ask' UIDs: '501'

| vmx| I125: RawDiskAuthReadPrivilegesDictionary: processing 'never ask' UIDs: ''

| vmx| I125: DISKLIB-FLAT  : opening raw device /dev/rdisk2

| vmx| I125: DISKLIB-FLAT  : Unmounted "/dev/disk2" on open.

| vmx| I125: FileIOErrno2Result: Unexpected errno=16, Resource busy

| vmx| I125: AIOGNRC: Failed to open '/dev/rdisk2' : Resource busy (100002) (0x10103).

| vmx| I125: OBJLIB-FILEBE : FileBEOpen: can't open '/dev/rdisk2' : Resource busy (1048580).

| vmx| I125: DISKLIB-FLAT  : "/dev/rdisk2" : failed to open (1048585): ObjLib_Open failed.

| vmx| I125: DISKLIB-FLAT  : Requesting "/dev/disk2" to be remounted on open failure.

The key here seems to be once it fails to power up; it mounts the EFI volume. I then eject only SD480 and but keep the EFI partition mounted. I then power up the macOS VM with raw disk and the boot proceeds. For some reason, rawdisk creator didn't like creating a raw disk based on the EFI partition only.

Maybe using an existing macOS VM almost made a difference as its virtual firmware would have been set up. I will use an empty/brand new macOS VM once I have more time to tinker around. I am really to looking to use this High Sierra VM raw disk as permanent setup to decommission the 2010 MacBook Pro altogether.

0 Kudos
ser2018
Contributor
Contributor

Thank you very much for this important progress! I tested this with a portable computer and it seems to work. The trick is what you mention: the EFI volume is mounted with an error, then unomunt manually the device and try again.

However, it does not solve my problem yet for the following reason. The external disk I am currently using has 2 partitions (both bootable) and I need to boot specifically with its second partition. Moreover, I cannot unmount the first partition from my host system (it should be available there). So, I think that I cannot use the "fullDevice" option. However, if I specify a certain partition instead of "fullDevice" then the method does not seem to work...

I also tried with the synthesized disk. Finally I was able to create the .vdmk file pointing to the syntethized volume. However, in this case, when booting, the system does not boot: instead, the EFI menu appears (apparently, it does not find any bootable system). The only difference with your situation seems to be that in the external disk I have 2 bootable partitions and one of them is already in use by the host system and so I should not unmount it to make it available to the raw disk access.

Any idea is welcome.

Thank you.

0 Kudos
ser2018
Contributor
Contributor

Just to complete the info, I tried to do the same on the fixed computer instead of the portable computer and unfortunately the method did not work this time. I guess that it is because I can only unmount one of the two partitions in the external disk (the other one is in use). With the portable computer, I was able to boot with the first partition and the reboot with the second one. This seems to be dead-end. Maybe the only possibility is to raw access the whole disk but not just some partition.

Nevertheless, if you have any suggestion, please let me know.

0 Kudos
bluefirestorm
Champion
Champion

I have an idea floating in my head but not sure if it will work. A lot of this stuff is "unsupported". The kind of "unsupported" that has the meaning "it might work but if you encounter problem(s) you are on your own". High Sierra VM is officially not supported as VM guest OS in Fusion 8.x. The Linux VM running like a bootcamp partition, albeit on external disk, is officially not supported by Apple and VMware. Even the Windows 10 on external USB disk is officially unsupported by Microsoft. Windows 10 setup will not to proceed to install on USB disk on a physical machine but the raw disk VMDK works around that.

I don't think the raw disk creator is officially in the VMware Fusion documentation with the exception of the KB article. But the Windows bootcamp partition created as a Fusion VM would have used the raw disk creator utility to create the bootcamp VMDK.

I will give the idea a try this weekend as a proof-of-concept.

0 Kudos
ser2018
Contributor
Contributor

I add some info, just in case it is useful. Based on my limited tests, I think that your previous idea ("The key here seems to be once it fails to power up; it mounts the EFI volume. I then eject only SD480 and but keep the EFI partition mounted. I then power up the macOS VM with raw disk and the boot proceeds.") works quite consistently if you can use the whole external disk (i.e., mount and unmount all the partitions). I did not continue exploring that option because in my target computer I cannot unmount one of the partitions (ejecting only one of the partitions does not seem to be enough, unless the problem is something else), which is in use by the host machine.

0 Kudos
bluefirestorm
Champion
Champion

Looks like the idea won't work at all as even the raw disk creation for macOS High Sierra using partition method (EFI and the APFS) results in error. I created a raw disk specifying the EFI and APFS partitions but once it opens the EFI partition successfully, it fails to open the raw disk with resource busy error.

| vmx| I125: DISKLIB-FLAT  : opening raw device /dev/rdisk2s1

| vmx| I125: DISKLIB-FLAT  : Unmounted "/dev/disk2s1" on open.

| vmx| I125: DISKLIB-DSCPTR: Opened [2]: "/dev/disk2s1" 0 partitionUUID @partition:diskModel=Transcend,diskSize=480103981056,diskVendor=StoreJet,partSize=209715200,partOffset=20480,partMediaUUID=B28A1826-2C55-4E61-A826-3E78531EE62D,partVolumeUUID=0E239BC6-F960-3107-89CF-1C97F78BB46B (0x1a)

| vmx| I125: DISKLIB-FLAT  : opening raw device /dev/rdisk2

| vmx| I125: DISKLIB-FLAT  : Unmounted "/dev/disk2" on open.

| vmx| I125: FileIOErrno2Result: Unexpected errno=16, Resource busy

| vmx| I125: AIOGNRC: Failed to open '/dev/rdisk2' : Resource busy (100002) (0x10103).

| vmx| I125: OBJLIB-FILEBE : FileBEOpen: can't open '/dev/rdisk2' : Resource busy (1048580).

| vmx| I125: DISKLIB-FLAT  : "/dev/rdisk2" : failed to open (1048585): ObjLib_Open failed.

If I use the similar method on the Windows 10 raw disk (partitioned raw disk with the EFI and Bootcamp partitions), the Windows 10 VM boots up fine. So it looks like it does not work at all for the macOS raw disk.

I found that with the fullDevice raw disk, all I have to do is unmount the APFS partition that was mounted (the SD480 in my case) and power up the macOS VM with raw disk and boot up is fine.

If creating the raw disk using the EFI and APFS partition had worked for macOS VM, the idea that I had was to create a copy of the EFI partition since it is pretty small (209.7MB only), perhaps as a DMG and mount it and create a raw disk partition out of that. But we would be going down a rabbit hole as it looks like partitioned raw disk also creates a 34KB VMDK file aside from the VMDK descriptor. The fullDevice option creates only a VMDK descriptor. I would not know if hacking the VMDK descriptor alone would be sufficient to link two different raw disk partitions together into the same VMDK (unlikely this would work).

Looks like it is easier to just get a separate external drive and just specify the fullDevice option.

0 Kudos