VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Discussions related to using VirtualBox on Mac OS X hosts.

VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby JoB4031 » 1. Apr 2017, 03:29

Okay, I am trying to use Virtualbox to run my Win10 Bootcamp partition. The Bootcamp partition works as expected, but I am having difficulty getting a Virtualbox vmdk file to load my bootcamp partition.

Steps so far:
1) diskutil list
Code: Select all   Expand viewCollapse view
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         1.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:          Apple_CoreStorage Macintosh HD            934.4 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4:       Microsoft Basic Data BOOTCAMP                65.2 GB    disk0s4

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           +934.0 GB   disk1
                                 Logical Volume on disk0s2
                                 CFB70156-7DA6-4013-BBF9------------------
                                 Unlocked Encrypted

2) diskutil unmount /Volumes/BOOTCAMP
3) sudo chmod 777 /dev/disk0s1
4) sudo chmod 777 /dev/disk0s4

5) sudo VBoxManage internalcommands createrawvmdk -rawdisk /dev/disk0 -filename win10raw.vmdk -partitions 1,4
VBoxManage: error: Cannot read the partition information from '/dev/disk0'
VBoxManage: error: The raw disk vmdk file was not created

I tried to disable csrutil and this had no effect, I tried this both on the latest ver 5.1 and 5.0 of virtualbox.

I have been unable to find a fix via google or searching this forum but I think it has something to do with the way VBoxManage interacts with /dev/disk0. The command
sudo VBoxManage internalcommands listpartitions -rawdisk /dev/disk0
Number Type StartCHS EndCHS Size (MiB) Start (Sect)

returns nothing, even though the diskutil command returns my disk information no problem. Is this a bug in VBoxManage internalcommands? Or is it because of the way my 2016 MacBook Pro SSD is setup? I do have FileVault enabled. I appreciate any and all inputs.

-Jonathan
JoB4031
 
Posts: 3
Joined: 26. Jun 2015, 17:05

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby granada29 » 3. Apr 2017, 00:13

JoB4031 wrote:2) diskutil unmount /Volumes/BOOTCAMP
3) sudo chmod 777 /dev/disk0s1
4) sudo chmod 777 /dev/disk0s4


You have to give read access to the whole disk so that partition info can be read by VirtualBox

Try using sudo chmod 777 /dev/disk0 in addition to the individual partitions.

I usually do this using chown rather than chmod
e.g.
sudo chown myusername /dev/disk0*
or refine it for individual partitions instead of using the sledge-hammer approach :)
granada29
Volunteer
 
Posts: 289
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby quantor » 8. Apr 2017, 10:40

Try using sudo chmod 777 /dev/disk0 in addition to the individual partitions.

I usually do this using chown rather than chmod
e.g.
sudo chown myusername /dev/disk0*


I have the same problem. With VirtualBox 5.1.18 on Sierra 10.12.4 on a MBP 2016, i get no information on the partitions, even if I chmod all to 777 and change the ownership to my username for all /dev/disk0*.
sudo VBoxManage internalcommands listpartitions -rawdisk /dev/disk0 gives me:
Code: Select all   Expand viewCollapse view
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)


On a MBP 2011, (VBox 5.1.12, Sierra 10.12.2), this works absolutely fine:
Code: Select all   Expand viewCollapse view
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x00  0   /0  /0   0   /0  /0            200           40
2       0x00  0   /0  /0   0   /0  /0         420570       409640
3       0x00  0   /0  /0   0   /0  /0            619    861737768
4       0x00  0   /0  /0   0   /0  /0          55549    863008768


Both MBP are FileVault encrypted, so I guess this can't be the problem. I disabled csrutil on MBP 2016. The newer MBP has an SSD, the older a HDD.
quantor
 
Posts: 12
Joined: 8. Apr 2017, 10:20

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby granada29 » 9. Apr 2017, 00:22

On the MBP 2016 did you first run 'diskutil list' to verify you have the correct disk.

I just tried
sudo VBoxManage internalcommands listpartitions -rawdisk /dev/disk0
on my MacMini 2012, Sierra 10.12.4, VBox 5.1.18 and it lists the partitions as expected.

csrutil has not been modified.
I had no virtual machines running when I ran VBoxManage. Not sure if that makes a difference or not.
granada29
Volunteer
 
Posts: 289
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby quantor » 9. Apr 2017, 11:08

I ran
diskutil list, which gave me the same as in JoB4031's post:
Code: Select all   Expand viewCollapse view
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         1.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:          Apple_CoreStorage Macintosh HD            919.3 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4:       Microsoft Basic Data BOOTCAMP                80.3 GB    disk0s4

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           +919.0 GB   disk1
                                 Logical Volume on disk0s2
                                 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
                                 Unlocked Encrypted


Running
sudo VBoxManage internalcommands listpartitions -rawdisk /dev/disk0
does not list anything.

If I try to list the partitions of an external device (memory stick) VBoxManage works.
Code: Select all   Expand viewCollapse view
sudo VBoxManage internalcommands listpartitions -rawdisk /dev/disk2
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x07  1023/254/63  1023/254/63          3818            2


I have also no VM running. Would be interesting to know if anybody else encounters the same problem on the MBP 2016.
Does the MBP handle the drives differently or is it a bug in VirtualBox?
How does VBoxManage get the partition information? Is there any way to debug VBoxManage?
quantor
 
Posts: 12
Joined: 8. Apr 2017, 10:20

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby Perryg » 9. Apr 2017, 14:15

sudo VBoxManage internalcommands listpartitions -rawdisk /dev/disk0


Why are you using sudo for a user level application? What happens if you leave the sudo off when trying to list the partitions?
Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby quantor » 9. Apr 2017, 14:59

There is no difference whether I use sudo or not...
Code: Select all   Expand viewCollapse view
MacBook-Pro:~ username$ sudo VBoxManage internalcommands listpartitions -rawdisk /dev/disk0
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
MacBook-Pro:~ username$ VBoxManage internalcommands listpartitions -rawdisk /dev/disk0
Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
MacBook-Pro:~ username$
quantor
 
Posts: 12
Joined: 8. Apr 2017, 10:20

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby granada29 » 10. Apr 2017, 02:29

Interesting.

Maybe VirtualBox 5.1.18 no longer understands the hybrid GPT format created by the bootcamp installation. I doubt that it is a hardware specific issue - but then again I guess nothing can be ruled out.

Have you tried running an earlier release of VirtualBox on the MBP 2016?
granada29
Volunteer
 
Posts: 289
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby quantor » 10. Apr 2017, 21:29

I tried it also with VirtualBox 5.1.12 and 5.1.16, which ran successfully on my old MBP 2011. But on the new MacBook the same problem here, the partitions do not get listed, no matter whether I use sudo or not or chmod /dev/disk0* to 777.
It seems that people do not have problems accessing Win10 Bootcamp partitions with VirtualBox on 2014 MBPs (http://apple.stackexchange.com/questions/220670/run-boot-camp-windows10-partition-inside-virtualbox), so far it is a MBP 2016 / Win10 issue only...
How does VirtualBox read the partition information? If also older VBox versions cannot read it, I think it is probable that partition table format changed.
quantor
 
Posts: 12
Joined: 8. Apr 2017, 10:20

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby JoB4031 » 11. Apr 2017, 15:12

Good discussion, but it looks like the Virtualbox will not work with Bootcamp on the current MacBook Pro 2016 and Sierra. I tried to chown sugestion without success, along with trying older versions of Virtualbox (5.0 and 4.3). I have since re-installed Parallels to achieve the ability to run the Bootcamp partition on Sierra. It works without issues. Thanks for the help and suggestions, maybe one day this will work again.
JoB4031
 
Posts: 3
Joined: 26. Jun 2015, 17:05

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby quantor » 11. Apr 2017, 21:40

Thanks for the help and suggestions, maybe one day this will work again.

So VirtualBox and MacBook Pro 2016 and Sierra do not work together. Is this enough to add it to the bugtracker? I hope as well that this will work again soon.
quantor
 
Posts: 12
Joined: 8. Apr 2017, 10:20

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby socratis » 12. Apr 2017, 11:42

quantor wrote:So VirtualBox and MacBook Pro 2016 and Sierra do not work together. Is this enough to add it to the bugtracker?
That is an incomplete, and most certainly, not proven statement. You seem to be confusing the vessel with the software problem you're seeing. Let me try and summarize the thread so far. We have three participants: 'JoB4031', 'granada29' and 'quantor':

    JoB4031   : Host=?,       Upgrade=?, Guest=Win10, VBox=?,      Filevault=Yes, Works = NO
    granada29 : Host=10.12.4, Upgrade=?, Guest=?, VBox=5.1.18, Filevault=? , Works = NO
    quantor : Host=10.12.4, Upgrade=?, Guest=?, VBox=5.1.18, Filevault=Yes, Works = NO
    Host=10.12.2, Upgrade=?, Guest=?, VBox 5.1.12, Filevault=Yes, Works = Yes
With so many question marks on the symptoms matrix, I cannot come to any clear conclusion. So, please try to focus on the important issues, like filling in the gaps and not on the superfluous ones, like the year of the MBP. That's a complete red herring in my opinion. If you take out that hard disk and plug it on another, older computer, you're still going to have the same problem.
  • The question is not the year, the question is whether this was a clean install or an upgrade.
  • The question is if the BootCamp partition was created after or before the FileVault.
  • The question is if it's the VirtualBox version or if it's the OSX version.
The easiest way to try the last question is if you all downgrade to 5.1.12, which seems to work in a particular case (quantor). The other thing that 'quantor' can try is to upgrade to 5.1.18 in the working scenario. Doubles as checking for the OSX version. So, before jumping the gun, please take a moment and come up with working and failing scenarios.

JoB4031 wrote:Thanks for the help and suggestions, maybe one day this will work again.
quantor wrote:I hope as well that this will work again soon.
If you want help from the developers, you have to help the developers.
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.
socratis
Site Moderator
 
Posts: 27690
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby quantor » 15. Apr 2017, 16:55

You seem to be confusing the vessel with the software problem you're seeing.

At least macOS makes a difference which system it is installed on. Bootcamp on OS 10.12.4 does behave differently. On a new MacBook, BootCamp 6.1.0 can only install Windows 10. On an old MacBook, Bootcamp can only install Windows 7 or 8 (I will check on that Bootcamp version, I have the old system currently not available).

Here is my contribution to the symptoms matrix so far (Works = YES means that sudo VBoxManage internalcommands listpartitions gives some output):

quantor: Host=10.12.4, Upgrade=YES(*), Guest=Win10,   VBox=5.1.18, Filevault=Yes, FileVaultBeforeBootcamp=YES, Works = NO
Host=10.12.4, Upgrade=YES(*), Guest=Win10, VBox=5.1.12, Filevault=Yes, FileVaultBeforeBootcamp=YES, Works = NO
Host=10.12.2, Upgrade=YES(%), Guest=Win8($), VBox=5.1.12, Filevault=Yes, FileVaultBeforeBootcamp=NO, Works = YES

(*) Upgrade from 10.12.3
(%) Upgrade from 10.7.x
($) Upgraded to Win10, but Win10 does not run stable

I will also run some tests with FileVault installation before Bootcamp installation and macOS 10.12.4 and VB 5.1.12...
quantor
 
Posts: 12
Joined: 8. Apr 2017, 10:20

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby socratis » 15. Apr 2017, 18:33

@quantor
I'm not sure, but you may have found a really good candidate for the error; the FileVaultBeforeBootcamp option. I have a 10.12 VM frozen in 10.12.3. I have a snapshot of it, so I can easily try things out and then revert to its original state. So, I'll try to:
  1. Create a BootCamp partition, enable FileVault.
  2. Enable FileVault, create a BootCamp partition.
  3. Update to 10.12.4 for both cases.
  4. Test with VirtualBox 5.1.12 and 5.1.14 for all combinations.
It's going to take some time and with the Easter holiday (big thing over here) it's not going to be until the middle of the week before I have the results in.
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.
socratis
Site Moderator
 
Posts: 27690
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: VBoxManage internalcommands createrawvmdk error: Cannot read the partition info...

Postby socratis » 16. Apr 2017, 01:41

Well, that took way less than I expected, mainly for one reason; I couldn't enable FileVault in any of my OSX clients, from 10.7.x all the way to 10.12.x. Nothing, nada, zilch... Except hard crashes after I did.

So, I won't be able to recreate your environment unfortunately. But you could try to enable/disable FileVault at will if I'm not mistaken, so that should be easy enough to try out, no?
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.
socratis
Site Moderator
 
Posts: 27690
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Next

Return to VirtualBox on Mac OS X Hosts

Who is online

Users browsing this forum: No registered users and 13 guests