ranma42 / TigerOnVBox

HOWTO run Tiger (MacOS X 10.4) on VirtualBox
72 stars 12 forks source link

Can't get to GUI part of installer #3

Closed oboroc closed 7 years ago

oboroc commented 7 years ago

Is it important to run VirtualBox on macOS? I am trying to build a Tiger Server in VM on Windows 10, but it always stops with some panic. Any idea why? virtualbox_tiger_20_04_2017_20_23_04

If I switch to IDE controller for VM, what should I make HDD and DVDROM? Primary master and primary slave? Or primary master and secondary master?

Can you please share the SHA1 of Tiger Server 10.4.7 dmg file you use? Mine is e71b683b16c13cf7f086f4b6ce4579f7da1d53e6

oboroc commented 7 years ago

Update: I installed VirtualBox on my rather feeble Macbook Air 13 from 2011 and your recipe worked fine. I'm installing Tiger Server now. Somehow it only works on mac host. Install went though, but hung on shutdown. I forced reboot and it booted fine. I'm installing 10.4.11 combo update now.

ranma42 commented 7 years ago

I used the following image file: b4b9e53c7ec4ecf11c2d5f89ffc29251ee9ac653 mac_os_x_server_v10.4.7_universal_build_8k1079.dmg

The license only permits installing Mac OS X server "on a single Apple-labeled computer at a time. You agree not to install, use or run the Apple Software on any non-Apple-labeled computer, or to enable others to do so."

The operating system is almost certainly checking that some hardware components are recognised as original. I believe it might be possible to trick it into running on a non-Apple machine, but given the license agreement, I do not plan to experiment with that.

oboroc commented 7 years ago

Tiger Server installed fine and updated to 10.4.11 fine as well. Even sound works pretty well. But sometimes it doesn't boot. Resetting it once or twice will usually boot into OS GUI. I'm curious why does boot fail intermittently. Do you have any ideas? How would one go about troubleshooting it?

ranma42 commented 7 years ago

Does it fail or just take longer? Check that you only have the hard disk in the storage (i.e. that the optical disk has been removed). Regenerating the kernel module cache might help getting to a VM that does not get stuck at boot, too.

oboroc commented 7 years ago

it fails, it keeps on writing "waiting on root". I'll try to sceencap. How do I regenerate the kernel module cache? Thank you for helping!

Update: I removed virtual DVDROM, and it boots much faster! It boots reliably from the "cold start" (offline VM), but hangs if I try to reboot.

Another peculiar thing I discovered: if you click on Apple -> About This Mac, Tiger Server logs me out immediately. Do you have the same experience?

kencu commented 7 years ago

Yep, "About this Mac" logs me out too. Also, couple more idiosyncracies, machine will only boot with 1 processor enabled (kernel panics with 2), and when I set the memory to 4GB I just saw a black screen.

ranma42 commented 7 years ago

Yes, same for me, 2+ processors or 4+ GB or RAM prevent a successful boot and I cannot open "About This Mac" (but the System Profiler works, with the exception of the top level hardware page and I have a fix for that... will add it soonish ;) ). 3 GB boot fine for me, and even a little more than that, but I did not delve deep enough to find out the exact limit nor what might be the cause (EFI-OS interaction problem? missing OS support?).

I should really add a "Known issues" session.

ranma42 commented 7 years ago

Could you try and see if running:

VBoxManage setextradata Tiger VBoxInternal/Devices/efi/0/Config/DmiUseHostInfo 0
VBoxManage setextradata Tiger VBoxInternal/Devices/efi/0/Config/DmiBIOSVersion EFI32..Virtual.Box

is sufficient to fix the "Hardware" page in System Profiler? Thank you :)

EDIT: it works for me, but I would like to confirm it in other environments as well before adding it to the guid

EDIT2: I chose EFI32..Virtual.Box as BIOS version, but any string with at least 3 . in it should do. The system will only show the first, third and fourth dot-delimited substrings.

ranma42 commented 7 years ago

Uh, it looks like I might have found a way to fix also the other two issues. The following commands fixed the multiprocessor boot for me.

VBoxManage modifyvm Tiger --cpu-profile 'Intel Pentium 4 3.00GHz'
VBoxManage modifyvm Tiger --cpuidset 00000000 00000004 756e6547 6c65746e 49656e69

... and magically they also fixed the "About This Mac" logout issue :)

Explanation about the magic: several services and applications die with a division by zero if machdep.cpu.cores_per_package is 0... apparently this happens at least for loginwindow.app and servermgrd.

Could you test these settings, too?

oboroc commented 7 years ago

Thanks, @ranma42! This worked great, I now also have Hardware in System Profiler work, and "About This Mac" doesn't log me out anymore! Please add those changes to your repository.

In About This Mac it says Processor 1.8GHz unknown. I guess Tiger didn't know CPUID for P4. I wonder is there a CPUID that works for VM, but is also recognized. May be some early Core Duo or Merom Core2Duo?

I can also confirm that I enabled two CPU cores for VM and it works fine.

ranma42 commented 7 years ago

Several modern CPUs have too many sub-leaves in the node eax=0x4 of the CPUID information. Among the profiles currently shipped in VirtualBox, Intel Pentium 4 3.00GHz was the only one that allowed me to increase the CPUID limit (the second number in the --cpuidset command) to 4, so that the OS can probe the number of CPUs.

I am currently experimenting with some other setting, as I would like to expose a few more CPU extensions. Still, I plan to keep using that CPU profile, because it is quite easy to override CPUID leaves, but AFAICT VirtualBox does not currently expose a way to override a sub-leaf.

Also, it is not clear to me whether the "About This Mac" dialog uses information from the CPUID or from other sources (DMI?). I will investigate ;)

kencu commented 7 years ago

Beautiful. Two pegged-out CPU cores building software with Macports, and 3 GB ram. Great work!

oboroc commented 7 years ago

Thanks @ranma42, fantastic work!

I personally want to experiment with Xgrid builds over two Mac mini G4 and a dual core VM with Intel Tiger. I just wish I could use plain Tiger instead of Server, but I don't think there was a retail release for it. I do have a grey DVD with Tiger 10.4.7 for iMac late 2006 (iMac5,1), but it checks for specific hardware and refuses to work on anything that is not iMac... I wish there was a way to fake specific Mac hardware on EFI32/VBox level or at least a patch that kills the check.

ranma42 commented 7 years ago

@oboroc you might be able to fake specific hardware with the dmi settings, but I am not sure about that. You might be able to find additional information here or searching for "Hackintosh".

I think I remember there was a retail release for Tiger, but I might be mistaken (and/or it might be PPC-only?).

ranma42 commented 7 years ago

I confirm that the "About This Mac" uses information from the DMI. Unfortunately it tries to use data coming from an Apple-specific extension of the SMBIOS (table 131), which cannot be overridden in VirtualBox (without changes to its source code). If you are only interested in an aesthetic fix, you can simply edit the UnknownCPUKind association in /System/Library/CoreServices/Resources/English.lproj/AppleSystemInfo.Strings. Note that the SMBIOS hackery would probably still cause just a visual change as well.

oboroc commented 7 years ago

Thanks @ranma42! Please feel free to close this issue, since I definitely can get to GUI part of installer now.

What documentation are you referring when you research EFI32 and SMBIOS and so on? Is it something included with Xcode 2.5? Or Darwin bits from Apple Open Source?

ranma42 commented 7 years ago

Mostly the source code both for Darwin and for other pieces of the system. The "About This Mac" thing is also discussed in several threads in Hackintosh forums.

I added some references (for example the "definition" link here).

@kencu I bisected the maximum amount of memory that can be set. In my environment I can run the VM with up to 3488 MB of RAM, while more than that makes the EFI bootloader fail (i.e. it does not even get to the OS).