From 78d4d283370297868cd04d466934f343371642df Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 20 May 2025 22:58:38 +0800 Subject: [PATCH] fix --- docs/en/guide/incus/incus_windows.md | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/docs/en/guide/incus/incus_windows.md b/docs/en/guide/incus/incus_windows.md index 0260fdef87..e9a0d58216 100644 --- a/docs/en/guide/incus/incus_windows.md +++ b/docs/en/guide/incus/incus_windows.md @@ -72,24 +72,6 @@ incus config device add winvm vtpm tpm path=/dev/tpm0 incus config device add winvm install disk \ source=/root/win.incus.iso \ boot.priority=10 - -# Configure static IPv4 address -DEV=$(lshw -C network | awk '/logical name:/{print $3}' | head -1) -CIDR=$(incus network show incusbr0 | awk -F: '/ipv4.address/ {gsub(/ /,"",$2); print $2}') -PREFIX=${CIDR%/*} -PLEN=${CIDR#*/} -BASE=${PREFIX%.*} -START=2 -END=$(( 2**(32-PLEN) - 2 )) -USED=$(incus network list-leases incusbr0 | awk '{print $2}' | grep -E "^${BASE}\." || true) -for i in $(seq $START $END); do - IP="${BASE}.${i}" - if ! grep -qx "$IP" <<< "$USED"; then - FREE_IP="$IP" - break - fi -done -incus config device override winvm "$DEV" ipv4.address="$FREE_IP" ``` ## Start the VM and Access the Desktop Remotely via Browser