From fc30a377e89fc19665dc0180f74162bee90789e1 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Wed, 18 Jun 2025 20:26:14 +0200 Subject: [PATCH] oobe: wait for cloud-init to finish Let's wait for `cloud-init` to finish before we exit the OOBE; this ensures that any potential user has been created. In the future we might want to always continue with our OOBE, in those cases that `cloud-init` didn't create a user we can then continue with the prompt(s). Signed-off-by: Simon de Vlieger --- wsl-oobe.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wsl-oobe.sh b/wsl-oobe.sh index b55e831..b246933 100644 --- a/wsl-oobe.sh +++ b/wsl-oobe.sh @@ -12,7 +12,8 @@ set -ueo pipefail DEFAULT_USER_ID=1000 if systemctl is-enabled cloud-init.service > /dev/null ; then - echo 'cloud-init is enabled, skipping user account creation' + echo 'cloud-init is enabled, skipping user account creation. Waiting for cloud-init to finish.' + cloud-init status --wait > /dev/null 2>&1 exit 0 fi