Categories
Guides Hackintosh Mac

MacOS in Virtualbox. It just works.

You can run MacOS in Virtualbox. Because? Because.

In the pursuit of Hackintosh, you need a Mac. That’s well and great, but I didn’t want to screw around with my partner’s Macbook. So what if you want to sandbox something? Virtualbox!

I had no expectations that this was going to work. OS X has always been runnable in Virtualbox for a while, but the performance has normally been lacklustre. While it’s not exactly daily-driver level, the performance in Virtualbox wasn’t too bad!

The macOS Virtualbox option is designed for genuine Apple hardware. You will not get community support from Virtualbox if you have trouble with this process, as it’s against Apple ToS.

πŸ€”οΈ What do I need?

You need a donor Mac to start this process. You will not need access to it permanently, but just during the process of creating an ISO for your VM to setup with. Else, you need:

This guide will discuss installing MacOS Mojave, however installation process should be similar for all MacOS versions.

⚠️ At the time of writing, Virtualbox and Hyper-V cannot co-exist on Windows. MacOS is also not installable on Hyper-V. I use Linux in my screenshots as I use Docker on Windows. This also includes Windows Subsystem for Linux, which tripped me up from installing.

πŸ’ΏοΈ Creating the ISO

Virtualbox installs generally prefer to use an ISO file, which unfortunately will require some handiwork to get a hold of. Persevere and you will get there!

On the MacOS machine, download the Mojave installer. Don’t worry about actually running this application, as we’re going to use some terminal magic to build the ISO from the package.

This process is not affected by MacOS Installer expiry. If your MacOS installer has expired, you can continue with this guide.

Once the package has been downloaded, pop open Terminal (Utilities folder in Launcher), and run the following commands:

hdiutil create -o /tmp/Mojave.cdr -size 8000m -layout SPUD -fs JHFS+

This will create a virtual ‘disc’ stored in your temporary directory. This is what we’ll stuff the Mojave installation stuff into.

hdiutil attach /tmp/Mojave.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/installer_goes_here

Now MacOS can ‘see’ your disc as an actual disc, ready for writing to!

asr restore -source /Applications/Install\ macOS\ Mojave.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/installer_goes_here -noprompt -noverify -erase

We’re now grabbing the installation DMG from within the updater package, and storing it within the disc image. This will rename the disc image, so don’t panic that ‘installer_goes_here’ has vanished.

Now, detach the image from our MacOS. You can just eject it like regular DMGs. If not, run the command:

hdiutil detach /Volumes/OS\ X\ Base\ System

(it may change since OS X is legacy. To check, run ls /Volumes and see if it’s there, renamed).

Now for the final process, let’s convert our CDR image to an ISO!

hdiutil convert /tmp/Mojave.cdr.dmg -format UDTO -o ~/Desktop/Mojave.iso

You should now have a file on the Mac desktop called ‘Mojave.iso’. Congratulations, you have your installation disc! Copy this over to where your Virtualbox is setup. The Mac is no longer needed at this point.

πŸ› οΈ Setting up Virtualbox

⚠️ Before continuing, install the Virtualbox Extension Pack, if you haven’t already. This comes with a special USB 3 driver that without, the Mac simply won’t see USB devices.

Virtualbox has the option for a MacOS virtual machine in it’s New VM dialog, but we will need to make further adjustments to make it truly Mac-ready.

Pop open Virtualbox, and Create a new Virtual Machine. Name this MacOS Mojave, and set it to Mac OS X (64-bit).

Screenshot of the 'Create Virtual Machine' dialog from Virtualbox. In the screenshot, 'name' is set to 'MacOS Mojave', 'Type' is set to 'Mac OS X' and 'Version' is set to 'Mac OS X (64-bit)'.

Set the RAM to 4096 MB (or higher if you can achieve it!).

When creating the disk, you can use either format versions. Dynamic will not immediately take up the storage size you chose, whereas Static immediately reserves the chosen size for the VM. The latter is slightly better for performance.

Screenshot of the 'Create Virtual Hard Disk' dialog, with 40 gigabytes set to the storage size.

Now you should have a new, primed MacOS machine. But you will need to run some commands now. This can be hit-and-miss, and may require some Google-fu. The following works for my AMD FX computer:

VBoxManage modifyvm "MacOS Mojave" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage modifyvm "MacOS Mojave" --cpu-profile "Intel Core i7-6700K"
VBoxManage setextradata "MacOS Mojave" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "MacOS Mojave" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "MacOS Mojave" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "MacOS Mojave" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "MacOS Mojave" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Windows? Change VBoxManage to "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" (if you didn’t change your Virtualbox install location).

The above does the following, in order of command:

  • Sets a known CPU ID set that MacOS will recognise.
  • Especially for AMD machines, changes what MacOS sees as your processor to something it supports.
  • Tells MacOS you’re installing Mojave onto a mid-2010 iMac. You can change this to your preference.
  • These two specify a fake DMI, typically found in Apple PCs.
  • A device key to pass system checks.

Before starting the VM, open the VM settings. Head to System > Acceleration and uncheck Enable System Paging, which can cause the bootloader to fail. Also, head over to USB and enable USB 3.0 Controller.

With all that done, we’re ready to start the VM!

You should be greeted with the following screen:

The 'Select start-up disk' dialog is shown, with the default 'host drive' currently selected.

Click on the folder icon, and find your ISO created on the Mac before, then click Start.

And wait. yes, this process takes a long time. If your installation stops, try googling the last output message to see if there is a community fix, or post below… Otherwise, this is generally a slow process.

If all has gone well, you should be greeted by the MacOS installer language selection. If so, you’re almost there! On the top menu, open Utilities > Disk Utility.

There should be a disk named VBOX HARDDISK or similar. This is the VDI you created during the setup process, and not your actual hard drive. So go ahead and full-erase this disk, with Mac OS Extended (Journaled) and GUID Partition Map.

A screenshot of Disk utility on MacOS, intending to erase VBOX HARDDISK Media. The Name is set to Untitled, Format set to Mac OS Extended (Journaled), and scheme set to GUID Partition Map.

Once the disk formatting has completed, close it down. You should now be able to start the installation!

Once this is complete and you filled all the required details in, congratulations! You’re running MacOS Mojave within Virtualbox!

πŸ‘οΈ What works?

βœ”οΈ Does

  • Screen (No 3D).
  • Regular input methods (mouse sharing).
  • Networking.
  • USB devices.
  • Mac App Store.

❌ Does not

  • Full graphics.
  • Audio.
  • Guest additions.

At the end of the day it’s still a virtual machine, and a technically unsupported one at that. However, considering the matter it’s still impressive how Virtualbox can cope with MacOS.

Files can be shared using typical Windows share features. If you share a folder on your network from your host machine, your Mac VM should be able to connect to it.

🌟️ Special Thanks

This required a lot of Googling, and these are the people who saved me at the end of the process!

πŸ› Troubleshooting

You get Guru Meditation, “A critical error has occurred while running the virtual machine and the machine execution has been stopped” when machine gets to RandomSeed.

This is a difficult one, and will require investigation. I checked the logs as the error message said, and discovered:

HM: HMR3Init: Attempting fall back to NEM: AMD-V is not available

If you’re on an Intel processor, it’ll likely say VT-x instead.

Obviously, check if this is enabled. If you’re on a legacy BIOS computer, it’s a straightfoward scan for AMD-V/VT-x in your settings. If it’s UEFI, you’re gonna have to Google it.

Strangely, on my machine it was enabled. Supposedly Virtualbox and Hyper-V can run side-by-side, so at this point I decided to remove Hyper-V, to see if that would improve. It didn’t, but I forgot something. For this to work, you must turn off Windows Subsystem for Linux!

I completely forgot that WSL uses Hyper-V, and apparently still does when it’s disabled. Unfortunately, it would seem (for me at least) you need to trade it off for macOS in Virtualbox.

I will retest this when WSL2 is launched.

Categories
Hackintosh Mac

Toshiba Satellite Pro L850, Hackintosh Revisited

Back in 2018 I turned my laptop into a Hackintosh device, running High Sierra. I had a donor MacBook mid-2010 that I used to run TonyMac tools to get Hackintosh working. It was a fun if complicated process of trial and error, but the result was always impressive – a craptop unexpectedly booting macOS.

I eventually wiped macOS and re-installed Windows for a WordCamp coding session. The laptop proved to be quite a letdown, and now sits on a shelf collecting dust.

So, let’s Hackintosh it – again!

πŸ›‘ If You’re Attempting This…

I hate it when some guides forget to do this, but if you want to try this yourself, you absolutely must have the following or you won’t be able to do it:

  • An existing Mac or Hackintosh to build the USB on.
  • A copy of Install macOS Mojave.app. I can’t legally provide mine and they do expire, so fresh is good!
  • My laptop is Toshiba Satellite Pro L850-1UJ. Other L850’s might have a different setup.
  • A large capacity (8GB+) usb storage device.
  • Dedicate the laptop – you will erase everything on it.

If you can’t fufill these, then stop now. You’ll be wasting your time. If you want to see roughly how Hackintosh works or how my experience was, then please read on!

🧐 What Does and Does not Work?

This is from my current setup. They might actually have working configs that I’ve yet to find. If you know any, please comment below!

βœ”οΈ Does

  • Screen (full graphics).
  • Brightness controls.
  • Keyboard & trackpad.
  • Battery monitor.
  • USB.

❌ Does not

  • Ethernet.
  • WiFi.
  • Audio.

I happened to have both the Edimax and TP-Link USB wireless adapters, which worked once drivers were installed.

πŸ•“ Changes from 2018

Instead of relying on TonyMac software, I’ve decided to attempt Hackintosh Vanilla. To quote the website:

A vanilla setup implies that the OS itself remains relatively untouched – and that the bulk of the Hackintosh-related kexts, patches, etc are contained on the EFI partition. For all intents and purposes, a vanilla install’s main partition is identical to that of an official Apple computer.

hackintosh.gitbook.io/-r-hackintosh-vanilla-desktop-guide

Other than the different approach, I had the following caveats:

  • Instead of High Sierra, I’m installing Mojave.
  • My MacBook blew up*, so I’m using a combination of Virtualbox and my partner’s Macbook Air.
  • This time, I will not be undoing it. This will be a continuous project until the laptop dies.

*An important point I must raise here. I bought my mac from an eBay listing a few years back. One day I plugged it in and it literally blew up. Smoke came from the plug and I had a residual shock. I put the MacBook and the dead charger in a cupboard and forgot about it. Recently, I pried open the plug to find it was a fake (or a non-recall), and the fuse was bypassed. Please, check your chargers! I now have a plug in RCD when using eBay auction purchases, just in case…

πŸ‘©β€πŸ’» The Process

Setting up a Bootable USB

My trusty SanDisk Cruiser was still lying around, but I’d long since wiped it. So I wiped it without a moment’s consideration of the content (not recommended, of course) and prepped it for being a macOS conduit!

Installer expires?!

Now I keep an archive of macOS installers because… Well, I don’t really know why. Using my partner’s Mac I created a bootable macOS drive using an archived Mojave, only to find I got the error:

This copy of the Install macOS Mojave application is damaged, and can’t be used to install macOS

So it turns out these macOS installers expire! Like a bad carton of milk, macOS would simply refuse to run (other tools like Disk Utility and Terminal were fine). I tried multiple solutions I found on Google to bypass it, but none worked.

It would seem that Apple sign a certificate on the day you downloaded the installer from them. If you wait too long, macOS deems it damaged. You appear to be able to reset the system clock or edit the date via Terminal, but you need to know when your package was signed. Unfortunately, I didn’t note the date down. I discovered however I could re-download it from Apple still. Phew!

Back on track (and still on my partner’s Mac), once I had created the Bootable USB, I used Did’s autobuild of Clover to install Clover onto my USB. Complete shout-out to anyone who works on Clover in any form, as this fantastic bit of kit is what will get your Mac installation drive booting on a PC, and beyond!

In my previous attempt I had a config.plist that worked wonders with my current setup. However, the default config that comes with Did’s Autobuild was apparently completely fine for this laptop. This makes a great starting point!

I ran the Clover Installer package, changed the location to my USB drive, and didn’t change a damn setting. Install, and (safely) yanked that newly primed Hackintosh stick out.

UEFI/BIOS Changes

This laptop comes with UEFI and legacy BIOS mode. Supposedly Clover works with both, but for my install I enabled UEFI mode and disabled safe boot. Saved changes and exited.

Smashing F12 like the refresh button, My trusty Toshiba asked what to boot from. What else but the Macintosh conversion stick?!

I left Clover alone, and it booted straight into the Mac recovery screen. Now, if you’re going to commit to this make damn well sure your Toshiba has nothing important stored on it, and is backed up! This process (or at least how I did it) will erase everything!

Pop open Disk Utility from the Utilities menu. I had to click the button at the top left and show all devices. On my main hard drive (not the USB stick) I selected it and chose erase. I made sure to choose Mac OS Extended (Journaled). APFS might be supported, but I’d rather use the tried-and-true format, and the GUID Partition Map. Hooray, the whole disk is now in Mac format!

Excluding the certificate expiry, the installation ran without a hitch. My network adapters (ethernet and wireless) were not detected so I opted to install without connecting to the internet. I also selected British – PC as my keyboard format, which seems OK except alt and special are swapped round.

Storm through the install like a regular Mac. After a lot of waiting and reboots, you’ll be greeted with the Mac screen. Hooray, you’re done(ish)!

πŸ›  Getting Stuff Working

Most things are working at this point, or at least the most important stuff. Networking, sound, and laptop detection are not.

I used the following kexts (In the EFI partition, in Clover/Kexts/Other):

  • FakeSMC, what doesn’t this one do?
  • Lilu, a dependency for almost all Hackintosh kexts.
  • VoodooPS2Controller, enables keyboard and trackpad.
  • ACPIBatteryManager, battery is detectable by MacOS.
  • NativeBacklight, MacOS detects display has adjustable brightness.

Great. With the above, your keyboard, trackpad, battery and brightness now work.

Native backlighting took some jiggling to get working. RehabMan on TonyMac has a great guide to getting this working (I installed the kext into Clover, not MacOS).

🧐 The Verdict

I’ve actually been finding the performance on this base-spec (inc. original hard drive) runs really well on MacOS. There are slowdowns, and I have not tried gaming on this machine, but nothing more than I would expect from a very old machine. Plus Apple tends to care for their ageing old Intel machines really well, so I’m not too surprised.

The lack of sound and wireless networking is troublesome though. I make do with a USB wireless dongle, but until I can find a solution to let MacOS see my actual WiFi card, I may not be able to upgrade to MacOS Catalina. The lack of ethernet detection also causes problems with the Mac App Store, which seems to always reckon I’m not connected (despite updates downloading just fine).

So, I’m gonna keep it!

πŸ€– The Future

With no dire need to use this laptop (the battery is really dead), I’m going to persist on trying to get Hackintosh to work as much as possible. It really does feel rewarding, and you never get tired of the shock some people have when they see your craptop suddenly boot MacOS.

Although they will question “why not buy a real Mac

Categories
Hackintosh Mac

Hackintoshing a Toshiba Satellite Pro L850-1UJ

⚠ This project has been resumed. Please see the latest version of this.

While I am a technical person, the Hackintosh community is scores ahead of what I know. The work put in by the awesome community supporting the Β movement for macOS/OS X on other machines is incredible. I’ve watched the progress since I was 11, but never branched into it. Recently, it all changed.

macOS High Sierra about screenshot, showing the version details
My Toshiba pretending to be a MacBook Pro

I write this now on a Hackintosh laptop. This isn’t any old laptop however… This is a laptop that is not technically supported. I googled for hours to see the achievements of other Satellite owners and found nothing. However, with trial and error (and years of configuring crap experience), I was graced with the Apple logo appearing on my non-Apple laptop.

Notice: Since 2019 I have removed Hackintosh from my laptop, this is primarily as I have received by MacBook White back and so now use the laptop for Linux distributions instead.

Notice: Since 2020, my MacBook white exploded so I’ve returned to this, which can be seen here (Hackintosh, not my laptop exploding).

Back Story

I recently traded my trusty MacBook White mid-2010 for my girlfriend’s university laptop Toshiba Satellite Pro L850. Since leaving uni she no longer needed a laptop in general, and was happy to take a lower-spec Apple machine to compliment her iPhone. Receiving a much higher spec machine in return, we swapped. I immediately (no joke – first two hours of receiving it) turned it into a Linux machine, using Ubuntu and later, elementaryOS.

I then wished to contribute to a Windows extension development, in which I needed Windows again for. eyeing up the old trusty Mac again, I realised I was in the best position to Hackintosh – pre-existing Mac and a machine that can be clean-wiped. And so it began.

How?

I would like to take this moment to say this would not be possible without the amazing community work that goes into it. I simply configured this laptop to use Hackintosh, the real developers and hard-workers can all be found at the TonyMac86 community. If you’re impressed by this, or tried it yourself, please direct all the praise to those amazing people.

What Does & Doesn’t Work

Take this with a pinch of salt, as Apple never intended for you to install this. Whatever does work is an absolute miracle, and often smaller problems can be overcome with additional hardware.

Initial issues with graphics

Does Work

  • Main Display Graphics (Intel HD 4000) with Clover config.
  • Keyboard (set to ISO, keys don’t match up 100%) and trackpad.
  • Wireless Internet (temporarily, resorted to dongle).
  • Battery status.
  • USB ports (you wouldn’t believe how problematic that can be).
  • CD/DVD drive.
  • Webcam.

Doesn’t Work

  • Laptop Detection, for power management (In Progress).
  • Brightness Controls (In Progress).
  • Standby (Kernel Panic).
  • Brightness controls (Lucky for me, seemingly defaults to mid brightness).
  • Sound (Untested, does seem to be fixable).

For most of the non-working elements, any USB peripherals claiming to be Mac-compliant should work in their place. Your experience may differ.

Quick Steps

  • Enabled UEFI, but disabled secure boot in BIOS.
  • Download the macOS High Sierra installer from the App Store, on the existing Mac.
  • Download and run Unibeast (set for UEFI).
    • Also copy Multibeast onto USB.
    • While EFI is apparently mounted, I copied over the neccessary kexts and this configuration file into the CLOVER directory (don’t replace the existing config.plist).
  • Make a cup of tea.
  • Drink said tea.
  • Plug USB Stick in Toshiba, repeatedly tap F12 on boot, and boot via USB.
  • In Clover, go to options, config, and select the configuration you copied earlier (most likely, the currently deselected one).
  • Select ‘Boot from Install macOS High Sierra’.
  • Wait (another tea moment) for macOS to start.
  • Open Disk Utility (click View > Show All Devices at the top).
  • Select TOSHIBA and click erase.
    • I erased the entire hard drive. If you wish to keep stuff or dual boot, please see a guide for dual booting as this will erase everything.
  • I chose single HFS+ partition (I named it the classic Macintosh HD), with a GUID partition map.
  • Once complete, run the installer.
  • Once finished, boot via USB stick again.
  • Same again with Clover, this time select ‘Boot from <partition name>’.
  • Congratulations – You’re running macOS!
    • You will be reliant on the USB key to boot. Check out Remove USB Reliance to stop doing this.
  • (Optional) Setup Windows dual boot.

Many, many, many steps to go through, but so long as everything is done correctly, this should be a completely rewarding experience afterwards.

Required Kexts

Kexts are basically driver packages used by macOS to understand what your various input devices are telling it. Without usable kexts, if macOS doesn’t know what a device does it will simply ignore it. There’s no Windows Update to grab them for you.

Clover and Unibeast does a Hell of a job packaging all the essentials in to your USB key, but especially for this laptop there are some missing essentials. Most notably, the keyboard and trackpad won’t work, which can make things slightly problematic.

The following are the kexts I have successfully added and used with my installation:

Instead of installing them on the system, I opted (and is not recommended) to install them into Clover. Clover will inject these on boot, so you never need to install them in Mac and risk update breakage. The big downside however is that you risk breaking the boot process, which can make things tricky to resolve. My personal approach is to try riskier kexts on the USB Clover first, and if successful I then copy them to the HD Clover. You can also tell Clover to boot without these kexts, but this may leave FakeSMC behind and refuse to boot.

If you wish to install kexts to Clover, then grab this utility to mount your EFI partition. Then you can whack your additional kext files into CLOVER > kexts > Other. Clover will then inject these into the boot process.

My Macintosh HD EFI layout

Boot via Hard Drive

If you haven’t already got frustrated about needing to boot via USB, then your patience knows no bounds. However, you can set up Clover to reside on your main hard drive EFI partition rather than just the USB drive.

Personally, if you can do so I would recommend either leaving the USB drive as it is or taking an image backup after successfully being able to boot via Hard Drive. The reason being is that you can use this memory stick as a rescue device, and boot your laptop again in case a faulty configuration or a software update kills the boot process. 

In the quick steps you would have a copy of Multibeast if followed to the letter. You can use this to modify your Hackintosh configuration, and one of the major features is the ability to install Clover on the working drive.

In Multibeast, click on Bootloader, and then Clover UEFI (Legacy if you did not enable UEFI). Then click build. Once finished, your EFI partition on your main disk will have its own bootable Clover. Don’t stop just yet though.

Plug in your bootable USB Installer drive and use the EFI Mounter utility to mount the EFI partition on your USB drive. Grab both the config.plist you select on boot and all the kexts from ‘Other’. Now eject the USB Drive, and run the utility again to mount the EFI partition of your hard drive. Simply copy these files to the same places they were at on your USB drive.

So far, on each boot up I currently go into Config and change the config selection. There are ways to modify the main config to boot straight into macOS, however all my config file modifications ended in disaster, so I’ve kept it operating this way.

Personal Verdict

Hackintosh deserves a new name. While originally it was a small list of supported machines, today the amount of eligible machines is insane. As long as the system remains stable to use, then I would absolutely continue to use macOS as my primary. 

If you have a spare laptop and technical expertise, I would totally recommend trying it out. The experience is rewarding, and slightly baffling at the same time. Nothing is weirder than seeing the macOS login appear without the use of virtualization technology.

Last Changed: 25th April 2020 (now tracked elsewhere).