Page 1 of 2

Can OS X operating systems really run on x86 emulators?

Posted: Sat Sep 20, 2014 3:17 pm
by LieutenantHacker
Inspired by this question several days ago on Superuser, I am curious if this is really possible and wonder if anyone has tested this.

Basically, will an x86 OS X version, such as Snow Leopard or Mountain Lion, work on an x86 emulator running on Windows/Linux/OS X itself (such as Bochs)?

The answerer in the linked page above claims that Snow Leopard worked, but when I tried it myself (10.6.7; Snow Leopard ISO/DVD install) absolutely nothing happens (no output from Bochs). Do you need special support or very custom settings added to Bochs (feature/version specific, plugin, setup/config files, etc.) that can assist in the emulation? This is not for actual use; just curiosity if it really works and some proof as well. I know lots of Linux distros and pretty much all Windows versions will work on Bochs, but I've searched and can't even find a single video/image/text confirmation of OS X x86 working/booting on Bochs.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sat Sep 20, 2014 3:45 pm
by iansjack
I can't think of any good reason to run OS X in an emulator rather than a VM. It certainly runs on VMWare and VirtualBox. This is not to say that it is easy to make it run in such an environment; you can't just take an OS X install DVD and expect it to work on VMWare (unless you are running on a Mac). You need a few tricks and extra software.

Google will help you if you are interested. Note that it is not perfect and is not really (IMO) a viable way of running OS X (unlike, say Linux). If you want to run OS X on a normal PC it is better to do a native install (again, not entirely straightforward) and choose your hardware carefully. First rule - use an Intel processor.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sat Sep 20, 2014 4:10 pm
by Combuster
A non-mac running Mac OS is colloquially called a Hackintosh, and you'll find a lot under that keyword. Thing is that you need to hack Mac OS first as it normally checks if your hardware is an Apple machine or not, and what goes for a real computer often goes for a VM as well.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sat Sep 20, 2014 4:16 pm
by iansjack
Not quite true that you need to hack OS X - you just need some additional installation software (basically a bootloader), which is all perfectly legal as it's derived from the open source Darwin sources. You can then install from standard Apple install media.

The biggest difficulty nowadays with building a hackintosh is getting hold of a legal copy of OS X - you already need a Mac to purchase any recent version and you also need a Mac to prepare the install media. So, unless you're into piracy, there's not a lot of point in the exercise other than curiosity or the desire to build an additional "Mac" more powerful than the one you already own.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sat Sep 20, 2014 4:49 pm
by Owen
iansjack wrote:which is all perfectly legal as it's derived from the open source Darwin sources. You can then install from standard Apple install media.
The open source Darwin sources which have a specific usage restriction on them prohibiting their use in running OS X on a non-Apple computer

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sat Sep 20, 2014 4:54 pm
by LieutenantHacker
Thanks, but most of what has been said has been known. Basically, I will need a specific Hackintosh version in question to run it in Bochs? I know it works with virtualization, but I want to see it working with emulation, since I am curious and still have yet to see it in an emulator without virtualization/etc. I'll give it a shot though,I guess (Hackintosh on Bochs). If there's anything else I may not know regarding emulating OS X on Bochs or such, please fill me in.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 12:10 am
by iansjack
Owen wrote:
iansjack wrote:which is all perfectly legal as it's derived from the open source Darwin sources. You can then install from standard Apple install media.
The open source Darwin sources which have a specific usage restriction on them prohibiting their use in running OS X on a non-Apple computer
Really? Where? http://directory.fsf.org/wiki/License:APSLv2.0

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 3:28 am
by seuti
It works under VMware Workstation.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 9:38 am
by LieutenantHacker
I know it works on VMWare, but that's not an emulator; it uses CPU virtualization. Emulators of x86 mimick an entire CPU using the actual CPU, plus all relevant hardware. Virtual machines don't emulate CPUs; they use the same CPU with VT and virtualization support to execute guest machine's code.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 1:11 pm
by Owen
iansjack wrote:
Owen wrote:
iansjack wrote:which is all perfectly legal as it's derived from the open source Darwin sources. You can then install from standard Apple install media.
The open source Darwin sources which have a specific usage restriction on them prohibiting their use in running OS X on a non-Apple computer
Really? Where? http://directory.fsf.org/wiki/License:APSLv2.0
Maybe things have changed. Last time I checked, most of the Darwin sources had additional non-APSL terms attached.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 2:03 pm
by iansjack
I think you may be confusing the licence of the open source Darwin kernel and the EULA of OS X itself. That is a separate issue and there is a great deal of discussion as to its validity when applied to an individual with a legally purchased copy of the software. Naturally, Apple will not provide any sort of support for such an installation, which is their perogative.

Suffice it to say that this is a civil issue, not a criminal one, and that there is no recorded case of Apple taking issue with an individual for a breach of that contract (although they have taken action against companies seeking to profit by ignoring the EULA).

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 6:01 pm
by Brynet-Inc
The newer releases of Mac OS X are distributed without cost, but AFAIK only legally obtainable from Apple's App Store.. but it can be found elsewhere.

Emulating OS X is likely difficult, as the GUI depends on GPU acceleration.. and considering Apple controls all official hardware, it may not have any software fallback for unsupported graphics that would be implemented by Bochs or QEMU. It would also likely be very slow without hardware assisted virtualization.

There were some patches for QEMU with Linux KVM, but I don't think it worked with the TCG emulator backend.

The source for Apple's kernel and userland is all BSD/APSL/Apache and even GPLv2, any conditions for running binary versions in emulators or on "Hackintosh" systems is likely in the EULA.. and EULAs are not legal everywhere anyway.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 8:42 pm
by LieutenantHacker
Seems interesting ... Could anyone confirm its operation on Bochs? That guy in the question I linked said it works "fine", but I tried getting it running with Hackintosh Snow Leopard, EFI, and a ton of other workarounds and all I see is a black screen; no splash screen even. I thought some kind of GPU emulation was present on Bochs; at least enough for some OS X drivers and acceleration. I can't get it working at all ... nada.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 8:55 pm
by Brynet-Inc
Arguably this is not the best forum for these questions, as Combuster suggested, you may be better off asking on one of the many Hackintosh communities or even on the bochs mailing lists.

Re: Can OS X operating systems really run on x86 emulators?

Posted: Sun Sep 21, 2014 9:54 pm
by bluemoon
Brynet-Inc wrote:The source for Apple's kernel and userland is all BSD/APSL/Apache and even GPLv2, any conditions for running binary versions in emulators or on "Hackintosh" systems is likely in the EULA.. and EULAs are not legal everywhere anyway.
The kernel is open source and GPL, however the "aqua desktop" and software bundles (Mail, Safari, etc) is not.
Even Mavericks are free to download now, Apple still put additional restrictions when grant you the license.

In particular, it subjected to the Mac App Store License, which
... you are granted a limited, non-exclusive license to install, use and run one (1) copy of the Apple Software on a single Apple-branded computer at any one time.

and later...

(i) to download, install, use and run for personal, non-commercial use, one (1) copy of the Apple Software directly on each Apple-branded computer running OS X Mountain Lion, OS X Lion or OS X Snow Leopard (“Mac Computer”) that you own or control;

(ii) If you are a commercial enterprise or educational institution, to download, install, use and run one (1) copy of the Apple Software for use either: (a) by a single individual on each of the Mac Computer(s) that you own or control, or (b) by multiple individuals on a single shared Mac Computer that you own or control. For example, a single employee may use the Apple Software on both the employee’s desktop Mac Computer and laptop Mac Computer, or multiple students may serially use the Apple Software on a single Mac Computer located at a resource center or library; and

(iii) to install, use and run up to two (2) additional copies or instances of the Apple Software within virtual operating system environments on each Mac Computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using OS X Server; or (d) personal, non-commercial use.
I'm not a lawyer but it seems obvious you can only legally run Mac OS X with Apple's hardware, or with emulator/hypervisor on top of Apple's hardware (VMWare, Parallels, etc).