[PATCH v2 15/15] guestfs: increase SSH config timeout for Fedora on Debian hosts

Daniel Gomez <[email protected]> Wed, 29 Oct 2025 13:40:57 +0100
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

Fedora guests running on Debian hosts timeout after 60 seconds while
waiting for network configuration during first boot. The 60-second
timeout is insufficient due to slower boot times caused by SELinux
permissive mode initialization on non-SELinux hosts.

Increase the default timeout from 60 to 180 seconds to
accommodate Fedora boot times. Make the timeout configurable via
KDEVOPS_SSH_CONFIG_TIMEOUT environment variable for flexibility in
different environments.

Improve the error message to include the configured timeout value and
suggest using 'virsh console' for boot diagnostics.

Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 scripts/update_ssh_config_guestfs.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/update_ssh_config_guestfs.py b/scripts/update_ssh_config_guestfs.py
index 40f1ccad..0ec32959 100755
--- a/scripts/update_ssh_config_guestfs.py
+++ b/scripts/update_ssh_config_guestfs.py
@@ -33,11 +33,15 @@ ssh_template = """Host {name} {addr}
 
 # We take the first IPv4 address on the first non-loopback interface.
 def get_addr(name):
+    # Timeout increased to 180s to account for slower boot times with Fedora guests
+    # on Debian hosts (SELinux permissive mode initialization takes longer).
+    timeout_seconds = int(os.environ.get("KDEVOPS_SSH_CONFIG_TIMEOUT", "180"))
     attempt = 0
     while True:
         attempt += 1
-        if attempt > 60:
-            raise Exception(f"Unable to get an address for {name} after 60s")
+        if attempt > timeout_seconds:
+            raise Exception(f"Unable to get an address for {name} after {timeout_seconds}s. "
+                          f"VM may be taking longer to boot. Check 'virsh console {name}' for boot status.")
 
         result = subprocess.run(
             [

-- 
2.51.0