You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to work out how I could either configure in lima.yaml/networks.yaml, or using post-boot scripts to maybe change the cloud-init or netplan/systemd-networkd configuration so that I could set up a static IPv6 address on the lima0 interface.
Is there a best-practice way to go about this? I tried looking through /mnt/cidata and the cidata templates on GitHub but was struggling to trace all the steps and environment variables.
I'm using Lima v0.19.1 on macOS Sonoma 14.2.1 on an M1 Mac Mini, and socket_vmnet v1.1.3, both installed using Homebrew.
I'm basically trying to run the pi-holedocker container with a more Infrastructure-as-code type of setup (I was using a whole qemu VM via UTM.app until their virtio network driver started crashing a few mins after boot, which is less than ideal for a DNS server..😅).
Any ideas on how I could set up this config?
Here's my VM config:
vmType: "vz"cpus: 4memory: "4GiB"disk: "60GiB"images:
- location: "https://cloud-images.ubuntu.com/releases/23.10/release-20231011/ubuntu-23.10-server-cloudimg-amd64.img"arch: "x86_64"digest: "sha256:f6529be56da3429a56e4f5ef202bf4958201bc63f8541e478caa6e8eb712e635"
- location: "https://cloud-images.ubuntu.com/releases/23.10/release-20231011/ubuntu-23.10-server-cloudimg-arm64.img"arch: "aarch64"digest: "sha256:78d35a2f551d281912ee7e5202660d94d713aa1b5de86a17e261328cc2f093d4"# Fallback to the latest release image.
- location: "https://cloud-images.ubuntu.com/releases/23.10/release/ubuntu-23.10-server-cloudimg-amd64.img"arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/23.10/release/ubuntu-23.10-server-cloudimg-arm64.img"arch: "aarch64"mounts:
- location: "/tmp/lima"writable: true
- location: "/opt/lima"writable: true# - location: "~"mountType: "virtiofs"networks:
# Interface "lima1": bridged mode (IP is assigned by a DHCP server on the physical network)
- lima: bridgedcontainerd:
system: falseuser: falseprovision:
- mode: systemscript: | #!/bin/sh sed -i 's/host.lima.internal.*/host.lima.internal host.docker.internal/' /etc/hosts
- mode: systemscript: | #!/bin/bash set -eux -o pipefail command -v docker >/dev/null 2>&1 && exit 0 if [ ! -e /etc/systemd/system/docker.socket.d/override.conf ]; then mkdir -p /etc/systemd/system/docker.socket.d # Alternatively we could just add the user to the "docker" group, but that requires restarting the user session cat <<-EOF >/etc/systemd/system/docker.socket.d/override.conf [Socket] SocketUser=${LIMA_CIDATA_USER} EOF fi export DEBIAN_FRONTEND=noninteractive curl -fsSL https://get.docker.com | shprobes:
- script: | #!/bin/bash set -eux -o pipefail if ! timeout 30s bash -c "until command -v docker >/dev/null 2>&1; do sleep 3; done"; then echo >&2 "docker is not installed yet" exit 1 fi if ! timeout 30s bash -c "until pgrep dockerd; do sleep 3; done"; then echo >&2 "dockerd is not running" exit 1 fihint: See "/var/log/cloud-init-output.log". in the guesthostResolver:
hosts:
host.docker.internal: host.lima.internalportForwards:
- guestSocket: "/run/user/{{.UID}}/docker.sock"hostSocket: "{{.Dir}}/sock/docker.sock"message: | To run `docker` on the host (assumes docker-cli is installed), run the following commands: ------ docker context create lima-{{.Name}} --docker "host=unix://{{.Dir}}/sock/docker.sock" docker context use lima-{{.Name}} docker run hello-world ------
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi team,
Trying to work out how I could either configure in lima.yaml/networks.yaml, or using post-boot scripts to maybe change the cloud-init or netplan/systemd-networkd configuration so that I could set up a static IPv6 address on the lima0 interface.
Is there a best-practice way to go about this? I tried looking through
/mnt/cidata
and the cidata templates on GitHub but was struggling to trace all the steps and environment variables.I'm using Lima v0.19.1 on macOS Sonoma 14.2.1 on an M1 Mac Mini, and socket_vmnet v1.1.3, both installed using Homebrew.
I'm basically trying to run the pi-hole docker container with a more Infrastructure-as-code type of setup (I was using a whole qemu VM via UTM.app until their virtio network driver started crashing a few mins after boot, which is less than ideal for a DNS server..😅).
Any ideas on how I could set up this config?
Here's my VM config:
Beta Was this translation helpful? Give feedback.
All reactions