Mac OS X guest

Discussions about using Mac OS X guests (on Apple hardware) in VirtualBox.
Locked
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Mac OS X guest

Post by Technologov »

Let me tell my self the truth: I want Mac OS X guest support on VirtualBox.

Foreword: This was originally written in 2007 for VirtualBox 1.5.x
update: VirtualBox 3.2 supports Mac OS X guests out-of-the-box, without the hacks described here.


The problem needs to be devided into 2 aspects: political & technical.

Political/Legal problem:
Apple only allows their OS to run on Mac hardware. The only workaround I see here is to run VirtualBox on Mac hardware to virtualize Mac OS X. Or some big company (Innotek?/VMware?) needs convince Apple to license their OS in different way...
Since I'm not a politician, and not a lawyer, I'll let others to figure this out.

According to Alexander Graf: (http://alex.csgraf.de/self/?part/projec ... 20OSX/qemu)
While the EULA clearly states, that running Mac OS X only once and only on Apple hardware is allowed, this does not exclude running it legally in a virtual machine on Apple hardware. This is basically the same approach that Mac-on-Linux took, but this time with the Intel based version of Mac OS X.
Of course, as all the hardware Mac OS X runs on with this solution is virtual, the very same approach enables potential users to run it on non-Apple hardware as well, which is illegal though.

Technical problem: (for users)
It gets interesting... but there are some hacker's versions of Mac OS X flying around the 'net. This version doesn't require EFI and other Apple hardware, but works with normal PC hardware instead. One of the images is Deadmoo's OS X for VMware. (Tiger v10.4)
This vmdk works on VirtualBox with only one modification to the boot command: platform=x86pc
(this disables ACPI, because Mac OS X dislikes VirtualBox's ACPI implementation due to incompleteness).

To make change permanent just configure Mac OS X bootloader:
/Library/Preferences/SystemConfiguration/com.apple.Boot.plist

On VMware WS 6 it works (slowly) without any workarounds, but on VBox it is much faster.
Requirements: Intel SSE3 and VT capable CPU. (VT must be enabled in VBox). Theoretically this should work on AMD too, but not tested.

Verdict: it WORKS ! (with a workaround and not stable, but it WORKS !)
Tested on VBox 1.5.x on Intel Core 2 Quad Q6600 on Windows XP 32 host.

NOTE: It is not easy to make it work, so normal mortals should not even try.

WARNING: Currently only Deadmoo runs. iAtkos, Leo4All, Kalyway, and all other images will NOT run.

The idea:
First I would like to see VirtualBox improve to the way, where it will run Mac OS X without problems, then hope until someone convinces Apple. Perhaps, from a political point of view it would be smarter to work with Darwin first.

Update: In may 2009 a new, hacked bootloader arrived, known as "boot-132". If anyone has experience using it, please let us know.

Update: (29.11.2008)
===============================================
***For Developers only !!! (users must skip this)

Qemu team developed initial "Intel Mac" hardware target patches for Qemu, that may be ported over here, if anyone is interested (and has the knowledge).

On 8.Jan.2008, Alexander Graf from Novell sent several patches to Qemu to enable real Mac OS X emulation, so the number of stupid workarounds will decrease dramatically.

Quoting from his email:
==============================================
the following patchset enables qemu to run Mac OS X with disabled
AppleIntelCPUPowerManagement.kext, by emulating hardware that resembles
an Intel Mac close enough. The following patches are included:

1. DMI
This is based on the DMI support by Ryan Harper. As it is currently
unclear, if this approach is taken or if the Bochsbios is going to be
patched, I would recommend to not apply this patch for now. I still
submit it for completeness and because I have touched parts of it.

2. HPET
This adds an HPET emulator device. It is not feature-complete but should
suffice for this purpose.

3. LPC
This adds a dummy LPC device the HPET is located on.

4. AppleSMC
Apples binary protection sits in the fan control, which is the AppleSMC
chip. This emulates the devices and takes the protective key from the
command line.

5. CoreDUO
Mac OS X as is has a condition to only run on family 13 Intel CPUs, so
this adds a definition for a CoreDuo CPU and an MSR as well as a CPUID
instruction that is required by Mac OS X

6. IDE
The oldest supported IDE controller in Mac OS X is the ICH6. This is an
incomplete implementation for that controller, that suffices for running
Mac OS X and worked with libata for me as well.

7. IntelMac
To leave the default behavior unchanged, this adds a "mac" machine
definition that automatically chooses the right hardware for an emulated
Intel Mac.

8. Multiboot
To boot Mac OS X a mach bootloader has to be run. David Elliot modified
the original i386 Mac OS X BIOS based bootloader to emulate the EFI
entries and support multiboot, an easy but straight-forward kernel
loading interface founded by grub. To boot multiboot-compliant kernels
directly, this adds support for multiboot loading to the -kernel option.

9. Bochsbios
Several ACPI entries were missing from the bios and the new controllers
need to be initialized properly.
This patch is against the bochsbios. Should this rather be sent to the
bochs ML?


For details, instructions and the bootloader please see
http://alex.csgraf.de/self/?qemu/

==============================================
from me:
10. VirtualBox will also need to emulate a better Ethernet controller, such as RTL8139 (or at least default to Intel E1000 for Mac guests), because Mac OS X doesn't have AMD PCnet built-in drivers (alternatively the driver can be installed via "Maxxsus 1.0 network patch" as GuestAdditions. The "Maxxsus 1.0 network patch" is essentially AMD PCnet network driver for Mac OS X).

So this device also should be ported from Qemu.

With those patches ported from Qemu to VirtualBox it won't require hacker's Mac OS X anymore... it will work with standard Mac OS X from Apple. Normal users will be able to install Mac OS X.

Current development progress of VBox: (compared to v1.5.x, as it was the first version where I was able to run Mac OS X)
SSSE3: http://www.virtualbox.org/changeset/25814
1: ?
2: ACPI HPET: http://www.virtualbox.org/changeset/25928
3+4 : LPC and SMC devices: http://www.virtualbox.org/changeset/25952
5: ?
6: ICH6: v2.2 (?)
7: Hardware choices per Guest OS already part of VBox architecture.
8: EFI: v3.1
9: ?

Some experiments by others:
http://sites.google.com/a/puredarwin.or ... virtualbox
http://www.insanelymac.com/forum/index. ... pic=207334
"Black Trinitron" recommends to add this to VBox VM XML: (he uses iDeneb_v1.3_10.5.5.iso)
<ExtraDataItem name="VBoxInternal2/SupportExtHwProfile" value="on"/>
*The procedure above did not work for me.

-Technologov
Last edited by Technologov on 28. Feb 2009, 01:18, edited 6 times in total.
stefan.becker
Volunteer
Posts: 7639
Joined: 7. Jun 2007, 21:53

Post by stefan.becker »

Buy a Mac and use XP as a Guest.
jokker
Posts: 13
Joined: 26. Sep 2007, 04:57

Post by jokker »

Woww where can I get this cracked image of macosx ? on amule and bittorrent ?
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

jokker:
Google for Deadmoo's OS X, and maxxsus 1.0 network patch.
stmiller
Posts: 36
Joined: 5. Aug 2007, 19:28

Post by stmiller »

See the osx86 project. This is discussed at length there. I doubt virtualbox or any vm software will openly comment on supporting this at the risk of making apple's lawyers angry. :)

Not to mention you need a special hacked iso image, as with 10.4.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Good news: Apple now allows legally virtualizing Mac OS X Server guests ! http://www.theregister.co.uk/2007/11/01 ... alization/

-Technologov
Guest

Post by Guest »

Hi,
Technologov wrote:jokker:
Google for Deadmoo's OS X, and maxxsus 1.0 network patch.
found deadmoo, no luck on maxxsus.
Works in VMWare but can't get it to work for VB.
How did you manage this ?
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Try to read again.
Disable ACPI, both in VBox and in guest, and enable Intel VT. If your CPU doesn't have VT, it won't work.
Guest

Post by Guest »

Technologov wrote:Try to read again.
Disable ACPI, both in VBox and in guest, and enable Intel VT. If your CPU doesn't have VT, it won't work.
Nope :(
Did all that.
At startup I entered "platform=X86PC"
then it tried to start but I got a message saying that I should reset the computer. So I reset, then it hangs with a big apple in the screen.

Im assuming that I dont have VT.

I'll have to stick with VMWare which works at a reasonable speed.

Thanx for your help and next time I'll put my reading glasses on the right way round ;)
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

qiqong:
VT is found on Intel Core 2 CPUs - 6000' series. And on some (rare) Pentium 4 systems.

Which CPU you have ?
McStarfighter
Posts: 62
Joined: 3. Nov 2007, 22:55

Post by McStarfighter »

Hey, are you crazy? You are talking about warez and things Apple is sending an armada of lawyers against you or Innotek ...


So stop this please ...
ubuntu-user
Posts: 2
Joined: 23. Nov 2007, 19:26

It works and its fast

Post by ubuntu-user »

It looks from these Xbench tests as if VirtualBox Runs OSX about three times faster than Vmware

http://db.xbench.com/search.xhtml?text=vmware

http://db.xbench.com/merge.xhtml?doc2=256720


:lol:
duncanparsons
Posts: 2
Joined: 30. Nov 2007, 14:41

Post by duncanparsons »

try this: when the initial boot screen turns up, hit F8 to get the boot prompt.

type

-v -legacy -vmware

then hit return. You'll get the verbose version of the OS firing up. Occasionally it will appear to hang - stay with it, and you should get through.

You'll probably have to do this with each boot after installation, unless you edit the com.apple.Boot.plist file to incorporate those.

might not work, but worth a go ;)

DSP
[u]
Posts: 1
Joined: 6. Dec 2007, 20:30

Post by [u] »

Technologov wrote:Try to read again.
Disable ACPI, both in VBox and in guest, and enable Intel VT. If your CPU doesn't have VT, it won't work.
(lenovo/ibm x60: Core2Duo T7200)

no acpi/ no io-acpi/ vt enabled,
install (uphuck 10.4.9) bombs at:

00:00:00.961 Guest Log: BIOS: VirtualBox 1.5.0
00:00:00.961 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:00.981 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
00:00:01.000 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=03800000 w=640 h=480 bpp=8 cbLine=0x280
00:00:03.094 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:03.095 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:03.095 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:03.099 Guest Log: BIOS: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
00:00:03.099 PIIX3 ATA: Ctl#1: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:03.099 PIIX3 ATA: Ctl#1: finished processing RESET
00:00:03.108 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=00000000 w=720 h=400 bpp=0 cbLine=0x0
00:00:03.122 Guest Log: BIOS: Booting from Hard Disk...
00:00:20.132 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=03800000 w=1024 h=768 bpp=32 cbLine=0x1000
00:00:20.147
00:00:20.147 !!Assertion Failed!!
00:00:20.147 Expression: <NULL>
00:00:20.147 Location : e:\vbox\w32-rel\src\vbox\vmm\vmmall\PGMAllGst.h(497) pgmR3GstPAEMonitorCR3
jcp
Posts: 2
Joined: 9. Dec 2007, 22:46

Post by jcp »

Almost the same error trying to boot BrazilMac_PatchedDVD.iso image

00:00:01.103 Guest Log: BIOS: VirtualBox 1.5.0_OSE
00:00:01.103 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:01.118 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
00:00:01.137 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=b1d0d000 w=640 h=480 bpp=8 cbLine=0x280
00:00:03.292 PIT: mode=2 count=0x10000 (65536) - 18.20 Hz (ch=0)
00:00:03.292 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:03.293 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:03.293 Guest Log: BIOS: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
00:00:03.293 PIIX3 ATA: Ctl#1: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:03.296 PIIX3 ATA: Ctl#1: finished processing RESET
00:00:03.300 Guest Log: BIOS: Boot from Floppy 0 failed
00:00:03.303 Guest Log: BIOS: Booting from Hard Disk...
00:00:03.311 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=00000000 w=720 h=400 bpp=0 cbLine=0x0
00:01:46.620 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=b1d0d000 w=1024 h=768 bpp=32 cbLine=0x1000
00:01:46.688
00:01:46.688 !!Assertion Failed!!
00:01:46.688 Expression: <NULL>
00:01:46.688 Location : /home/mmodem/rpm/BUILD/VirtualBox-1.5.0_OSE/src/VBox/VMM/VMMAll/PGMAllBth.h(2374) int pgmR3BthAMD64RealPrefetchPage(VM*, RTGCUINTPTR)
00:01:46.689 Shw=5 Gst=1 is not implemented!
Locked