Virtual machines and OS X

Michael Crawford mdcrawford at gmail.com
Mon Nov 17 13:59:37 PST 2014


If as you speculate, xnu is panicking just because it sees an
unexpected CPU class, I wonder if one could write a guest extension
that would prevent that from happening.

While Mac OS X kernel extensions are mostly used for device drivers,
they can be used to "hot patch" any part of the kernel you want to.

So you could simply replace the function that identifies the CPU type,
or write NOPs over the call to panic(), or patch panic's entry point
so that it doesn't do anything if it's called for this particular.

I don't recall what the actual panic message was, I'll give it a try
again sometime soon.

I'll also try both Parallels and VMWare.  I used to use Parallels
quite a bit - I really liked it.  I've never used VMWare.
Michael David Crawford
mdcrawford at gmail.com
http://www.warplife.com/mdc/

   Available for Software Development in the Portland, Oregon Metropolitan
Area.


On Mon, Nov 17, 2014 at 1:52 PM, René J.V. <rjvbertin at gmail.com> wrote:
> On Monday November 17 2014 13:33:58 Michael Crawford wrote:
>
>> I don't think shared folders are implemented as network shares, some
>> other method is used.
>
> Not explicitly, but in some implicit sense. I know that shared folders are treated that way in Windows guests running in VirtualBox.
>
>> I was about to say that the folder is made to look like a regular disk
>> drive but I'm not so sure, that would require the guest to manage the
>> filesystem structure - allocating sectors &c. - and that's not done
>> with any of the VMs I've used.
>
> Sharing requires "guest extensions", most of the time, which can include drivers for all kinds of exotic drive types ;)
>
>> VirtualBox' doc specifically warns that a guest might not run on a
>> later CPU model than Apple tested it with during development.  I still
>> find that surprising, as all the CPU vendors work really, really hard
>> to enable upward compatibility - like the Xeon in my desktop box can
> ...
>> However if it's a kernel panic, xnu - the OS X kernel - might have
>> used a supervisor-mode machine instruction that works differently than
>> it does on earlier model of CPU.  Because Apple makes both the
>
> Or, Apple ties CPU model to system board and other stuff requiring drivers, detect a too-new CPU at some early point in the boot process, and provokes a panic. A KP isn't necessarily the result of an illegal operation, often it's like an abort(), to "get out" of a situation you know you cannot handle.
>
> VirtualBox is also less advanced in the CPU features it "exports" to the guest. My i7 CPU has AVX, but VirtualBox won't expose it to the VM (Parallels does, IIRC). If the OS somehow has a hardcoded set of presumptions of what a given CPU can do, that could indeed provoke crashes or KPs.
>
> I suppose you'd be less likely to run into this kind of issue if the VM software gives the possibility to create a 32bit VM, which means the CPU will be running in legacy mode.
>
>>
>> Parallels offers a free demo, I'll give that a try sometime soon.  Does VMWare?
>
> I think so. Note that Parallel's demo isn't completely free in the sense that you have to sign up for spam in order activate the demo. So be sure to use a throw-away address for that.
>
> R.
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-users


More information about the macports-users mailing list