
Push-Button Installer of macOS Guests in VirtualBox for Windows, Linux, macOS - miles
https://github.com/myspaghetti/macos-virtualbox
======
DiabloD3
I'm going to make one of those unpopular opinions, but alas, it must be said:
It is far easier to just drop Apple support entirely.

Apple is an abusive relationship that gaslights developers for "holding it
wrong". Many of you have internalized this abuse. Supporting OSX and iOS does
not really win you many users, and if you're big enough where this really is
an issue, then you can just afford a stand alone Mac who's job is to compile
and test your app.

Apple does not care about small developers, and countless HN stories have
spent their time on the front page detailing how Apple has shut apps off for
not violating terms, and having zero recourse over this. By doing so, Apple
has slandered many members of the HN community.

I am not saying other companies are not also guilty of it (Google seems to
have recently learned there are no penalties for this, largely because Apple
has never been penalized), but more and more people really are just dropping
Apple and never going back.

If Apple truly cared about app development on their platform(s), they would
just port their stuff to Windows and Linux, just like Microsoft did to OSX and
Linux.

~~~
29athrowaway
Pro: iOS users monetize more than Android.

Con: Pushing updates to an iOS app is a pain (review process).

~~~
an_opabinia
In my experience they monetize like 500% better than Android users.

Not supporting iOS users is just baffling.

They're rich people plain and simple. They can afford $800 iPhones or $1,800
phone + iPad combos, to people who need to buy $200 Android devices.

Maybe I've been gaslit. But just don't push buggy updates. QA is not hard.
Update all the time is a symptom of test-driven development, of affectless
people who never use the software they make and look at their job description
as, "cram algorithms questions, output git commits." The kind term for the
right approach called "product oriented."

~~~
jolux
Test-driven development is a weird thing to blame for low quality.

~~~
zdragnar
There is certainly a false sense of security in test-only approaches. You only
have tests for what you expect to go wrong, so every wrong assumption you make
becomes a bug. Dedicated QA can help catch these, and are practically a
requirement if your customers aren't content with things randomly breaking.

My previous job was just that... one QA person for a 50ish person team,
focusing only on writing user acceptance tests. The leads thought that if we
just had enough coverage, we could deploy continually without needing QA
reviews, and were continually surprised at the number of bugs getting through.

That isnt to say that automated testing is bad, but rather that it is easy to
be over-confident in what it will do for you.

~~~
derrick_jensen
Google Play allows for different "tracks" for publication: internal testing,
closed alpha, closed/open beta, and production.

My approach is to keep releases in sync with Git branches (master is to
production, staging is to closed alpha, etc). Although I don't often push
things to master, I publish on any of these tracks at least once a day. I'm
looking into the Apple ecosystem now, so I'm not sure if I can use a similar
approach (my main concern is having a Mac as CI server).

~~~
thinkmassive
If you already happen to be running Jenkins you can run an agent on the Mac
and tag iOS builds to always run there. I’ve had decent experience with that
approach, using Fastlane to build/upload different releases based on git
branch like you describe.

Keep in mind you’ll need a graphical connection for occasional updates, which
is likely different from the rest of the build system. You may also need it to
fetch an Apple 2FA code every 30 days, that’s used to refresh your token to
upload releases to App Store Connect.

------
AegirLeet
I recently wanted to test something on macOS, but I don't own a Mac. I kinda
assumed that I could just type "macos vm image" into Google and download an
official image for VMWare, VirtualBox, Hyper-V or whatever from Apple's
website. Nope.

Instead, I ended up reading through several third-party guides, downloading
images from random people's Google Drives and feeding magic incantations to
VBoxManage - only to end up with a slow, crashy, barely functional system. Of
course, the thing I originally wanted to test wasn't working at all,
because... who knows.

I'm really amazed at how shitty Apple's developer experience is for people who
don't own a Mac. Well, I'm going to give this script a try tomorrow - maybe
that will work, somehow.

~~~
logicuce
Apple is not alone there. A lot of people don't realize, but Windows is (or at
least for the longest time, was) in the same boat. You need to have a Windows
machine to build Windows app.

I believe, but I might be wrong, a similar thing applies to a large number of
Linux systems especially if you wish to build GUI apps.

P.S. Windows even used to require a paid version of their IDE Visual Studio
for the longest time and a hefty subscription fee for MSDN. And, don't forget
the concept of "Developer License" for things like SQL server.

~~~
AegirLeet
Yeah no, this one is very Apple-specific. Just google "windows 10 vm image"
and see what comes up. Obviously with Linux distros, getting images isn't a
problem either.

I'm sure there's some dumb shit that MS does too, but Apple is completely
alone in not even giving you any way to run their OS in a VM for development
purposes.

~~~
lavezza
As others have pointed out, those official MS VMs are for evaluation only. You
are not legally allowed to use them for development. Of course, you could pay
MS for a license and do your Windows development in a VM on Linux (or Mac), so
that is something that MS supports that Apple doesn't. But to develop for
Windows or Mac/iOS you will most likely need to give some money to MS or
Apple.

~~~
AegirLeet
This was non-commercial and there wasn't any development involved. Even if
doing this in a Windows VM technically violated some license, I wouldn't care
much for something that's just a hobby project.

As you pointed out, with Windows there's at least no technical barrier to
running it in the VM. Even if I had to buy a license, that would be like a
hundred times cheaper than buying a Mac.

------
TheDong
This is likely illegal. The psystar case[0] was a very clear ruling that
attempts to circumvent apple's restrictions on hardware are a violation of the
DMCA.

Apple checks a certain devicekey while booting, so that key is an anti-
circumvention techniques. Any use of that string in a form where apple's
software may read it is probably a violation of the DMCA. This script uses
that string[1] in order to circumvent apple's checks, and thus is legally
dubious at best.

There are numerous other likely DMCA violations as well, from copying GUIDs
with the intent to circumvent checks to downloading copyrighted material from
apple's servers which they only give you license to download for an actual mac
machine.

[0]:
[https://en.wikipedia.org/wiki/Psystar_Corporation#Legal_issu...](https://en.wikipedia.org/wiki/Psystar_Corporation#Legal_issues)

[1]: [https://github.com/myspaghetti/macos-
virtualbox/blob/44a21f7...](https://github.com/myspaghetti/macos-
virtualbox/blob/44a21f7aa598f92efd606148c0581b49891ed2f3/macos-guest-
virtualbox.sh#L773-L775)

~~~
boudin
This is definitely not legal, but the fact that the apple ecosysten is still
stuck in the pre-vm era in 2020 for the purely stupid business model of
jailling developers in an apple ecosystem as soon as they need to create an
ios app (which should never require an apple computer in the first place) is
an absolute ridiculous waste of time and resources.

Any company that deals with cross platform products has to build a modern
CI/CD and a medieval stuff on the side to deal with apple.

Sorry for the rant, just had to get this out.

~~~
tinus_hn
I think you can run Mac OS in a VM as long as the VM runs on Apple hardware.

~~~
p_l
The problem is that there is no way to run proper infrastructure that involves
Macs since removal of Xserve platform, and even that wasn't particularly great
when it came to lights out operation from what I heard.

Even if you pay ridiculous amounts of money for latest Mac Pro in a rack, it's
stil the kind of joke machine that I chortled over in 2008 for being the cause
for crash carts to be present in server room, when every serious machine had
you in the comfort of nice office.

------
js2
See also [https://github.com/kholia/OSX-KVM](https://github.com/kholia/OSX-
KVM)

~~~
PaulDavisThe1st
Indeed. Helped me get Mojave running on a 8-core, 16GB Ryzen VM. No working
audio in and out (which given that I write audio software could be viewed as a
pain), but in every other way, it's the bees knees. A faster and bigger mac
than I've ever owned in physical form, with the same kbd and mouse, just
sitting over there in workspace 5. Barely even notice it running if I forget
to shut it down.

~~~
eeeeeta
fwiw, I personally got around this by using JACK (netjack server outside the
VM, netjack client inside the VM). Somewhat fiddly to set up, but works
flawlessly once it's running!

------
jchw
See also: [https://github.com/kholia/OSX-KVM](https://github.com/kholia/OSX-
KVM)

------
jlgaddis
PSA: On Windows, this script downloads and runs an .exe files which is
(contained within a .zip file which is) downloaded via unencrypted HTTP; cf.
~L306.

------
Reubend
Wow, great work! I'm reading through the script's source right now to learn
about how it works.

------
enriquto
This is a godsend! I'm using it and it works perfectly, especially with
headless mode (once you have setup ssh).

Gone are the sad days of asking my mac-using colleague to pip install my shit
and send me back the error messages. Now I can test it myself like a civilized
person.

------
zelienople
Wow, that script so does not work under MacOS!

The first hurdle is that it errs out on the bash version. Yes, yes, I know,
Apple supplies v3.x something and you have to upgrade to v4.x something or
higher. But when I upgraded using 'brew install bash' I got to v5.x something.
Voila, the script still thinks we're in the wrong version.

The path is good, the test, run manually in the terminal, is good, the script
looks good, but still fails. Not sure why.

Never mind, I modified the script to remove the 'exit' on wrong bash version,
and all was well until the install crashed with an utterly incomprehensible
"./macos-guest-virtualbox.sh: line 1400: -: syntax error: operand expected
(error token is "-")"

Line 1400 is the end of some very obscure keyboard scancodes. No idea where to
go with that.

When I manually formatted a virtual drive GUID and Mac OS Extended
(journaled), the install inside the VM failed with some cryptic Mac error.

Fortunately, after a reboot, the Catalina installation seemed to proceed
without problems and I achieved a working system. So, yay!

------
ridiculous_fish
Apple really should make it easier to test on old versions of macOS. I
recently had to track down a compile error on 10.9 [1] and it is not easy to
get these old OSes working: there's dead links, expired certificates, etc.
Hours wasted.

1: [https://github.com/fish-shell/fish-
shell/issues/7023](https://github.com/fish-shell/fish-shell/issues/7023)

~~~
saagarjha
I am and will remain forever salty that Apple provides me with no way to
download the copy of OS X Mountain Lion that _I paid for_. I don’t actually
need it for anything right now, but it rubs me the wrong way that there is a
gap between where you have physical disk and it’s still downloadable on the
App Store, and you could have paid for the OS but can no longer access it for
an old Mac if you happened to want to run it.

~~~
enriquto
I am sorry, but you mac users had it coming. You have been enabling apple's
callous behavior for many years. In the case of developers it is even worse,
for this callousness has been always public, but you just didn't care (until
it affected you personally in some way, as it seems to be the case).

~~~
jeroenhd
I think you're making your point to the wrong person here. There's a lot of
people inside the macOS ecosystem that continue to defend their bullshit but
the parent seems angry that the purchasing decision he made when Apple was
actually kind of good has been made useless by the change Apple has made over
the last years.

Not all macOS users are the same and it's preposterous to call out "you mac
users" as if they are one group.

------
lloeki
Interestingly enough I’ve built the same kind of script for macOS up to and
including Sierra (sans OpenCore, as I stopped when VirtualBox’s EFI stopped to
cater for alternate boot.efi paths that are required for macOS install/update)

The goal was to have some GitLab CI runners For ArchMac.

The CI situation for macOS is just ridiculous and completely iOS focused:

\- GitHub Actions has 10.15 only

\- Azure Pipelines now has 10.14 and 10.15 only. At some point 10.14 was
available only as macos-latest, which became 10.15 overnight with no way to
lock.

\- Travis CI older images don’t even boot as they fail to install or downright
fetch home brew as an uncontrollable step. Newer images work but are slow as
hell.

\- CircleCI is the one that fares the best: fast, wide version support. The
pricing has recently been revised and the previously free open source tier
(that you had to manually request via support) is too limited in time for a
mildly active project.

------
eitland
I got an iPad last summer and that made me dare to switch to iPhone last fall.
I like both a lot.

Recently I found out that iMusic is available outside of the Apple ecosystem
as well.

I wonder if Apple will - sooner or later - start targeting Windows and Linux
with the rest of their software as well? (I know I can read and edit iCloud
files online but I am thinking of native apps.)

~~~
tonyedgecombe
Where it supports their services business (iTunes for Windows has existed for
a long time) or hardware (my AirPort Time Capsule has Windows support).
Otherwise why would they?

~~~
eitland
> Otherwise why would they?

Because it could bring more sweet recurring iCloud income without the hassle
of creating hardware for every niche there is.

~~~
tonyedgecombe
Well I did say where it supports their services

~~~
eitland
You did.

------
strogonoff
What's the easiest (and cheapest, price and disk space wise) way to do the
opposite: install Windows/Linux on macOS for software testing purposes?

Might have to build Electron apps on it, I assume on Windows that excludes
Home editions…

~~~
tridentlead
You can just download a Windows 10 Dev environment VM direct from Microsoft.
Also, Windows home will work just fine for any sort of development not
requiring Hyper-V.

------
zxcb1
Does it work under Fusion too?

~~~
jlgaddis
According to VMware [0]:

> _You can install Mac OS X, OS X, or macOS in a virtual machine. Fusion
> creates the virtual machine, opens the operating system installation
> assistant, and installs VMware Tools. VMware Tools loads the drivers
> required to optimize a virtual machine 's performance._

Additionally [1]:

> _You can use the recovery partition on your Mac to create virtual machines
> running macOS._

\---

[0]: [https://docs.vmware.com/en/VMware-
Fusion/11/com.vmware.fusio...](https://docs.vmware.com/en/VMware-
Fusion/11/com.vmware.fusion.using.doc/GUID-474FC78E-4E77-42B7-A1C6-12C2F378C5B9.html)

[1]: [https://docs.vmware.com/en/VMware-
Fusion/11/com.vmware.fusio...](https://docs.vmware.com/en/VMware-
Fusion/11/com.vmware.fusion.using.doc/GUID-E6C50392-31BA-4466-9A2E-D133B48C0E8A.html)

------
rick_e
Cloning for “research”

~~~
AbraKdabra
Doing the same, my girlfriend told me to tell her what font is being used in
that image, gotta research it further.

~~~
bransonf
I know you're probably being sarcastic, but Apple uses their own San Francisco
Font throughout the OS [0]. It's personally one of my favorite fonts, though
Apple has full rights. Some typographers allege that Roboto is fairly close.

[0] [https://developer.apple.com/fonts/](https://developer.apple.com/fonts/)

~~~
saagarjha
Try Inter, it’s much closer.

------
StavrosK
This is going to be pretty slow, isn't it? There was a script here a few weeks
ago that ran OS X in QEMU, I think that was supposed to be rather faster.

