High Sierra - USB 3 (xHCI) fails

Discussions about using Mac OS X guests (on Apple hardware) in VirtualBox.
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

High Sierra - USB 3 (xHCI) fails

Post by granada29 »

High Sierra (macOS 10.13) seems to have problems with the VirtualBox USB 3 driver.
Lots of bus resets during initialisation and when finally booted, the mouse and keyboard are not working.

Choosing the USB 2.0 driver makes the problem go away, but I suspect this is less than optimal.

The log and vbox files are attached. This is a rawdisk VM, but the result is reproducible with .vdi VM
I killed the VM before the boot completed, but there should be enough info in the log.
This raw disk works just fine when booted natively so I doubt Apple will be very interested in making changes.

Bryan
Attachments
VBox.log.zip
vbox log
(27.93 KiB) Downloaded 254 times
Sierra-External.vbox.zip
vbox config
(1.98 KiB) Downloaded 270 times
IOOI
Posts: 74
Joined: 14. Nov 2014, 18:54
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OPENSTEP, Mac OS X, FreeBSD, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by IOOI »

Hi,

can you explain how you got 10.13 to install inside VBox? I tried but did not succeed.

regards,

IOOI
Last edited by socratis on 12. Jul 2017, 17:43, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by granada29 »

In this particular case, I had 10.12 installed on an external drive. I upgraded that installation to 10.13 (in native mode) and then used VBoxRawdisk to load it into VirtualBox as a raw disk.

For the .vdi based installation its a little trickier. Again start with a 10.12 VM and begin the upgrade. When the VM reboots you have to interrupt it and mess about in the EFI shell. I followed the process described at https://raimue.blog/2017/06/09/upgradin ... irtualbox/

Clearly there is some change in the way 10.13 is handling the EFI partition so I am not sure if this is an Apple issue (unlikely because it all works in native mode), or if the VirtualBox EFI loader needs a tweak.

Hope that helps
IOOI
Posts: 74
Joined: 14. Nov 2014, 18:54
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OPENSTEP, Mac OS X, FreeBSD, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by IOOI »

granada29 wrote: For the .vdi based installation its a little trickier. Again start with a 10.12 VM and begin the upgrade. When the VM reboots you have to interrupt it and mess about in the EFI shell. I followed the process described at https://raimue.blog/2017/06/09/upgradin ... irtualbox/
I tried this but I got this error:

Code: Select all

Read error 0xe
Error loading kernel cache (0xe)
whereas the recovery launch was successful (using fs2:)
Clearly there is some change in the way 10.13 is handling the EFI partition so I am not sure if this is an Apple issue (unlikely because it all works in native mode), or if the VirtualBox EFI loader needs a tweak.

Hope that helps
maybe @socratis can tell …

cheers,

IOOI
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by granada29 »

I've noticed that sometimes VirtualBox won't reboot properly with macOS. Have you tried the EFI interrupt after a fresh start of the VM. i.e. when the VM starts the auto reboot, just power it off, then manually start it again, hitting your interrupt key while its starting.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: High Sierra - USB 3 (xHCI) fails

Post by socratis »

One, I've never noticed reboots not working, not once. Second, what do you mean "interrupt key"?

BTW, has anyone tried to installing 10.13 as their host? I might try it tonight if I'm in the mood... ;)
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.
IOOI
Posts: 74
Joined: 14. Nov 2014, 18:54
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OPENSTEP, Mac OS X, FreeBSD, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by IOOI »

socratis wrote:One, I've never noticed reboots not working, not once. Second, what do you mean "interrupt key"?
I guess he means the key to press to enter the EFI, in my case this is fn-F8
BTW, has anyone tried to installing 10.13 as their host? I might try it tonight if I'm in the mood... ;)
I'd try this if I had a host to install on, I could go an try to free up an external HD to install on however …
IOOI
Posts: 74
Joined: 14. Nov 2014, 18:54
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: OPENSTEP, Mac OS X, FreeBSD, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by IOOI »

granada29 wrote:I've noticed that sometimes VirtualBox won't reboot properly with macOS. Have you tried the EFI interrupt after a fresh start of the VM. i.e. when the VM starts the auto reboot, just power it off, then manually start it again, hitting your interrupt key while its starting.
Now I tried this power down trick — still getting the read error. Only difference: now the EFI console returns after a while (after a reboot I could enter the boot sequence only once and then be hung forever).

regards,

IOOI
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by granada29 »

By "interrupt key", I mean the "key" you press to "interrupt" the boot process and cause it to break into the EFI loader. It seems that it varies depending on your keyboard and settings, hence I didn't say F12.

I quite often see a macOS VM reboot fail. A fresh start of the VM will clear the fault. Just cause you've never seen it, doesn't mean that it doesn't happen. I assume its something to do with USB bus timings, especially when dealing with raw devices on USB connections.
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by granada29 »

BTW, has anyone tried to installing 10.13 as their host? I might try it tonight if I'm in the mood... ;)
I think its too early in the 10.13 beta cycle to try something like VirtualBox. There are unresolved issues with loading 3rd party kexts and the kernel timekeeping system call adjtime() is broken.

However if you do try it, I'd certainly be interested in the results.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: High Sierra - USB 3 (xHCI) fails

Post by socratis »

granada29 wrote:However if you do try it, I'd certainly be interested in the results.
Sure I did. Didn't like it. I had to put the post in "OSX Hosts » OSX pre-releases". See: viewtopic.php?f=39&t=83811
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.
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by granada29 »

The xHCI problem persists in Version 5.1.24 r117012 (Qt5.6.2)
So its back to USB 2.0 again
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: High Sierra - USB 3 (xHCI) fails

Post by socratis »

Hey granada29, can you try one thing? Shut down the VM, and issue the command:
VBoxManage setextradata "<vm>" VBoxInternal2/EfiBootArgs "keepsyms=1 serial=0x1"
Boot the VM. You will know that the command was successful if you do NOT see the typical text-only output during the boot phase, but a more familiar Apple logo.
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.
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: High Sierra - USB 3 (xHCI) fails

Post by granada29 »

Well that does as you said (i.e. Apple logo and no verbose boot).
There is still no mouse or keyboard with USB 3.0 but fine with USB 2.0

I prefer the verbose boot (something to look at while I'm waiting and also able to quickly spot any errors) so I'll backout that setextradata change.

Thanks for the suggestion.

Bryan
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: High Sierra - USB 3 (xHCI) fails

Post by michaln »

I think I can see the problem with xHCI. It's actually macOS being either too clever or too dumb (take your pick).

It looks like Apple yet again rewrote the USB drivers, and introduced interesting misbehavior. The xHCI architecture has several 64-bit registers that have to be written as two 32-bit PCI transactions. The xHCI controller itself can support 64-bit addressing or not. If it doesn't, then writing the low-dword register clears the high register and takes some action. If the xHCI controller does support 64-bit addressing, then it is writing the high-dword register that triggers something. The controller emulated by VirtualBox does not report 64-bit addressing support, but Apple "knows" that it really does. So, things fall apart because the driver expects one thing and the emulated hardware another.

The quick workaround is to reduce the VM's memory size. With 3GB, I have High Sierra beta 6 VM booting with xHCI (in fact booting off of a USB3 stick).
Post Reply