* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
=== 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>
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>
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>