159 Commits
Author SHA1 Message Date
Jan Dubois e12791225d Update nobin config with base64 and confusables checking
* Move the flags from the Makefile to .nobin.yaml
* Check for unexpected base64 data of 32 characters or more
* Check for Unicode characters that can be confused with Latin letters
  or digits
* Run nobin in lint-quick.yml instead of test.yml

test.yml skips docs-only changes, but docs are a likely place for a
link spelled with a look-alike letter. lint-quick.yml runs on every
change.

Both checks rely on heuristics and skip some candidates to avoid false
positives. The config file lists the known exceptions.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2026-10-12 21:10:21 -07:00
Soumya Sagar feb8e94960 feat(cli): add limactl-menu TUI plugin for instance management
Implements #5285 - adds 'limactl menu' TUI plugin for managing Lima instances through an interactive terminal UI.

Features:
- Single-panel instance list showing status icon, name, status, arch, CPUs/memory, and SSH address
- Midnight Commander-style function keys (F1 Help, F2 Start/Stop Toggle, F3 Info, F5 Refresh, F8 Delete, F10 Quit)
- Interactive action popup menu on Enter
- F5 refreshes the instance list in-place
- Confirmation modals for destructive actions (Stop, Delete)
- Modals for instance details and port forwards
- Footer help bar with keyboard shortcut legend
- Empty state with option to create a new instance when no VMs exist

Developed with AI assistance.

Signed-off-by: Soumya Sagar <soumya.sagar.codr@gmail.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-10-09 18:42:10 +09:00
Nick Sweeting aa8f132f00 Support secure host block-device attachment on macOS VZ
Attach explicitly allowed host disks through a dedicated root-owned helper,
passing validated file descriptors to unprivileged VZ over an authenticated
Unix socket. Scope sudoers grants to the invoking user and exact device paths,
reject unsafe helper paths and socket symlinks, authenticate both peers, and
validate the received device identity.

Retain descriptors per VM while preserving process-lifetime network wrappers
used by krunkit. Lock whole host disks across instances sharing LIMA_HOME,
including raw/block aliases and partitions. Reject duplicate configuration
entries and external VZ drivers at runtime.

Compose network and block-device sudoers fragments through pkg/sudoers, match
complete generated lines, and warn when regeneration removes existing grants.
Keep integration-test grants in temporary fragments and revoke them before
detaching the test RAM disk. Add security, lifecycle, and real-disk regression
coverage and document installation requirements and remaining grant limits.

Signed-off-by: Nick Sweeting <git@sweeting.me>
2026-09-23 10:08:04 -07:00
Akihiro Suda 5539e86df5 Merge pull request #5220 from afbjorklund/sbom
Add SBOM artifact using cyclonedx-gomod
2026-09-17 19:55:52 +09:00
Akihiro Suda ba798aceff Merge pull request #5483 from unsuman/net/pr1-lima-net-helper
`lima-privileged-net`: add the privileged network helper for Linux hosts
2026-09-11 23:56:16 +09:00
Anders F Björklund 9426db7649 Add SBOM artifact to the release notes
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2026-09-11 13:18:00 +02:00
Anders F Björklund 68a8139f24 Add SBOM artifact using cyclonedx-gomod
One for lima as a library, one for each cmd.

https://github.com/CycloneDX/cyclonedx-gomod

Add cyclonedx-gomod to hack/tools dir

Running cyclonedx-gomod vendor fails

Mention SBOM in README.md as required

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2026-09-11 13:00:40 +02:00
Ansuman Sahoo 707103d11a lima-privileged-net: add the privileged network helper for Linux hosts
Linux has no equivalent of socket_vmnet, so add lima-privileged-net, a small
helper that limactl runs via sudo to set up the "shared", "host" and "bridged"
networks. It is installed into libexec/lima/privileged/, a directory reserved
for helpers that run with elevated privileges, so that they are easy to tell
apart from the unprivileged helpers and easy to audit.

`lima-privileged-net start` creates (for "shared" and "host") the lima-<name>
bridge, assigns the gateway address, spawns dnsmasq for DHCP, and installs the
NAT/forwarding rules of the "shared" mode. `lima-privileged-net tap` creates the
tap device of a single instance, hands it to the calling user, and attaches it
to the bridge. Both take all parameters from the command line rather than
reading the user-writable networks.yaml, because the arguments are what the
sudoers file pins down.

The tap device is created with `ip tuntap`, falling back to the /dev/net/tun
ioctls that iproute2 itself uses, because busybox's `ip` applet does not
implement the tuntap subcommand.

The helper tears the network down again when the last instance leaves, and only
ever touches bridges and tap devices that follow the Lima naming scheme.

networks.IsManagedBridge() and networks.IsTapName() recognize the bridges and
tap devices that lima-privileged-net owns, so it never touches an interface it
did not create itself. Config.Validate() rejects a network name that would make
the derived bridge name exceed IFNAMSIZ-1. A daemon-side commit adds the
matching name generators and the command lines that start the helper and attach
an instance to its bridge.

Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
2026-09-09 17:37:22 +05:30
Akihiro Suda c80fad98ad gomodjail: update to v2.0.1, enforce gomodjail analyze in CI
gomodjail v2 moves the focus to static analysis: `gomodjail analyze`
verifies that the modules annotated `gomodjail:confined` in go.mod cannot
reach a denied capability (filesystem, network, process execution, raw
syscalls, OS state modification, or cgo).

Add gomodjail to ./hack/tools, add a `gomodjail` lint target, and wire it
into `make lint` and the "Lints" job. Unlike the legacy dynamic mode, this
gate is blocking.

The verdicts are platform-dependent, so the gate is pinned to linux/amd64
and linux/arm64. These are the only platforms that can be analyzed from any
host: analyzing darwin needs a macOS host, as the "vz" driver requires cgo.
The linux verdicts are a superset of the darwin ones anyway. Windows is
deliberately left out, as it would unconfine 18 more modules (go-yaml,
containerd/log, go-runewidth, ...) and weaken the gate for the other
platforms.

`gomodjail fix` downgraded 36 modules to `gomodjail:unconfined` to make the
gate pass. 65 modules remain confined: 37 clean, 28 warning-only.
`make gomodjail-fix` is added for redoing this on dependency bumps, so that
the decision stays visible and reviewable in go.mod.

The macOS job that exercises the legacy dynamic mode (`gomodjail run`) is
kept as an experiment, with its checkout pinned to v2.0.1 instead of HEAD.

Assisted-by: Claude Code (Opus 5)
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-09-09 12:32:12 +09:00
mie313 15463f7275 Implement HCS driver
Signed-off-by: mie313 <mie313.tanaka@gmail.com>
2026-08-30 15:13:43 +01:00
Anders F Björklund 6e87fc069d Allow gosocialcheck target to fail in lint
Currently gosocialcheck is failing with an error,
and blocking the "lint" target for all changes.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2026-08-16 17:33:30 +02:00
Anders F Björklund 0717aa0b4d Exclude _output directory from the ltag scan
The "ltag" program expects every executable to be a
bash script, and is checking for a template header.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2026-08-16 17:33:26 +02:00
Anders F Björklund a39168726d Add jsonschema to the release artifacts
So that the json can be referenced from schema store.

Generate the file before cleaning the native limactl.

Add included base templates as default.yaml dependencies.

Add variable for "cp" since it seems to be not be default.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2026-08-01 20:31:24 +02:00
Ansuman Sahoo 2464b4e3c5 fix(makefile): propagate build failure for additional drivers
Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
2026-06-17 00:52:10 +05:30
Akihiro Suda 54495f2767 CI: run gosocialcheck for checking social reputation of Go dependencies
https://github.com/AkihiroSuda/gosocialcheck checks whether
a Go module is already adopted by a trustworthy project.
(i.e., CNCF graduated)

When a non-trusted dependency is detected, it is warned in the CI,
but does not result in a failure.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-06-12 16:19:20 +09:00
Ashwat 98c3aa4324 refactor: modularize lint targets with pinned go.mod tools (refs #4606)
Break lint target into independent stages (nobin, editorconfig, golangci,
yaml, ls, shellcheck, shfmt, licenses, ltag, protolint) using pinned
versions from hack/tools/go.mod via `go run`. Update CI to call make
targets instead of hardcoding commands, ensuring single source of truth.

Signed-off-by: Ashwat <ashwatpas@gmail.com>
2026-05-11 04:07:41 +05:30
Akihiro Suda a4e5d9db06 CI: release Windows artifacts
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-03-31 20:10:16 +09:00
Akihiro Suda b26f718e6b templates: add experimental/fedora-rawhide
Internally uses `limactl-url-fedora-rawhide` plugin as the image URL
has to be generated dynamically.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-03-16 18:18:36 +09:00
Jan Dubois cd9ab425ff lint: add nobin to detect binary files and invisible Unicode
Source files should contain only printable UTF-8 text. Binary files
committed without proper extensions, zero-width Unicode smuggled into
source (Glassworm/Trojan Source attacks), and encoding errors all
evade normal code review. nobin catches these at lint time.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2026-03-15 21:59:54 -07:00
Tharun V S 91119b9c2f makefile: raise error when VERSION cannot be determined
Signed-off-by: Tharun V S <tharunvs777@gmail.com>
2026-03-04 14:16:07 +05:30
Akihiro Suda 18df0bb1bc Support macOS guests
Usage:
```
limactl create --video template:macos
limactl start macos
limactl shell macos
```

The password prompt is shown during creating an instance,
so as to run `chown root:wheel ~/.lima/_mnt/0/Library/LaunchDaemons/...`,
which is required for the `lima-macos-init` launch daemon to run.

The password for GUI login is randomly generated and
stored in `/Users/${USER}.guest/password` in the VM.

Fix issue 3618

TODOs (maybe in follow-up PRs):
- [X] Docs
- [X] Switch back the default shell to `zsh`
- [ ] Graceful `limactl stop` (currently it has to be stopped from the guest)
- [ ] Propagate additional cloud-init data
  - [X] Hostname
  - [X] Timezone
  - [X] DNS
  - [ ] CA Certificates
- [ ] Support non-plain mode
  - [ ] mounts
  - [ ] port forwards
- [ ] Let `limactl sudoers` generate the entry for chowning files
  (`chown root:wheel ~/.lima/_mnt/0/Library/LaunchDaemons/...`)
- [ ] Support headless mode (`--video=false`)
- [ ] Support macOS in `hack/update-template.sh`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2026-02-24 13:46:06 +09:00
Jan Dubois 788a2f3010 lint: add editorconfig-checker for whitespace and newline checks
Add a root .editorconfig enforcing trim_trailing_whitespace and
insert_final_newline, with editorconfig-checker to verify compliance.
Fix all existing violations and update autostart tests to match
the corrected template files.

Fixes #4581

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2026-02-21 00:34:26 -08:00
Jan Dubois 12425bc803 go-licenses: add exception for hashicorp/hcl/v2 (MPL-2.0)
The yq v4.52.4 bump added hashicorp/hcl/v2 as an indirect dependency.
Its MPL-2.0 license is covered by the CNCF exception for hashicorp/hcl.

Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2026-02-18 17:10:56 -08:00
Bernhard M. Wiedemann 29131c94c3 Create reproducible .gz file
See https://reproducible-builds.org/ for why this is good.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2026-02-06 01:59:27 +01:00
Tushar Gupta 1bb6605719 Removed unnecessary print statement
Signed-off-by: Tushar Gupta <tushar.197712@gmail.com>
2026-01-19 11:47:30 +05:30
Akihiro Suda 9470963cae Makefile: include TEMPLATE_DEFAULTS in release artifacts
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-11-06 22:24:56 +09:00
Paweł Gronowski 24c68f3718 Makefile: Include TEMPLATE_IMAGES in release artifacts
The `_images` directory was missing from the output release tarballs
because `TEMPLATE_IMAGES` was not included in the `ARTIFACT_DES`
dependencies for the artifact targets.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-11-06 13:45:36 +01:00
Akihiro Suda e10104d950 make uninstall: uninstall lima-driver-krunkit
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-11-05 15:47:17 +09:00
Akihiro Suda 7ec355eaf7 Makefile: native, artifact: include limactl-plugins and additional-drivers
For issue 4289 and issue 4290

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-11-05 03:17:24 +09:00
Akihiro Suda 3c8b37bf63 Makefile: set ADDITIONAL_DRIVERS=krunkit by default
For issue 4289 and issue 4290

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-11-05 03:15:03 +09:00
Valentin Dela a5fc10e889 add compilation support for Fedora, RHEL, and related distributions, as
well as openSUSE

Signed-off-by: Valentin Dela <valdela@netc.fr>
2025-10-20 15:49:52 +02:00
Jan Dubois 8b1f07db05 Create BATS tests for limactl-mcp
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2025-10-09 22:21:08 -07:00
Akihiro Suda f25baa1ff8 docs: generate MCP docs
Fix issue 4071

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-09-24 09:09:07 +09:00
Akihiro Suda 94307162b3 Makefile: move limactl-mcp from bin to libexec/lima
So as to avoid blocking `limac[TAB]` shell experience

NOTE: `make install` now requires `sudo` even on Intel Mac on GHA,
for mkdiring `/usr/local/libexec`.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-09-23 16:48:47 +09:00
Akihiro Suda a4ab936380 Define "MCP Sandbox Interface" and implement limactl mcp serve
=== Interface ===

`pkg/mcp/msi` defines "MCP Sandbox Interface" (tentative)
that should be reusable for other projects too.

MCP Sandbox Interface defines MCP (Model Context Protocol) tools
that can be used for reading, writing, and executing local files
with an appropriate sandboxing technology. The sandboxing technology
can be more secure and/or efficient than the default tools provided
by an AI agent.

MCP Sandbox Interface was inspired by Gemini CLI's built-in tools.
https://github.com/google-gemini/gemini-cli/tree/v0.1.12/docs/tools

=== Implementation ===

`limactl mcp serve INSTANCE` launches an MCP server that implements the MCP
Sandbox Interface.

Use <https://github.com/modelcontextprotocol/inspector>
to play around with the server.

```bash
limactl start default
brew install mcp-inspector
mcp-inspector
```
In the web browser,
- Set `Command` to `limactl`
- Set `Arguments` to `mcp serve default`
- Click `▶️Connect`

=== Usage with Gemni CLI ===

1. Create `.gemini/extensions/lima/gemini-extension.json` as follows:
```json
{
  "name": "lima",
  "version": "2.0.0",
  "mcpServers": {
    "lima": {
      "command": "limactl",
      "args": [
        "mcp",
        "serve",
        "default"
      ]
    }
  }
}
```

2. Modify `.gemini/settings.json` so as to disable Gemini CLI's built-in tools
except ones that do not relate to local command execution and file I/O:
```json
{
  "coreTools": ["WebFetchTool", "WebSearchTool", "MemoryTool"]
}
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-09-22 18:12:03 +09:00
Norio Nomura ffe99e42b9 Makefile: Fix templates/{_default,_images} handling
This change prevents the creation of `_output/share/lima/templates/{_default/_default,_images/_images}` directories during the second make session.

- Add those directories to `MKDIR_TARRGETS` for applying directory creation rules.
- Add `TEMPLATE_DEFAULTS` and `TEMPLATE_IMAGES` variables for files in those directories.
- Add those files to the dependencies of the `templates` target.
- Add rules for those files to depend on their directories.

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
2025-09-17 16:53:13 +09:00
Norio Nomura 4b7f04c81d Makefile: Add the DEBUG flag to build binaries with debug information for use by dlv exec.
macOS Tahoe 26.0 does not allow the debug target of `dlv dap` to use the `com.apple.security.virtualization` entitlement.
See: https://github.com/lima-vm/lima/pull/2651#issuecomment-3298156169

But macOS Tahoe 26.0 allows the precompiled binary target of `dlv exec` to use the entitlement.
This adds the `DEBUG` flag to build binaries with debug information for use by `dlv exec`.

### Configuration files for VSCode working on macOS Tahoe 26.0
`launch.json`:
```jsonc
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "exec hostagent for input instance",
            "type": "go",
            "request": "launch",
            "mode": "exec",
            // Use integratedTerminal to stop using ctrl+C
            "console": "integratedTerminal",
            "program": "${workspaceFolder}/_output/bin/limactl",
            "env": {
                "LIMA_SSH_OVER_VSOCK": "false",
                "LIMA_SSH_PORT_FORWARDER": "true",
            },
            "cwd": "${userHome}/.lima/${input:targetInstance}",
            "args": [
                "--debug",
                "hostagent",
                "--pidfile",
                "ha.pid",
                "--socket",
                "ha.sock",
                "--guestagent",
                "${workspaceFolder}/_output/share/lima/lima-guestagent.Linux-aarch64",
                "--progress",
                "${input:targetInstance}"
            ],
            "preLaunchTask": "prepare launching hostagent for target instance",
            "postDebugTask": "clean up after stopping hostagent for target instance",
        },
    ],
    "inputs": [
        {
            "id": "targetInstance",
            "type": "promptString",
            "description": "Input target instance parameter for `limactl` command",
        }
    ]
}
```

`tasks.json`:
```jsonc
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "prepare launching hostagent for target instance",
            "dependsOn":[
                "execute: make CONFIG_GUESTAGENT_COMPRESS=n DEBUG=1",
                "execute: rm -f ${userHome}/.lima/${input:targetInstance}/ha.pid",
            ]
        },
        {
            "label": "clean up after stopping hostagent for target instance",
            "dependsOn":[
                "execute: rm -f ${userHome}/.lima/${input:targetInstance}/ha.pid",
            ]
        },
        {
            "label": "execute: make CONFIG_GUESTAGENT_COMPRESS=n DEBUG=1",
            "type": "shell",
            "command": "make CONFIG_GUESTAGENT_COMPRESS=n DEBUG=1",
            "presentation": {
                "close": true,
                "reveal": "always"
            },
        },
        {
            "label": "execute: rm -f ${userHome}/.lima/${input:targetInstance}/ha.pid",
            "type": "shell",
            "command": "rm -f ${userHome}/.lima/${input:targetInstance}/ha.pid",
            "presentation": {
                "close": true,
                "reveal": "silent"
            },
        }
    ],
    "inputs": [
        {
            "id": "targetInstance",
            "type": "promptString",
            "description": "Input <instance> for `rm -f <LIMA_HOME>/<instance>/ha.pid`",
        }
    ]
}
```

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
2025-09-17 13:25:00 +09:00
Ansuman Sahoo e5f6b9d0e5 fix make uninstall should remove external drivers
Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
2025-09-16 13:14:28 +05:30
Akihiro Suda b9b9aa6ff0 Merge pull request #3969 from jandubois/bats
Use BATS for integration tests
2025-09-06 14:37:10 +09:00
Jan Dubois 0ead7b0730 Add BATS for integration tests
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2025-09-05 21:30:35 -07:00
Akihiro Suda b314ed83c7 make check-generated: check reproducibility of *.pb.go too
Fix issue 3953

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-09-04 15:47:35 +09:00
Oleksandr Redko 3ac32b60ab chore: enable dependabot for upgrading Go tools
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-07-22 15:43:56 +03:00
Oleksandr Redko e47c2405f7 Fix proto style issues; enable protolint
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-07-16 19:31:28 +03:00
Akihiro Suda b76b7ff76d Merge pull request #3731 from AkihiroSuda/gomajor-v2
go.mod: github.com/lima-vm/lima/v2
2025-07-17 01:11:59 +09:00
Akihiro Suda 6272782a93 Remove Kconfig and config.mk
Fix issue 3639

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-15 19:14:58 +09:00
Akihiro Suda bd955e4d4c go.mod: github.com/lima-vm/lima/v2
The major version is now updated to highlight the introduction of the
pluggable VM driver framework.

See issue 3712

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-15 18:48:03 +09:00
Ansuman Sahoo 7bd7066415 external driver plugin system and update Makefile to build exteral bins
Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
2025-07-14 15:41:24 +05:30
Akihiro Suda 644a8a9dab Kconfig: deprecate
Will be removed in Lima v2.0.

See issue 3639

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-07-09 14:16:07 +09:00
Oleksandr Redko d3a57410ba chore: Fix typos in comments
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
2025-05-27 12:40:41 +03:00
Jan Dubois 12bbe36f52 Merge pull request #3503 from AkihiroSuda/fix-3321
Makefile: split lima-additional-guestagents-*.tar.gz from  lima-*.tar.gz
2025-05-12 16:39:58 -07:00