Skip to content

feat: Add Linux support for Lima VM#648

Open
superdav42 wants to merge 1 commit intoroots:masterfrom
Ultimate-Multisite:linux-lima-support
Open

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

Conversation

@superdav42
Copy link

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.
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.

1 participant