Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Discussions related to using VirtualBox on Mac OS X hosts.
HighVoltage
Posts: 5
Joined: 29. Sep 2017, 07:26

Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Post by HighVoltage »

I have been using virtualbox 5.1.26 on a MacBook pro running MacOS Sierra successfully for quite a while. I just upgraded to the new MacOS High Sierra version and my Windows 10 guest will no longer boot. The error received is as follows:

Failed to open a session for the virtual machine Windows 10.

Could not open the medium '/Users/tim/VirtualBox VMs/Win7onMBP/win7rawdisk.vmdk'.

VD: error VERR_FILE_NOT_FOUND opening image file '/Users/tim/VirtualBox VMs/Win7onMBP/win7rawdisk.vmdk' (VERR_FILE_NOT_FOUND).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}

When I search for the win7rawdisk.vmdk file using finder, it exists at the proper location. Comparing it with a backup from before the upgrade happened showed that it was identical to the backup (nothing changed).

I have attached the log file also.

Is it something to do with the automatic filesystem conversion to apfs? Any other ideas?

Thanks
VBox.log
(1.33 KiB) Downloaded 117 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by socratis »

What are the permissions along the full path of the file? What do you get if you enter the commands:
  • ls -l '/Users/tim/VirtualBox VMs/Win7onMBP/win7rawdisk.vmdk'
    ls -l '/Users/tim/VirtualBox VMs/Win7onMBP/'
    ls -l '/Users/tim/VirtualBox VMs/'
    ls -l '/Users/tim/'
    ls -l '/Users/'
Are you the owner of your files? Do you have read-write access?
You can use the Finder » Get Info to become the owner and change your files to read-write.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Kirstone
Posts: 6
Joined: 4. Oct 2017, 10:59

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by Kirstone »

Same thing for me and my colleague. After upgrading mini mac os to High Sierra this started to happen. We cannot start Windows Bootcamp partition on VirtualBox. 4 hours of researches. We assume that this happens due mac os security, that virtual box can not access needed information.

We tried to recreate vmdk image and it failed due ACCESS restriction
sudo VBoxManage internalcommands createrawvmdk -rawdisk /dev/disk0 -filename win10raw.vmdk -partitions 3

So we rebooted mac to recovery and on terminal and we disabled some security "csrutil disable". After that vmdk image creation succeeded. But thats all, newly created vmdk shows same error.
HighVoltage
Posts: 5
Joined: 29. Sep 2017, 07:26

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by HighVoltage »

Permissions appear to be fine, there is read/write permissions all the way up the path. Where I was not the explicit owner, I changed it to myself and that did not make any difference

Code: Select all

TimsMacBookPro:etc tim$ ls -l '/Users/tim/VirtualBox VMs/Win7onMBP/win7rawdisk.vmdk'
-rwxrwxrwx@ 1 root  staff  790 Oct  3 10:03 /Users/tim/VirtualBox VMs/Win7onMBP/win7rawdisk.vmdk

TimsMacBookPro:etc tim$ ls -l '/Users/tim/VirtualBox VMs/Win7onMBP/'
total 88
-rwxrwxrwx  1 root  staff  37376 Sep  7  2016 win7rawdisk-pt.vmdk
-rwxrwxrwx@ 1 root  staff    790 Oct  3 10:03 win7rawdisk.vmdk

TimsMacBookPro:etc tim$ ls -l '/Users/tim/VirtualBox VMs/'
total 0
drwxr-xr-x  5 tim  staff  160 Jan 13  2015 Win7onMBP
drwxr-xr-x  9 tim  staff  288 Oct  3 10:36 Windows 10

TimsMacBookPro:etc tim$ ls -l '/Users/tim/'
total 7696
drwx------    9 tim   staff      288 Aug 24 13:39 Applications
-rw-r--r--@   1 tim   staff  1909284 Oct 16  2015 BOOTCAMP
drwx------    2 tim   staff       64 Nov 17  2015 Box Sync
drwx------+  58 tim   staff     1856 Sep 23 04:21 Desktop
drwxr-xr-x    5 tim   staff      160 Oct  3 10:52 VirtualBox VMs

TimsMacBookPro:etc tim$ ls -l '/Users/'
total 0
drwxr-xr-x+ 11 Guest  _guest   352 Oct 12  2015 Guest
drwxrwxrwt  10 root   wheel    320 Sep 27 06:36 Shared
drwxr-xr-x+ 70 tim    staff   2240 Jul 27 10:32 tim
Last edited by socratis on 4. Oct 2017, 13:07, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
HighVoltage
Posts: 5
Joined: 29. Sep 2017, 07:26

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by HighVoltage »

Ok, now we may be getting somewhere...

I opened the win7rawdisk.vmdk file with a text editor and noticed that it pointed to partition /dev/disk0s4.

I also looked at the partition information using disutil list and got this:

Code: Select all

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         180.5 GB   disk0s2
   3:       Microsoft Basic Data BOOTCAMP                70.3 GB    disk0s3

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +180.5 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            136.2 GB   disk1s1
   2:                APFS Volume Preboot                 19.3 MB    disk1s2
   3:                APFS Volume Recovery                520.0 MB   disk1s3
   4:                APFS Volume VM                      3.2 GB     disk1s4
Apparently the conversion to APFS changed the partition map? Because the Bootcamp partition is now disk0s3.

I changed the win7rawdisk.vmdk to point to disk0s3 and the error I get when attempting to boot the guest changes from VERR_FILE_NOT_FOUND to VERR_ACCESS_DENIED.
Last edited by socratis on 4. Oct 2017, 13:39, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
Kirstone
Posts: 6
Joined: 4. Oct 2017, 10:59

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by Kirstone »

Ok, definitely problem is with access and we managed to solve problem.

1. First, excute sudo chmod 777 for all directories, as socratis said:
sudo chmod 777 '/Users/tim/VirtualBox VMs/Win7onMBP/win7rawdisk-pt.vmdk'
sudo chmod 777 '/Users/tim/VirtualBox VMs/Win7onMBP/win7rawdisk.vmdk'
sudo chmod 777 '/Users/tim/VirtualBox VMs/Win7onMBP/'
sudo chmod 777 '/Users/tim/VirtualBox VMs/'
sudo chmod 777 '/Users/tim/'
sudo chmod 777 '/Users/'

2. Completely remove VirtualBox from Mac. We used App Cleaner & Uninstaller to remove remainings of the app.
3. Install fresh VirtualBox.
4. Setup your new vmdk (if disk0s<nr> changed after OS upgrade) and new virtual box image of Bootcamp.

The main problem is that VirtualBox somehow cached "vmdk image is inaccessible" and if you make it accessible, nothing happens.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by socratis »

Kirstone wrote:1. First, excute sudo chmod 777 for all directories, as socratis said:
1) I never said that
2) You do not want to change 777 for everything. THIS IS NOT RIGHT!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Kirstone
Posts: 6
Joined: 4. Oct 2017, 10:59

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by Kirstone »

Ok, sorry, just make sure r+w :)
HighVoltage
Posts: 5
Joined: 29. Sep 2017, 07:26

Re: Guest fails to boot after upgrade to MacOS High Sierra

Post by HighVoltage »

Seems to me that this points to a problem accessing the Bootcamp partition, and not anything to do with the vmdk file itself or permissions thereof. Point to incorrect partition --> FILE_NOT_FOUND. Point to correct partition --> ACCESS_DENIED.

It's not the System Integrity Protection since disabling it (as noted above) makes no change.

Does VirtualBox maintain information about the selected guest OS in other locations than the vmdk file? Because it appears that a complete wipe and reinstall allows it to work, per other users. While I am willing to do this if necessary, is there any other, less severe, solution? It would be nice to know exactly what caused the problem instead of just obliterating it and starting over. I can learn more that way.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Post by socratis »

See? This is what happens when you pick the wrong title? It throws people off. I changed the title from:
• "Guest fails to boot after upgrade to MacOS High Sierra", to
• "Bootcamp guest fails to boot after upgrade to MacOS High Sierra".

or I could have tried "Bootcamp raw access guest fails to boot after upgrade to MacOS High Sierra" but it would have been too long.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
HighVoltage
Posts: 5
Joined: 29. Sep 2017, 07:26

Re: Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Post by HighVoltage »

After some digging, I figured it out.

There were two problems, both of them related to the partition change brought about by High Sierra. The first, described above, was that the vmdk file was now pointing at the wrong partition. The second problem was permissions for the bootcamp partition. Before this all happened, I had a script that runs when the machine boots that changes the permissions on /dev/disk0s4, and also unmounts the bootcamp partition. Since the High Sierra upgrade changed the bootcamp partition to /dev/disk0s3, the script was no longer setting permissions on the bootcamp partition properly. Change the script to set permissions on the proper partition and things start to work.

Thanks for your help...
Kirstone
Posts: 6
Joined: 4. Oct 2017, 10:59

Re: Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Post by Kirstone »

Hi, HighVoltage

Can you share that boot script and give some instruction where to place it for running on boot?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Post by socratis »

A thing that I wanted to address is that it's never a good idea to do a mass chmod in all the directories, only the ones that are affected. A good old habit that I have been using over the years is that from time to time I do an "ls -alR" on everything, from my home folder to the Applications, to key system folders. And I keep those files stored. Later on if I have a problem, I go and check again and compare to see if (usually) an application has messed up my permissions.

Up to and including 10.11, there was a command that you could run and it would reset your System and Application permissions in your OSX installation, based on the packages that you had in your system:
  • sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume / --debug
but with 10.12 it's there no more. I guess because OSX is using the System Integrity Protection (SIP) which basically monitors and protects these key directories at all times (if not disabled).
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
MattLC
Posts: 3
Joined: 17. Feb 2018, 00:41

Re: Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Post by MattLC »

Still struggling to fix this. I uninstalled and reinstalled VB but despite chmod on the disk partition of Bootcamp I get access errors when creating the VB disk
VBoxManage internalcommands createrawvmdk -filename ~/RawWinDisk.vmdk -rawdisk /dev/disk0 -partitions 3
VBoxManage: error: Cannot open the raw disk '/dev/disk0': VERR_ACCESS_DENIED
I tried to run the command on the partition, and it works
VBoxManage internalcommands createrawvmdk -filename ~/RawWinDisk.vmdk -rawdisk /dev/disk0s3
But then the VM doesn't boot and I get this
VD: error VERR_NOT_SUPPORTED opening image file '/Users/MLC/VirtualBox VMs/Bootcamp/RawWinDisk.vmdk' (VERR_NOT_SUPPORTED).
VD: error VERR_ACCESS_DENIED opening image file '/Users/MLC/VirtualBox VMs/Bootcamp/RawWinDisk.vmdk' (VERR_ACCESS_DENIED).
Failed to open image '/Users/MLC/VirtualBox VMs/Bootcamp/RawWinDisk.vmdk' in read-write mode (VERR_ACCESS_DENIED).
AHCI: Failed to attach drive to Port0 (VERR_ACCESS_DENIED).
What to try next?
Last edited by socratis on 18. Feb 2018, 13:38, edited 1 time in total.
Reason: Enclosed the information in [pre] tag for better readability
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Bootcamp guest fails to boot after upgrade to MacOS High Sierra

Post by socratis »

MattLC wrote:Still struggling to fix this.
Still? What do you mean "still" ? It's your first post... ;)

Unless I see a "diskutil list" output, I don't even know if your VMDK is pointing in the correct partition, so, please post the output of that command.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply