Feat: Add Linux support via QEMU tap networking #633
+154
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses issue #599 by enabling
trellis-clito work on Linux using Lima with QEMU.Currently,
trellis-clirelies onvmType: vzand macOS-specific networking, which makes VMs inaccessible on Linux (cannot route to the VM's IP).Changes Implemented
1. Dynamic VM Type
pkg/lima/instance.goandconfig.ymlto switch betweenvz(macOS) andqemu(Linux).2. Bridged Networking (The "TAP" Solution)
Since Lima on Linux (QEMU) implies user-mode networking by default, I implemented a bridged network approach:
tap0interface (assigned192.168.56.1) on the host usingsudo.192.168.56.5.3. QEMU Wrapper
Lima does not currently expose a way to inject specific
-netdev taparguments.qemu-system-x86_64wrapper script inpkg/lima/manager.go.4. IP Detection
Instance.IP()to prioritize the custom bridged subnet (192.168.56.x) on Linux.Verification
runtime.GOOSchecks.