# How to modify RAM and CPU of Lima instance

**URL:** https://discourse.roots.io/t/how-to-modify-ram-and-cpu-of-lima-instance/29646
**Category:** trellis
**Tags:** lima
**Created:** 2025-05-29T14:59:34Z
**Posts:** 4

## Post 1 by @JordanC26 — 2025-05-29T14:59:34Z

I use Lima for the virtual machine Trellis provisions. I see no config controlling what RAM and CPU is being set, so I presume Lima set a default when being created initially.

How would you normally modify the RAM and CPU of a Lima instance?

I tried manually editing my config file, but on a restart of the lima instance, that change was removed.

`nano ~/.lima/mydomain.local/lima.yaml`

I manually added:

```
cpus: 4
memory: "8GiB"
```

```
vmType: "vz"
cpus: 4
memory: "8GiB"
rosetta:
  enabled: false
images:
- location: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
  arch: x86_64  
- location: https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-arm64.img
  arch: aarch64

......
```

Maybe you don’t edit the config file at all. I reprovisioned trellis too, no change.

---

## Post 2 by @ttamnedlog — 2025-05-29T16:02:18Z

That’s the correct file to edit, but I’m not sure `"8GiB"` is the correct syntax. Maybe the quotes don’t matter, but if instead of manually editing that file, you issue `limactl` commands, it does not add quotes when you check the file afterward.

```
limactl list
limactl edit <NAME> --memory 8
limactl edit <NAME> --cpus 8
```

Contents of end of `~/lima/<NAME>/lima.yaml`:

```
...
memory: 8GiB
cpus: 8
```

In any case, typing `limactl edit <NAME> --` and pressing tab will bring up a list of the various things you can change, so you shouldn’t have to manually edit that `lima.yaml` file.

And reprovisioning may or may not be necessary, but I believe `trellis vm stop` before making these changes would be. And naturally `trellis vm start` after.

Edit: if you do want to change the default for all your instances, you can edit `~/.lima/_config/default.yaml`. I do believe you have to edit that file rather than issuing any `limactl` commands. You can see all the options you can add here: [lima/templates/default.yaml at dd8a2e1d2042c1ec6402a8f944586d246c50d623 · lima-vm/lima · GitHub](https://github.com/lima-vm/lima/blob/dd8a2e1d2042c1ec6402a8f944586d246c50d623/templates/default.yaml)

---

## Post 3 by @JordanC26 — 2025-05-29T16:20:16Z

Thank you @ttamnedlog. Using the `limactl edit <NAME> --` commands did the trick.

---

## Post 4 by @JordanC26 — 2025-05-29T23:22:57Z

Heads up. Although the above command worked, it doesn’t do one step which `trellis vm start` does which is to update the hosts file. Therefore I could not access my site.

For now, I used the limactl commands to start the machine, then manually updated my hosts file with what `trellis vm start` would have added.

Is there a method to use `trellis vm start` but tag on some values such as --cpu and --ram too?
