Skip to content

feat: Add Linux support for Lima VM#648

Closed
superdav42 wants to merge 2 commits intoroots:masterfrom
Ultimate-Multisite:linux-lima-support
Closed

feat: Add Linux support for Lima VM#648
superdav42 wants to merge 2 commits intoroots:masterfrom
Ultimate-Multisite:linux-lima-support

Conversation

@superdav42
Copy link
Copy Markdown
Contributor

Summary

This PR adds Linux support for the trellis vm commands using Lima with QEMU.

Changes

  • Add Linux to supported OS list for Lima VM manager
  • Add VMType field to Instance struct (vz for macOS, qemu for Linux)
  • Update config.yml template with conditional logic for OS-specific settings:
    • macOS: vmType=vz, mountType=virtiofs, vzNAT networking
    • Linux: vmType=qemu, mountType=9p, user-v2 networking
  • Update ensureRequirements() to skip macOS version check on Linux
  • Fix IP() function to handle Linux QEMU networking (different interface names)
  • Fix version parsing to handle Linux distro packages that output git hashes instead of semver versions
  • Update tests to be OS-aware

Testing

Tested on Linux (Ubuntu/Arch) with Lima installed via distro package manager:

  • VM successfully starts with QEMU backend
  • Project directory mounts via 9p filesystem
  • SSH access works correctly
  • IP detection works correctly

Notes

Lima supports Linux via QEMU (see lima-vm.io). This PR enables trellis-cli to use Lima on Linux systems, providing a consistent VM-based development experience across macOS and Linux.

- Add Linux to supported OS list for Lima VM manager in trellis.go
- Add VMType field to Instance struct (vz for macOS, qemu for Linux)
- Update config.yml template with conditional logic for OS-specific settings:
  - macOS: vmType=vz, mountType=virtiofs, vzNAT networking
  - Linux: vmType=qemu, mountType=9p, user-v2 networking
- Update ensureRequirements() to skip macOS version check on Linux
- Fix IP() function to handle Linux QEMU networking (different interface names)
- Fix version parsing in lima.go to handle Linux distro packages that output
  git hashes instead of semver versions
- Update tests to be OS-aware

Tested on Linux with Lima installed via distro package manager.
VM successfully starts with QEMU, project directory mounts via 9p,
and SSH/IP detection works correctly.
@retlehs
Copy link
Copy Markdown
Member

retlehs commented Mar 30, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da49a43fd8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/lima/files/config.yml
Comment thread pkg/lima/lima.go
Comment on lines +31 to +32
if len(v) < 2 {
return nil
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve minimum-version enforcement on unparseable limactl output

Returning success when no semantic version is matched disables the >= 0.15.0 guard entirely for any nonstandard limactl -v output, so unsupported/older builds can pass requirements and then fail later with harder-to-diagnose runtime/config errors. This path should fail closed (or use a stronger fallback parser) rather than silently bypassing version validation.

Useful? React with 👍 / 👎.

@retlehs
Copy link
Copy Markdown
Member

retlehs commented Mar 31, 2026

@superdav42 Thanks for the PR — can you update the settings so that maintainers can make edits? I think it's a setting on the PR sidebar for you?

@retlehs
Copy link
Copy Markdown
Member

retlehs commented Mar 31, 2026

#659

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants