-
-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose Lima setting hostResolver.ipv6 #1275
Comments
I've ended up going for an ugly workaround for now until this issue is resolved: #!/usr/bin/env bash
# this is a ugly workaround for https://github.com/abiosoft/colima/issues/1275
# put this in your PATH before the original limactl, for example, in ~/bin/limactl
set -euo pipefail
# Get absolute path of this script to avoid recursion
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
# Get the first limactl in path skipping this script itself
ORIGINAL_LIMACTL=$(which -a limactl | while read -r candidate; do
if [[ "$(realpath "$candidate")" != "$SCRIPT_PATH" ]]; then
echo "$candidate"
break
fi
done)
# check if found and is exacutable
if [[ ! -x "${ORIGINAL_LIMACTL}" ]]; then
echo "limactl not found" >&2
exit 1
fi
# check if yq is installed
if ! command -v yq &>/dev/null; then
echo "yq not found" >&2
exit 1
fi
# if being run for colima and it's a 'start' command with profile name,
# and if that profile has a vzNAT network in it, then set hostResolver.ipv6 to true
if [[ "${LIMA_HOME:-}" =~ \.colima/_lima$ && "${1:-}" == "start" && -n "${2:-}" ]]; then
profile_name="$2"
yaml_path="${LIMA_HOME}/${profile_name}/lima.yaml"
if [[ -f "$yaml_path" ]] && yq e '.networks[] | select(.vzNAT == true) | length > 0' "$yaml_path" &>/dev/null; then
echo "[limactl-ipv6-wrapper] patching hostResolver.ipv6 to true" >&2
yq -i e '.hostResolver.ipv6 |= true' "$yaml_path"
fi
fi
exec "${ORIGINAL_LIMACTL}" "$@" but this proves that setting the value should be enough maybe changing the default isn't the safest option, but allowing the end user to configure this through the Colima settings seems like a good idea to me. |
The config was not available in Lima initially, must've been introduced more recently. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
currently hostResolver.ipv6 is never set:
colima/environment/vm/lima/yaml.go
Lines 72 to 81 in e79883b
however, it's possible to get a somewhat working IPv6 network in container with:
but the DNS won't resolve AAAA records since
hostResolver.ipv6
property is not set in the lima config.would be great to allow setting it from the network settings, or to even set it to true automatically if
network.address
is set to true in Colima spec.The text was updated successfully, but these errors were encountered: