345 points · by pram · 4y ago · 201 comments
The value in this is not as much that "it is possible" because there are plenty of implementations of this possibility, but it's more about the vendor-native support, vendor-native documentation and examples and the signal it gives about the current state of support.
In the wild, an end-user (that includes developers, it's not a derogatory term, it simply mens the person the product is intended to be used by) might see applications like UTM, Veertu, Q and others use this under the hood.
VirtualBox doesn't work on ARM by the way, they only release for x86(_64). So it can only virtualise, and only on x86 hosts for x86 guests.
Because VirtualBox is not a CPU emulator, unlike QEMU, MAME/MESS, and other emulators. Virtualization software such as Fusion and Parallels run VMs of operating systems that match the architecture of the host OS. Intel VMs like those in VirtualBox will not run on Apple Silicon, and Apple Silicon VMs won't run on Intel. The CPU instruction sets are not compatible, nor can Rosetta 2 solve this.
But an OS is arguably a tool used to run architecture compatible software, and much software will compile on different architecture platforms, so while it may not be possible to run VirtualBox on Apple Silicon, it may be possible to recompile whatever software is running on the virtual OS to native Apple Silicon. This is true for 10s of thousands of ports managed by MacPorts and much of the code available on GitHub, but it probably isn't true for proprietary software where the source code is unavailable.
But both VMWare and Parallels for example have made ARM on ARM virtualisation releases of their existing x86 on x86 products.
So if you need something like a sandbox or IR workstation, you can have plenty of virtual environments, just not with VirtualBox as supporting software and type 2 hypervisor.
Right, but the VMs themselves are not cross platform. ARM Linux won't work in Intel VMWare, and x86 Linux won't work in ARM VMWare. I am sure you knew, or course, but as you pointed out there is confusion below about VirtualBox working on Apple Silicon.
Having since learned that they are open source I think I'll look into UTM again, but even as a novice I didn't find it too difficult to use libvirt.
Virtualizing OpenCore and x86 macOS on Apple Silicon (and even iOS!) https://khronokernel.github.io/apple/silicon/2021/01/17/QEMU...
Run Tiger, Leopard, or any Mac OS X PowerPC version on M1 https://tinyapps.org/docs/tiger-on-m1.html
I can say that documentation (and examples) are quite nice and easy to follow, I managed to start Linux VM with Rosetta support, and SSH, in 1-2 hours.
Geekbench numbers were quite close when running in VM (via Rosetta) and natively, they were only a few percentages slower in VM, so it stands to reason that computation heavy workload would run great.
However, using development tools regularly resulted in segmentation fault or crashing for other reasons (e.g. when doing `npm install`). I didn't dig deeper to figure out what are the reasons for this.
Additionally, real-world (from developer's point-of-view) workloads such as running web servers, building software, or running tests, were quite slow compared to running in an ARM VM.
I ran x86_64 geekbench in a Linux/aarch64 VM using both Rosetta and QEMU binfmt_misc support and found that Rosetta outperformed QEMU by about 3x. The extra speed is welcome, but I do hope that all the dirty tricks Rosetta uses are eventually able to be used by both non-apple implementations of x86_64 emulation and on non-apple ARM CPUs.
https://en.wikipedia.org/wiki/Binfmt_misc
(To be clear, this is for running Linux x86 inside Linux arm64 VMs on an Apple Silicon host)
This is pretty exciting, and appears to be a macOS answer to libvirt
Running Intel Binaries in Linux VMs with Rosetta
https://developer.apple.com/documentation/virtualization/run...
I’ve long thought it would be interesting to release Linux native apps in this sort of wrapper to the App Store.
Why the "scare quotes"? Sounds totally justifiable. Third party kernel extensions have always have had issues with both security and stability.
As far as I can tell, nobody has made a third party virtualization solution for Apple silicon nor is anyone really looking to do so. I don't think this conclusion is particularly surprising.
To be clear, I don't believe there is anything wrong with Apple offering built-in OS API solution for applications like firewall, virtualisation, graphic engines etc. The problem is when they say you can only use those and don't allow competition.
When a particular type of software on macOS is forced to use just one particular API, it stunts all such softwares using the APIS as they can't really offer any major distinction and can only offer the limited features the API provides. Worse still is when such practices is actually meant to restrict competition to protect their business interest. For example, it is clear that Apple is pivoting more and more into commercialising user privacy (monetised through its services) and advertising (by data mining personal data through these same services). In such a case, existing softwares that offer privacy protections (like application firewalls and even alternate operating systems on macs) are examples of competing system softwares that impede this goal. Obviously Apple cannot directly ban these softwares without negative user backlash. But it can ensure that such softwares are crippled by forcing users to use limited API's and / or by limiting the operating environment they run on. (The frog is slowly boiling - https://en.wikipedia.org/wiki/Boiling_frog - and we developers and users are slowly losing more a more control over our Apple computers and device).
It's testing that's the problem really, where you really need the hardware.
I think UTM's arm64-macos guest support on arm64-macos12 hosts already use the macOS virtualization framework? Or is it hypervisor framework? Either way performance is very good.
We’ve been using it experimentally to run an ephemeral instance of Firefox that we can programmatically inject DNS and CA certs into, for localhost HTTPS development. It’s not documented yet, but the config is here: https://github.com/drifting-in-space/plane/pull/201
Mac and Windows frequently perform non-consensual changes to my workstation. On the other hand, GNU/Linux is challenging for me to get working 100% on bare metal.
This setup is reasonably fast for my work, which is mostly text editing.
This is indeed cool, but RAM on Apple Silicon is relatively low (with only 8Gb in some models) if I allocate more than 2Gb to a VM, the base desktop will struggle.
Or if this was a push to release the Linux support.
Supporting the native GPU would mean they would have to get the guests to update for each new GPU. I'm sure Apple loves the idea they could completely rearchitect their GPU for future Apple Silicon, and it would break no preexisting macOS/iOS software
If only you could use a real window manager in OS X....
The switch also dramatically reduced developer time spent solving Mac/Linux incompatibilities in tooling, and let us focus more on our product. Overall we accelerated development by about one day, per developer, per week. I was kind of surprised it was that much time, but looking back, there really are quite a few differences between the GNU userspace and MacOS.
This is why GNU/XNU OS distros should be a thing. I think this would satisfy most that want a fully functional "Linux" on Apple Silicon, being in its entirety OSS plus the ability to gain a fully compliant UNIX specification in stride, at least in practice if not actually registered.
I have to ask: you accelerate development by 1 day/week, but do your devs lose any time with the accumulation of tiny annoyance such as sorting out bluetooth/audio/hibernation/battery drain?
No. All of the above have been fine - save hibernate. Standard kit is a multidevice logitech bluetooth keyboard and mouse... no issues. A couple of the devs on my team use bluetooth headsets, and that too is no problem. The LG Gram gets about 16-19 hours on a battery, so we've not had drain issues. Audio hasn't been a problem. We did have issues with hibernation when we switched, and solved it by disabling hibernate, and setting the machine to sleep when the lid shuts. I've left my laptop in the bag, sleeping all weekend and had 70% battery on Monday morning. Incidentally, the battery is really not critical... 65W USB3 chargers are cheap so we mostly run plugged in.
Your mileage may vary. Incidentally, LG is making a great machine right now. Huge 17" display, metal case, keyboard has a numeric keypad, great battery life, and it weighs 1 oz more than a 13" Macbook Pro. Oh, and lots of ports.
I’d love to hear of a counter example. Use case is close it and stick it in my bag most nights, leave it plugged in and suspended others.
Acceptance criteria: < 5% battery drain per day suspended. Zero wakeups in bag, less than one failed resume from suspend per year (> 99.9% resume reliability). After resume, network / vpn reconnects without intervention in under 10 seconds, and no apps are janky.
Bonus: pressing the power button once when it is off must cause an led or screen to turn on within 1 second every single time.
It's been mostly painless for me, minus the usual audio/Bluetooth snafu. Even those don't happen enough for me to be too concerned.
For Kubernetes, I use Rancher Desktop (which can also do some docker magic)
Is it THAT much more convenient to do everything in a VM?
For example, there will not be an ARM version of Boot Camp published by Apple. If you want to run Windows on an Apple Silicon Mac, it'll likely be running virtualized under macOS or in an emulator under macOS.
If someone wants to write a bunch of drivers and hack a boot loader to get windows running natively - Apple won't stop them, but thats a heck of a lot of work.
Huh? It's actually faster than ever, and near native experience.
And the post is not about "how to run" a virtual machine as an end user or dev (for that the way the parent describes is still the suggested way).
It's about how to program running it under the hood if you're a developer who wants to develop something like a program that manages virtual machines or that hosts and runs one.
https://mkyong.com/mac/virtualbox-running-slow-and-lag-on-ma...
as well as others suggested on the VirtualBox forums, but couldn't get it running smoothly. I didn't have any trouble with a similar setup several years ago.
Has somebody already done that perhaps? Is there a reasonable alternative to VirtualBox/WMWare using the optimal way to run a VM on a Mac? I don't mind paying if it's worth it.
I have zero experience of Mac development but I am going to need to run Windows 7 (to use IE6 with old crypto to access an outdated state-ran system) on an M2 MacBook next week. What's the best way to achieve that?
previously: https://news.ycombinator.com/item?id=28430196
Given that they focus on units of apps rather than of system containers, I would _suspect_ it would be low priority to support a libcontainer API.
Are you actually wanting a Darwin BSD container layer, or just a more efficient way to run Linux containers?
Previously, the bar was at the firmware level, where you will never fully control the black boxes governing the security chips, DRM implementations and real time OSes running on the microcontrollers inside the CPU.
Now the OS (especially on Apple devices) is almost becoming like the firmware layer itself, so deeply integrated and locked to the machine, but with the freedom to run other OSes/environments on top.
At least you can (usually) still unlock the OS level...
curl-7.81.0$ ./configure --help | grep -i apple
--with-secure-transport enable Apple OS native SSL/TLS
MSFT is adding new signing keys to build and boot Ubuntu. Perhaps Apple wants to play, too and add their own signing keys to build and boot linux, openssl and libssh.Let no crucial technology fall into the hands of the un-corporate?
While there is demand for the latter (as demonstrated by the herculean efforts going into Asahi Linux), most people buying Macs are probably there at least partially for macOS and the ecosystem it fits into, as well as for the ability to run commercial software packages without a compatibility layer like WINE. All things considered it's probably generally easier to make headless Linux containers run acceptably on non-Linux hosts than it is to get complex UI software running acceptably under WINE or a Windows VM.
When I spent some time and installed Linux on my MacBook Pro 2015 some people came asking for instructions (and were mostly deterred by the compiling needed to build a driver for the webcam).
Macbooks are unrivaled for their hardware (pretty much any other laptop sucks), the software is meh and keeps getting worse.
You can also run FreeBSD: https://dan.langille.org/2018/10/02/running-freebsd-on-osx-u...
Like there are options for containers, it is great to have another option for virtual machines.
In macOS itself the main goal is to get third parties out of the kernel to the greatest extent possible, which makes perfect sense. Third parties, ideally, should be operating solely in userland, because otherwise you get pointlessly insecure nonsense like cloud file storage apps installing kernel extensions (like Dropbox used to on macOS).
You keep implying that there are ulterior motives without a shred of justification. Why do you think that? What power do they get by doing this?
Also, it does not prevent things like Little Snitch or the various Objective See tools from being developed. There are no fewer firewall apps than there used to be. There are no fewer virtualisation applications either.
What you don’t get is that they started from the position that kernel extensions were an attack vector and a factor of instability. Then, they started addressing each use case for kernel extensions by providing user-level facilities. You probably set the cursor at a different location on the security spectrum, but it does not mean that you are any more right than they are.
> They are slowly squeezing macOS to make it more and more like ios.
Some people have been making that tired claim for more than a decade now. You’be had year to see how it works and where they are going, and it keeps not happening. Why do you think this is more credible now?
I think the better argument is that it is what Apple says it's about, security. For the same reasons, we don't see Windows source code, nor are internally discovered Linux kernel security bugs advertised until they're fixed.
I personally consider security bugs to be just "normal bugs". I don't cover them up, but I also don't have any reason what-so-ever to think it's a good idea to track them and announce them as something special...one reason I refuse to bother with the whole security circus is that I think it glorifies—and thus encourages—the wrong behavior. It makes "heroes" out of security people, as if the people who don't just fix normal bugs aren't as important. In fact, all the boring normal bugs are way more important, just because there's[sic] a lot more of them. I don't think some spectacular security hole should be glorified or cared about as being any more "special" than a random spectacular crash due to bad locking. -Linus Torvalds, 2008
Instead of rolling over and vulnerably showing soft underbelly, armadillos fold in half, tuck in their legs and head, curling their tail beside the head and pull in tight, so that only their leathery armor shell is exposed. If they did what you wanted them to do, their species wouldn't exist for very long.