TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

LXD containers on macOS at near-native speeds

298 pointsby pickleMeTimbersover 2 years ago

17 comments

st3fanover 2 years ago
This is part of the bigger Macpine project, which to me is much more interesting than LXD: <a href="https:&#x2F;&#x2F;github.com&#x2F;beringresearch&#x2F;macpine" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;beringresearch&#x2F;macpine</a><p>&quot;&quot;&quot; The goal of this project is to enable MacOS users to:<p>Easily spin up and manage lightweight Alpine Linux environments. Use tiny VMs to take advantage of containerisation technologies, including LXD and Docker. Build and test software on x86_64 and aarch64 systems &quot;&quot;&quot;
评论 #33766383 未加载
dchukover 2 years ago
So is there some canonical guide to running a docker compose style app on Mac m1 machines that has good filesystem performance? It seems like there’s many ways to approach the topic now so it’s hard to tell which one is “winning”.<p>I’d love to containerize all of my local development efforts (scripts and rails apps) but the slow ass filesystem always ruined it in the past.
评论 #33764528 未加载
评论 #33764795 未加载
评论 #33766846 未加载
评论 #33764258 未加载
评论 #33769326 未加载
评论 #33775629 未加载
评论 #33764387 未加载
jsjohnstover 2 years ago
This is cool and a worthwhile thing, but how is this different than the many (b&#x2F;x)hyve clones and others based on QEMU that use MacOS’s virtualization framework to run a minimal Linux for containers? What’s the differentiator that makes this better (hopefully?) from what’s come before?
评论 #33764826 未加载
loloquwowndueoover 2 years ago
Keep in mind lxd can manage two types of “containers” these days - the traditional cgroup-based kind that runs as its own set of processes on top of the hosts kernel with isolation, and traditional qemu-backed virtual machines. The user experience is homogeneous but the backing engines are different as noted here.
estover 2 years ago
&gt; Prerequisites Install QEMU<p>So in other words, qemu runs at near-native speeds?
评论 #33763060 未加载
评论 #33763467 未加载
评论 #33763056 未加载
评论 #33763098 未加载
barefegover 2 years ago
I like the progress that is being made for running containerized workloads on macOS. In my case I like some of the benefits of running the workload on a remote machine; such as no fan noise, less heat, less power consumption (especially on laptops). However the downsides can be also quite annoying, such as file sync times or IDE input lag.<p>My current setup is to have both data and workload run on a remote machine and I connect to it via SSH. I can either run neovim inside or use the remote development plugin from VSCode. But as mentioned, the input lag can be very annoying. I’m wondering if there’s another setup where I can still retain some of the upsides of running the workloads remotely and still having a decent user experience (reduced lag)
评论 #33767507 未加载
评论 #33774305 未加载
评论 #33764067 未加载
评论 #33769975 未加载
pxcover 2 years ago
At first, I thought this was based on a syscall compatibility layer like Solaris&#x27; Linux Zones or WSL1 (RIP), or the Linux support in FreeBSD and NetBSD.<p>If you&#x27;ve ever tried to spin up a whole bunch of Docker containers in WSL2 and watched `vmmem` memory and CPU usage explode, you know that &#x27;near-native speed&#x27; in VMs comes with lots of asterisks.<p>Does macOS have usable native <i>macOS</i> containers yet?
评论 #33768574 未加载
miohtamaover 2 years ago
This is good news.<p>I come from the development background and the number one use case of containers on macOS is development enviroments, as on Windows too. For this use case, file system IO has always been bottleneck, not CPU. I do not know if there is some silver bullet in the horizon that could make this faster.
评论 #33764287 未加载
评论 #33762968 未加载
ColChover 2 years ago
It uses almost same mounting tech as colima (9p)<p>Macpine: <a href="https:&#x2F;&#x2F;github.com&#x2F;beringresearch&#x2F;macpine&#x2F;blob&#x2F;71788e9c3c09cd11383885e4f8dd836ca34f0f8a&#x2F;qemu&#x2F;ops.go#L247" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;beringresearch&#x2F;macpine&#x2F;blob&#x2F;71788e9c3c09c...</a><p>colima: <a href="https:&#x2F;&#x2F;github.com&#x2F;abiosoft&#x2F;colima&#x2F;blob&#x2F;7ebcf14a69158afa43b23c4a5fd7c0b39122c1a2&#x2F;embedded&#x2F;defaults&#x2F;colima.yaml#L97" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;abiosoft&#x2F;colima&#x2F;blob&#x2F;7ebcf14a69158afa43b2...</a><p>So it seems that it has same performance as colima project as well.<p>As for IO performance, see this colima issue <a href="https:&#x2F;&#x2F;github.com&#x2F;abiosoft&#x2F;colima&#x2F;issues&#x2F;146#issuecomment-1025392658" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;abiosoft&#x2F;colima&#x2F;issues&#x2F;146#issuecomment-1...</a>
ameliusover 2 years ago
I experimented with LXD containers on Linux recently, but I found the technology it builds on (cgroups) too hard to wrap my head around, and tutorials leave me in the dark.<p>E.g. here is page 2 of one tutorial: <a href="https:&#x2F;&#x2F;access.redhat.com&#x2F;documentation&#x2F;en-us&#x2F;red_hat_enterprise_linux&#x2F;6&#x2F;html&#x2F;resource_management_guide&#x2F;sec-relationships_between_subsystems_hierarchies_control_groups_and_tasks" rel="nofollow">https:&#x2F;&#x2F;access.redhat.com&#x2F;documentation&#x2F;en-us&#x2F;red_hat_enterp...</a><p>All these rules made no sense to me, and while I suppose they become clear at some point, I like my tutorials to be clear from the start.
评论 #33763072 未加载
评论 #33763061 未加载
jbverschoorover 2 years ago
Too bad almost all containers rely on bridged networking and different ports. Why not just bind to 127.0.x.y, where x is the project number, and y is the machine number. That way, you can just use default ports
评论 #33767018 未加载
评论 #33767654 未加载
rifficover 2 years ago
would be nice to have macOS &#x2F; Darwin kernel-native containers though.
alexklarjrover 2 years ago
IDK what lightweight about virtualisation that takes at least 30% of cpu performance for context switching. And much more on io.
ryanmccullaghover 2 years ago
Does QEMU emulate the CPU on macOS?
评论 #33763217 未加载
评论 #33764352 未加载
myuzioover 2 years ago
&gt; Containers at near-native speeds<p>Wow, I&#x27;m dying to see how it works!<p>&gt; brew install qemu<p>:|
mistrial9over 2 years ago
this is so .. exciting! .. however please recall that you the user are now using hardware that is remotely run in most cases by the OS vendor (and who-knows-what-else), with opaque code executing at multiple layers.
评论 #33764909 未加载
kaku1019over 2 years ago
Does QEMU emulate the CPU on macOS?
评论 #33764047 未加载