Jump to content

run OSX in QEMU


DrJägermeister
 Share

35 posts in this topic

Recommended Posts

Some guys had asked for the modified QEMU binary witch can run OSX on a SSE only CPU.

 

I compiled it in Linux, the OSX deadmoo VMware image is running:

qemu38tk.th.jpg

Download the 2 .zip files, and unzip booth. One is a folder called qemu, you should copy it to /usr/local/share. The other one is the qemu binary, you should copy it in the same folder as your OSX image. Start with this as normal user (change 320 with the amount of RAM you want):

#cd /path/to/your/OSX

#./qemu -m 320 -localtime -user-net -hda /path/to/your/OSX/tiger-x86-flat.img -boot c

You have to start with this options, you can change the resolution in 1024x768x16 if you prefer:

qemu7tk.th.jpg

 

For more speed install the KQEMU accelerator module, it exist for Linux & Windows :

http://fabrice.bellard.free.fr/qemu/qemu-accel.html

I'd install this and OSX was 3-5 times faster, but I don't know if the KQEMU works with SSE only. Just QEMU alone without this kernel module should work without SSE2 or SSE3.

 

For windows take a look here:

http://forum.osx86project.org/index.php?showtopic=5132

 

Binary removed, go to topic 22 for a patched qemu with Realtek 8139 support

 

 

Edited by Hagar
added link for clarity
Link to comment
Share on other sites

Could you tell me which part of the source has been changed to run 10.4.1.

(Is it APIC part only?)

 

Have you tried to run 10.4.3 w/wo patch?!

I've taken the 0.72 source from the qemu homepage:

http://fabrice.bellard.free.fr/qemu/

The I changed 2 lines in target-i386/helper2.c :

#ifdef TARGET_X86_64

/* currently not enabled for std i386 because not fully tested */

env->cpuid_features |= CPUID_APIC;

env->cpuid_ext2_features = (env->cpuid_features & 0x0183F3FF);

env->cpuid_ext2_features |= CPUID_EXT2_LM | CPUID_EXT2_SYSCALL;

env->cpuid_xlevel = 0x80000008;

 

/* these features are needed for Win64 and aren't fully implemented */

env->cpuid_features |= CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA;

#endif

 

changed in:

 

/* #ifdef TARGET_X86_64 */

/* currently not enabled for std i386 because not fully tested */

env->cpuid_features |= CPUID_APIC;

env->cpuid_ext2_features = (env->cpuid_features & 0x0183F3FF);

env->cpuid_ext2_features |= CPUID_EXT2_LM | CPUID_EXT2_SYSCALL;

env->cpuid_xlevel = 0x80000008;

 

/* these features are needed for Win64 and aren't fully implemented */

env->cpuid_features |= CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA;

/* #endif */

 

After that I compile it on a Suse 9.3. I've tested only the 10.4.1 deadmoo VMware image.

Link to comment
Share on other sites

  • 4 weeks later...

New qemu 0.8.0 is out with USB support now:

http://fabrice.bellard.free.fr/qemu/changelog.html

With the same modifications as for 0.7.2 it runs OSX86:

qemu0806fy.th.jpg

 

 

 

Qemu binary (300KB):

 

 

Start with -usb for USB support.

EDIT: changed wrong link.qemu0.8.0Folder.zip

 

RENAME THE FOLDER qemu0.8.0 in qemu before you copy it to /usr/local/share

 

Binary removed, go to topic 22 for a patched qemu with Realtek 8139 support

Edited by DrJägermeister
Link to comment
Share on other sites

  • 3 weeks later...
  • 5 weeks later...
does this support QE or CL. Does it at use any hardware directly

No you don't have QE or CI in an emulator and you don't have direct access to the hardware.

 

@LordI: post more details what exactly you are trying to do, with only this pic I can't see where the problem is :withstupid:

Link to comment
Share on other sites

I downloaded the folder with MacOs for X86 but I read somewhere that don't work with AMD processor. I read we need a second hard drive too. But maybe, I have wrong : I don't know. I don't understand all to make a installation.

And, I saw this tutorial : I thought it was interesting for me.

 

And, I want to can choose my boot with my present OS (Mandriva) or MacOS. In the futur, maybe open MacOS in my GNU/Linux.

Link to comment
Share on other sites

I downloaded the folder with MacOs for X86 but I read somewhere that don't work with AMD processor. I read we need a second hard drive too. But maybe, I have wrong : I don't know. I don't understand all to make a installation.

And, I saw this tutorial : I thought it was interesting for me.

 

And, I want to can choose my boot with my present OS (Mandriva) or MacOS. In the futur, maybe open MacOS in my GNU/Linux.

It works natively or in VMware with a AMD64 (socket 754 or 939). If you have a AthlonXP socket 462 (SSE only) it works only with qemu (10 times slower as natively), but at least it should work. You don't need a extra HD and you don't need to make an installation if you use the deadmoo VMware image in qemu.

Link to comment
Share on other sites

I did this for a laugh after I blew my bios, booting deadmoo in qemu on my Athlon XP worked fine, but requires great patience, and was not terribly useful, at least not for me... I had a strange experience that it would fail to boot if I allocated more than 512mb to it (1.5gb on the pc)

Link to comment
Share on other sites

My processor is a AMD Ahtlon 2200 XP. I don't know if I can make a native installation.

And, for this case, I need a second hard drive... and I don't have.

 

For Qemu: what is exactly the deadmoo VMware image? The tiger-x86-flat.img or another?

Link to comment
Share on other sites

So, I have something wrong with my image.

Some questions : what is normaly the properties of this image? How many files I need to have in my Tiger-X86 folder?

My tiger-x86-flat.img file is 112.8 Mb heavy and I have 9 others files.

Link to comment
Share on other sites

I uncompressed again my archive folder. Now, it's good : 6 Gb for my flat image.

But, I have a new error : "QEMU acceleration layer not activated

Erreur de segmentation"

That's OK, the binary is compiled with kqemu support. If you want kqemu you need to download and install it, I can't provide this due to the license. Kqemu don't work with the combination "OSX86+SSE only CPU" so don't install it (for SSE2 CPU it works). But OSX86 should start without kqemu.

Link to comment
Share on other sites

  • 3 weeks later...
Thx DrJägermeister,

 

is it possibe that you share your changed sourcecode ?

Or can you build qemu with the latest qemu-CVS, that we can use the kqemu-1.3pre3 ?

I used the sources from the qemu homepage and only changed 2 lines (described on top). This should probably also work with the latest qemu-CVS but I haven't tested it yet.

Link to comment
Share on other sites

Oh, two line only ...great , it works with the new qemu-0.8.0-cvs, but i must not use -kernel-kqemu .

If i use the option -kernel-kqemu I have a kernel panic.

For network apply this patch to your sources, it will emulate a Realtek 8139 (default: NE2000) and it works for OSX86 out of the box (NE2000 don't work for OSX86):

http://qemu.dad-answers.com/download.php?id=48

patch -p1 -d /path/to/qemu/sources -N < qemu-cvs-rtl8139-patch2.diff

Good luck

 

qemu81391rz.th.jpg

 

Here is the qemu binary (0.8.0) with a Realtek 8139 NIC emulation for everyone who don't want to patch and recompile the sources:

qemu.zip

Put the binary in the same folder as the deadmoo image and start qemu with:

./qemu -m 320 -localtime -usb -hda tiger-x86-flat.img -boot c

qemu7tk.th.jpg

Don't forget to copy the qemu folder from topic 4 (rename it as qemu) to /usr/local/share

http://forum.osx86project.org/index.php?ac...pe=post&id=1043

 

Qemu is compiled wit kqemu support but I can't provide the KQEMU accelerator module due to the license, you need to download and install it yourself. It works also without this module but slower. SSE only CPU user can't use KQEMU for running OSX86, they have to use only Qemu.

http://fabrice.bellard.free.fr/qemu/qemu-accel.html

 

You need to install the Maxxuss SSE3-SSE2 Patches v0.5c in your deadmoo image that safari (and some other softs) don't crash anymore.

Link to comment
Share on other sites

Nice work! Is there any chance of you creating a windows binary? If not, what src did you use to compile to compile qemu, and will the realtek nic driver work in windows as well?

I use the official qemu 0.8.0 sources from the qemu homepage, change 2 lines and patch it with the Realtek 8139 patch. That's all you have to do if you want to compile it yourself. It works also for Windows:

msqemu81399oj.th.jpg

Download the 0.8.0 package for Windows from the other tread (the rapidshare link below), replace qemu.exe with this new one and the network should work. This qemu.zip (qemu.exe) is for MS, not for Linux, the linux binary is in topic 22:

http://rapidshare.de/files/9644009/QEMU0.8.0win.zip.html

replace qemu.exe with this one:

qemu.zip

 

You need to install the Maxxuss SSE3-SSE2 Patches v0.5c in your deadmoo image that safari (and some other softs) don't crash anymore.

Link to comment
Share on other sites

Download and install the accelerator for more speed.

 

Has anyone had any luck with the accelerator in Windows (2000)? I suspect that it is not compatible with the patched version of Qemu. When I use it on my system with the tiger image, it hangs with a spiked cpu and forces me to reboot in order to kill it.

Link to comment
Share on other sites

 Share

×
×
  • Create New...