Skip to content

Instantly share code, notes, and snippets.

@surenkov
Last active November 12, 2023 17:24
Show Gist options
  • Save surenkov/e80b144e666f2a3e6d928553de1d9b4d to your computer and use it in GitHub Desktop.
Save surenkov/e80b144e666f2a3e6d928553de1d9b4d to your computer and use it in GitHub Desktop.
vmType: "vz"
arch: "default"
images:
# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months.
- location: "https://cloud-images.ubuntu.com/releases/23.10/release-20231011/ubuntu-23.10-server-cloudimg-arm64.img"
arch: "aarch64"
digest: "sha256:78d35a2f551d281912ee7e5202660d94d713aa1b5de86a17e261328cc2f093d4"
- location: "https://cloud-images.ubuntu.com/releases/23.10/release-20231011/ubuntu-23.10-server-cloudimg-amd64.img"
arch: "x86_64"
digest: "sha256:f6529be56da3429a56e4f5ef202bf4958201bc63f8541e478caa6e8eb712e635"
# Fallback to the latest release image.
# Hint: run `limactl prune` to invalidate the cache
- location: "https://cloud-images.ubuntu.com/releases/23.10/release/ubuntu-23.10-server-cloudimg-arm64.img"
arch: "aarch64"
- location: "https://cloud-images.ubuntu.com/releases/23.10/release/ubuntu-23.10-server-cloudimg-amd64.img"
arch: "x86_64"
cpus: 6
memory: "12GiB"
disk: "300GiB"
mounts:
- location: "~"
- location: "~/Projects"
writable: true
- location: "/tmp/lima"
writable: true
mountType: "virtiofs"
# ===================================================================== #
# ADVANCED CONFIGURATION
# ===================================================================== #
# containerd is managed by Docker, not by Lima, so the values are set to false here.
containerd:
system: false
user: true
provision:
- mode: system
script: |
#!/bin/bash
sed -i 's/host.lima.internal.*/host.lima.internal host.docker.internal/' /etc/hosts
- mode: user
script: |
mkdir -p ~/.config/nerdctl
cat <<-EOF > ~/.config/nerdctl/nerdctl.toml
debug = false
debug_full = false
snapshotter = "stargz"
experimental = true
host_gateway_ip = "$(dig host.lima.internal +short)"
EOF
# ===================================================================== #
# FURTHER ADVANCED CONFIGURATION
# ===================================================================== #
rosetta:
enabled: true
binfmt: true
networks:
# The "vzNAT" IP address is accessible from the host, but not from other guests.
- vzNAT: true
hostResolver:
enabled: true
ipv6: true
hosts:
host.docker.internal: host.lima.internal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment