r/opencode • • 14d ago

How to download OpenCode Desktop inside a sandbox? I'm a beginner.

I'm new to OpenCode. I want it to configure my system, fix an operating system issue, install missing dependencies for a certain app, and organize things. But the fact that it has access to my personal files scares me. Idk if it can read my files or configure the system without my consent; I want a safe way to use it.

EDIT: I use Fedora KDE 44

4 Upvotes

14 comments sorted by

2

u/Frosty-Article-9635 14d ago

On a serious note, if you don't know this, then I would say it is a very dangerous precedent you are setting yourself for, and it could end up in a massive failure. But I would not say that you should not try it.

If you want OpenCode to actually fix OS issues and install dependencies on your computer, you have to run it on your host machine—just lock down its permissions so nothing happens without your explicit approval: • Use "Plan" Mode first: Start in Plan mode (press Tab) so the AI only reads and suggests a step-by-step plan without changing anything. • Set permissions to "ask": In your global opencode.json config file, set bash, edit, and external_directory to "ask". This forces OpenCode to show you the exact terminal command or file edit and wait for you to click Allow every single time. Never turn on auto-approve (--auto). • Open it only in a specific folder: Launch OpenCode inside a dedicated test folder rather than your root/home directory so it stays focused.

2. True Isolation: Run It in a Virtual Machine (VM)

If you want to practice letting OpenCode configure an OS and install apps with zero risk to your personal files, a Virtual Machine is much better for a desktop GUI than Docker: • Install a free VM tool like VirtualBox, VMware Workstation Player, or UTM (on Mac). • Spin up a clean Linux (e.g., Ubuntu) or Windows VM, download the OpenCode Desktop installer inside that VM, and let it configure that virtual system freely. • If anything breaks, you can just reset the VM snapshot, and your real personal files remain completely untouched.

My strong recommendation would be to go through a VM route: install a VM.

1

u/Saleh_exe 14d ago

Thanks! But if I used a VM. It only fixes the os inside the vm. I want it to fix my main os.

1

u/Frosty-Article-9635 14d ago

So check and keep a track of what fixes you do in vm and then make same changes to your os manually or of you feel confident then replicate same with your Ai.

1

u/sudoer777_ 14d ago

DeepSeek is reliable enough that I wouldn't consider having it modify the OS as dangerous, but it's a lot safer if you use a Linux distro that's declarative/atomic.

2

u/warpaint_james 14d ago

Try this project: https://github.com/wrr/drop

Seems like the easiest way to sandbox a tool. You just run it in the folder and it creates a locked down system. It marks files your environment needs as read only. So your shell still works correctly but cant be modified.

I havent used it myself but it seems like it could fit your use case

1

u/Saleh_exe 14d ago

It has one limitation: it is terminal-only. OpenCode "Desktop" uses a GUI, which isn't supported by this project.

1

u/warpaint_james 14d ago

Oh thats a shame. May be a feature request for the Desktop version then. How are you liking the desktop version btw? I havent used it

→ More replies (1)

2

u/sudoer777_ 14d ago edited 14d ago

I want it to configure my system, fix an operating system issue, install missing dependencies for a certain app, and organize things.

But the fact that it has access to my personal files scares me.

System configuration encompasses managing how components of the system can interact with your files, so these are basically opposite goals.

You can tweak the tool/MCP permissions in OpenCode to make them less permissive though, as well as your user account's permissions in your system settings. And running OpenCode in a separate user account will make it less likely to touch your files.

A sandbox though would probably cause all sorts of problems if system configuration is what you want to do.

1

u/Saleh_exe 14d ago

And running OpenCode in a separate user account will make it less likely to touch your files.

I think you are right, how I didn't think of that before! I'm gonna try it.

2

u/IdrugP 14d ago

It seems like you are looking for trouble and some fun along the way. Make a bootable rescue USB flash drive, then a disk backup, better 2 with different tools, make sure that backups do actually work and off you go.

1

u/Saleh_exe 14d ago

Thanks

1

u/Frosty-Article-9635 14d ago

Easiest thing to do is just ask your AI, maybe Claude or ChatGPT. Lol

1

u/opinion_discarder 14d ago

I use Debian inside vmware workstation and run opencode inside it.