Skip to content

Commit 4d2b959

Browse files
committed
Add .wslconfig to increase kernel boot timeout on Windows
Signed-off-by: Mario Loriedo <[email protected]>
1 parent 007661a commit 4d2b959

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

win_images/win_packaging.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,15 @@ Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Management-
3434
# Install WSL, and capture text output which is not normally visible
3535
$x = wsl --install; Check-Exit 0 1 # wsl returns 1 on reboot required
3636
Write-Host $x
37+
38+
# Add a WSL configuration file
39+
# The `kernelBootTimeout` configuration is to prevent CI/CD flakes
40+
# See https://github.com/microsoft/WSL/issues/13301#issuecomment-3367452109
41+
$wslConfigPath = "$env:UserProfile\.wslconfig"
42+
$wslConfigContent = @"
43+
[wsl2]
44+
kernelBootTimeout=300000 # 5 minutes
45+
"@
46+
Set-Content -Path $wslConfigPath -Value $wslConfigContent
47+
3748
Exit 0

0 commit comments

Comments
 (0)