News for hackers. Stuff that matters.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by lysace on Thursday January 15, 2026 @01:21PM (#46636799)
Is there an easy way to do something similar for Claude Code? I'm growing tired of babysitting it to make sure it doesn't do anything bad.

Late adopter. Started last night. Stayed up four hours past my normal bedtime because I couldn't stop. (Ended up "building" a fancy .MOD player for DOS in Turbo C.)

Needed the Max 5x plan after two hours. (The 'Pro' plan should be renamed 'Sampler', made one-time and free with CC details.) Max 5x seems like it can sustain my current appetite.

I very quickly went from thinking it was overpriced (around 100 USD/month) to worrying that this pricing can't last. I think I get about 50 working hours per week with this plan. So, running the numbers I guess the hourly cost is about 50 cents.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by realityfactchex on Thursday January 15, 2026 @02:45PM (#46638121)
Isn't the easy way just a development VM? As in:

Install your OS of choice in a virtual machine, e.g. even hosted on your main machine.

Install the AI coding tool in the virtual machine.

Set up a shared folder between host+guest OS.

Only let the VM access files that are "safe" for it to access. Its own repo, in its own folder.

If you want to give the AI tool and VM internet access and tool access, just limit what it can reach to things it is allowed to go haywire on. All the internet and all OS tools are ok. But don't let this AI do "real things" on "real platforms" -- limit the scope of what it "works on" to development assets.

When deploying to staging or prod, copy/sync files out of the shared folder that the AI develops on, and run them. But check them first for subterfuge.

So, don't give the AI access to "prod" configs/files/services/secrets, or general personal/work data, etc. Manage those in other "folders" entirely, not accessible by the development VM at all.

Is that close?

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by c0balt on Thursday January 15, 2026 @03:16PM (#46638563)
Automating this setup is also somewhat easily possible with, e. G., Lima[0] or HashiCorp vagrant[1].

[0]: https://lima-vm.io/

[1]: https://developer.hashicorp.com/vagrant

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by w0m on Thursday January 15, 2026 @03:23PM (#46638685)
I'd just do it over a Docker mount (or equivalent) to keep it a bit more lightweight. Can keep the LLM running local; and teach it how to test/debug via instruction files.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by mkagenius on Thursday January 15, 2026 @08:52PM (#46642067)
Did somewhat exactly that for apple container based sandbox - Coderunner[1]. You can use it to safely execute ai generated code via an MCP at http://coderunner.local:8222

A fun fact about apple containers[2], it's more isolated than docker containers as in it doesn't share the VM across all containers.

1. https://github.com/instavm/coderunner

2. https://github.com/apple/container

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by netcoyote on Thursday January 15, 2026 @10:47PM (#46642775)
Here are my open-source (MIT) solutions for Mac development:

SandVault [0]: Run AI agents isolated in a sandboxed macOS user account

ClodPod [1]: Run AI agents isolated inside an OSX virtual machine

0: https://github.com/webcoyote/sandvault

1: https://github.com/webcoyote/clodpod

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by WA on Friday January 16, 2026 @02:54AM (#46644128)
Thanks for sharing. Which one do you use for what?
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by cyberpunk on Friday January 16, 2026 @02:59PM (#46651383)
you can also just type “docker sandbox run claude” if you have docker desktop installed (or something along those lines)

edit: it only mounts $PWD

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by linkregister on Thursday January 15, 2026 @01:44PM (#46637155)
From within VSCode, you can run devcontainers, which bind mounts the project's directory into an isolated Docker container. Safe for --dangerously-skip-permissions

https://code.visualstudio.com/docs/devcontainers/containers

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by mbreese on Thursday January 15, 2026 @02:28PM (#46637853)
As a note, running devcontainers in VSCode is easy, but not required. There is also a CLI tool that uses the same specifications.

You can install it with brew or npm.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by pwagland on Thursday January 15, 2026 @04:42PM (#46639747)
I assume that you are talking about the [devcontainers LCI](https://github.com/devcontainers/cli) when you say "a CLI"?
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by mbreese on Thursday January 15, 2026 @05:32PM (#46640354)
Yes. I probably should have included the link.

I stated using devcontainers through VSCode and find them incredibly helpful. It’s great for me to be able to load up exact coding environments on different computers. But, I only used them through VSCode.

When I wanted to branch out a bit (and especially using coding agents), I started using the CLI version more. I find devcontainers a great way to work with different coding projects and wanted to make sure people knew that there was a way to use them outside of VSCode.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by bugglebeetle on Thursday January 15, 2026 @02:46PM (#46638128)
Tried this the other day and the setup on this is super cumbersome and requires you to constantly rebuild your entire dev and Claude Code environment every time you use a new container, including whitelisting URLs for package managers and the like.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by andrewmutz on Thursday January 15, 2026 @02:49PM (#46638166)
There are techniques to mitigate this. You can reuse containers instead of creating a new one each time. You can mount in directories (like ~/.claude) from your local machine so you dont have to set claude up each time.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by raphinou on Thursday January 15, 2026 @03:43PM (#46639007)
I use agents in a container and persist their config like you suggest. After seeing some interest I shared my setup at https://github.com/asfaload/agents_container It works fine for me on Linux.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by greggh on Thursday January 15, 2026 @02:14PM (#46637619)
Use a devcontainer. Claude Code's repo has one built specifically for it:

https://github.com/anthropics/claude-code/tree/main/.devcont...

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by avsm on Thursday January 15, 2026 @02:36PM (#46637979)
The Claude Code devcontainer works really well, especially the firewalling script! I had do a bit of GitHub Actions spelunking to figure out how to build binary images (with my own devtools preinstalled), which I wrote up here: https://anil.recoil.org/notes/ocaml-claude-dev

With this I have a nice loop where I get Claude to analyse its own sessions via a cronjob and rewrite my devcontainer Dockerfile to have any packages that I've started using during the interactive sessions. This rebuilds via GHActions and my fresh image the next day has an updated Claude and dev environment in a sandbox.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by jmacd on Thursday January 15, 2026 @02:14PM (#46637622)
Docker desktop has a pretty nice sandbox feature that will also store your CC (and other) credentials, so you don't have to re-auth every time you create a new container.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by avsm on Thursday January 15, 2026 @02:33PM (#46637936)
Funnily enough, we shipped the Docker Desktop VM a decade ago now (experience report at https://dl.acm.org/doi/10.1145/3747525). The embedded VM in DD is much more stripped down than the one in Claude Cowork (its based on https://github.com/linuxkit/linuxkit), and its more specialised to container workloads rather than just using bubblewrap for sandboxing (system services run in their own isolated namespaces).

Given how many products seem to be using this shipping-Linux-as-a-library-VM trick these days, it's probably a good time for an open source project to step up to supply a more reusable way of assembling this layer into a proper Mac library...

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by bs7280 on Thursday January 15, 2026 @01:53PM (#46637311)
Simon Willison just posted about using claude in fly.io's dev sandboxes. I have not tried it yet but it looks promising.

https://simonw.substack.com/p/first-impressions-of-claude-co...

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by sirmoveon on Thursday January 15, 2026 @02:53PM (#46638229)
Maybe not easy or for everyone but you can set a Virtualbox VM running a headless linux of your choice, install directory sharing like samba and your AI agents of choice. Then you can just have multiple SSH sessions to interact with the agents and `tail` logs.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by aprilnya on Thursday January 15, 2026 @02:48PM (#46638160)
Claude Code on web is okay in the meantime if you want to set it loose but not on your own machine.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by cloudking on Thursday January 15, 2026 @01:37PM (#46637049)
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by e12e on Thursday January 15, 2026 @01:55PM (#46637339)
> The sandboxed bash tool uses OS-level primitives to enforce both filesystem and network isolation.

As I can't trust Claude Code to use a correct shell, I don't know why I would trust this feature.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by azuanrb on Thursday January 15, 2026 @05:51PM (#46640551)
Note that there are reports that it can disable sandbox, so personally I wouldn't trust this.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by colechristensen on Thursday January 15, 2026 @03:52PM (#46639133)
I built something to use for myself which is organized workspaces to work on many things with Claude in parallel with the ability to run things in VMs and linked web browsers all contained in one app. I built it mostly driven by trying to work on too many things at once and getting lost in a sea of windows and browser tabs.

It is not at all ready for public consumption (a face only a mother could love, in other words it's a bugridden mess), but I've considered polishing it and releasing it to the public either as open source or for profit.

Most of it is written with Claude and I've run into roadblocks with Claude being able to do too many things at once and am rewriting as several libraries to improve the focus for Claude agents.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by giancarlostoro on Thursday January 15, 2026 @01:51PM (#46637286)
I mean, it depends on what you're doing but I force claude to always commit code every time it finishes a todo. It never seems to stop doing that, so I run it in dangerous mode on Zed. I get to review the code after the fact anyway.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by Someone on Thursday January 15, 2026 @02:23PM (#46637761)
The risk isn’t that it makes weird commits; it’s that it may decide to clean up stuff and delete more than desired.

- https://github.com/anthropics/claude-code/issues/4331

- https://github.com/anthropics/claude-code/issues/7787

- https://news.ycombinator.com/item?id=46268222

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by giancarlostoro on Thursday January 15, 2026 @09:58PM (#46642492)
You can roll back commits
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by weikju on Thursday January 15, 2026 @10:51PM (#46642798)
Not for changes made outside of the repo….
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by giancarlostoro on Friday January 16, 2026 @11:34AM (#46648343)
I havent ever seen Claude do that so thats news to me, always asks for permission to go anywhere else.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by weikju on Tuesday January 20, 2026 @07:50PM (#46699803)
Sure, it tries really hard not to, but there might be some attack/malware/hidden prompt that does it, one day, out of the blue...
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by adastra22 on Friday January 16, 2026 @10:46AM (#46647649)
Not when it deletes .git. Or your home directory.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by giancarlostoro on Friday January 16, 2026 @11:33AM (#46648337)
Never had that happen but you should always push your commits.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by adastra22 on Friday January 16, 2026 @12:23PM (#46649020)
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by pluralmonad on Thursday January 15, 2026 @02:17PM (#46637674)
The danger there is not that it commit bad things, but that as part of working the task it gets tricked into sending your env/secrets/credentials to prompt injectors. That would not show up in your commit diff.

Edit: At the very least, I would not allow it to do indiscriminate web searching.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by adastra22 on Friday January 16, 2026 @10:47AM (#46647661)
Why are you running CC with prod credentials.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by zackify on Thursday January 15, 2026 @07:10PM (#46641334)
I have 30 lines of zsh and I just say "dev1" dev2 etc.

And it makes a new lxd container using my base image. Connects using tmux so I can resume anytime after closing the session.

Its like exe.dev or sprites without much effort if you want to self host.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by bigyabai on Thursday January 15, 2026 @07:19PM (#46641418)
Genuine advice: supplement your Claude Code plan with a GLM Coding plan: https://z.ai/subscribe

GLM 4.7 is not a "Sonnet killer" but it will work just as well for sketching out easier projects, web design and terminal usage. After a while I cancelled my Claude Code plan because I simply didn't do anything that GLM couldn't hammer out equally as well.

Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by Wowfunhappy on Thursday January 15, 2026 @08:28PM (#46641908)
Well, one very easy way would be to use the web version of Claude Code.
Re:Claude Cowork Runs Linux VM via Apple Virtualization Fram... by nullishdomain on Friday January 16, 2026 @12:21AM (#46643258)
yolobox is the easiest I have found. Basically a batteries included image with a bit of sugar. https://github.com/finbarr/yolobox

`yolobox run claude` launches Claude Code with --dangerously-skip-permissions mode inside of a container with a good set of default tools included.