Live data from Hacker News

How fast is a macOS VM, and how small could it be?

eclecticlight.co

81–90 of 111 posts

Re: How fast is a macOS VM, and how small could it be?

#81
post #76

Earlier quoted context omitted.

You can boot into macOS with QEMU, but you won't have hardware-accelerated graphics or a handful of other features.

Which features? Apple Pay?

That requires the Secure Enclave, so I suspect that’s one of them.

Re: How fast is a macOS VM, and how small could it be?

#82
post #40
post #2

I'm wondering if the Xcode simulator (without Xcode running) performs as well, my 2020 Intel MacBook Air has been incapable of running Safari in iOS smoothly for nearly all its life.

Macbook Neo should run rings around any Intel Air: Geekbench shows it at 250% the score of 2020 Intel Air. https://browser.geekbench.com/v6/cpu/compare/17022784?baseli...

My M1 Air, which was my personal Mac, generally stomped my work MBP 2019 with an Intel chip.

The difference between the absolutely silent M1 and the hairdryer Intel was staggering.

I’m sure you’re completely right.

Re: How fast is a macOS VM, and how small could it be?

#83

Earlier quoted context omitted.

OrbStack is impressive on the performance and energy efficiency fronts. I'm not aware of anything that comes close. But they're doing something funky under the covers. You can't just start any OS in a VM. It has to be somehow mangled to suit their VM. Thankfully NixOS is available so I'm fine for my use cases. It's still remarkable how efficient it is.

Yeah, it's like WSL. It starts just one VM and then your individual "machines" are LXC containers underneath. If you peek at the vendor-supplied file your NixOS OrbStack Machine includes you can see some of it. They're constantly doing other optimizations in other ways, too. But that's the one you were pointing at, I think.

That's also what Colima does.

OrbStack isn't open-source though and I can't justify buying a license for every single person in my company just for something functionally equivalent but performing better.

These kinds of things should just be provided by Apple as a first-class thing.

Re: How fast is a macOS VM, and how small could it be?

#85

My only experience with VMs on macOS is colima+docker, and it's relatively painful and inefficient (but usable).

Try Apple's container CLI. I moved a project of mine from colima+docker to it relatively easily, a couple of weekends ago. https://github.com/apple/container

AFAIK no support for Compose though

Re: How fast is a macOS VM, and how small could it be?

#86
post #7

>Starting with 4 virtual cores and 8 GB vRAM, where the VM ran perfectly briskly with around 5 GB of memory used, I stepped down to 3 cores and 6 GB, to discover that memory usage fell to 3.9 GB and everything worked well. With just 2 cores and 4 GB of memory only 3.1 GB of that was used, and the VM continued to handle those lightweight tasks normally. Good reminder that there's a certain amount of memory tied up wit…

As a general rule, also the amount of physical memory installed in a computer should be proportional with the number of hardware threads provided by its CPU. Besides the fact that the operating system may allocate some memory for each thread, when you launch a multi-threaded application that is able to use all available threads, for instance the compilation of a big software project, it frequently will allocate some…

It's an important point. I went from 4c/8t and 32GB to 16/32 and 96GB. Dramatically less memory per thread. Some software (looking at you, Vivado) can take incredible amounts of memory per parallel job thus mandating some projects can only run with a subset of my cores. At least until I stepped up my work laptop to 10.66 GB/thread. That seems to be manageable

Re: How fast is a macOS VM, and how small could it be?

#87

Earlier quoted context omitted.

There is some overhead per-core, you're right, but imo this reduction in usage is likely from how the kernel allocates available memory, which is being reduced as well. The kernel will keep read caches around longer with more memory, it'll prefer to compress memory instead of swap to disk if it has more, it'll purge/cleanup reclaimable memory less often with more memory, etc. It even scales its internal buffer sizes…

Single inline backticks like `this` aren't recognized (although still useful in my opinion, they just don't change the rendering). Triple backticks also aren't recognized. However, if you indent by I believe 4 spaces, it formats it in a fixed width font presuming it's code. Let's try (4 spaces): func main() { fmt.Println("Hello, HN!") } None for comparison: func main() { fmt.Println("Hello, HN!") }

Seems I missed the window to be able to edit my message, but I'll remember this info for next time, thanks!

Re: How fast is a macOS VM, and how small could it be?

#88
post #77

Earlier quoted context omitted.

Try Apple's container CLI. I moved a project of mine from colima+docker to it relatively easily, a couple of weekends ago. https://github.com/apple/container

I'm curious to know what kind of project is macOS exclusive?

You're surprised that a project by Apple Inc that is basically a wrapper around the Mac virtualisation framework [0] is Mac exclusive?

[0] https://developer.apple.com/documentation/virtualization

Re: How fast is a macOS VM, and how small could it be?

#89
post #63

Earlier quoted context omitted.

I got torch to run in a Cirruslabs Tart instance.

By "Instance" do you mean their cloud platform?

Nah, just locally on my macair.

TBF, I only got to the point that using device=mps_device didn't fail. I used Sonoma at the time and the image for the vm was ghcr.io/cirruslabs/macos-sequoia-xcode:16.2-beta-3. Python 3.12, as well, because torch didn't work with later versions.

   import torch
   mps_device = torch.device("mps")
   print('device is', mps_device)
   x = torch.ones(1, device=mps_device)
   print(x)
Post reply on HN