From 6adcc74545ca148398e022fad738f50b5558c943 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 11 Dec 2023 12:48:19 +0100 Subject: [PATCH] Fix WSL in KVM --- profiles/Generic/Windows/Setup.ps1 | 4 ++-- profiles/KVM/Windows/Install.ps1 | 7 +++++++ profiles/KVM/Windows/Setup.ps1 | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 profiles/KVM/Windows/Install.ps1 create mode 100644 profiles/KVM/Windows/Setup.ps1 diff --git a/profiles/Generic/Windows/Setup.ps1 b/profiles/Generic/Windows/Setup.ps1 index 69b0081a..a0658739 100644 --- a/profiles/Generic/Windows/Setup.ps1 +++ b/profiles/Generic/Windows/Setup.ps1 @@ -1,5 +1,5 @@ #!/bin/pwsh -$env:WIN_COMPUTER_NAME = "win11"; -$env:SETUP_SCRIPT_NAME = [System.IO.Path]::GetRelativePath("$PSScriptRoot/../../..", "$PSScriptRoot/Install.ps1"); +$env:WIN_COMPUTER_NAME ??= "win11"; +$env:SETUP_SCRIPT_NAME ??= [System.IO.Path]::GetRelativePath("$PSScriptRoot/../../..", "$PSScriptRoot/Install.ps1"); . "$PSScriptRoot/../../../scripts/Windows/OS/Setup.ps1"; diff --git a/profiles/KVM/Windows/Install.ps1 b/profiles/KVM/Windows/Install.ps1 new file mode 100644 index 00000000..6a11e135 --- /dev/null +++ b/profiles/KVM/Windows/Install.ps1 @@ -0,0 +1,7 @@ +#!/bin/pwsh +function Initialize-Configuration { + # Hide update which prevents use of WSL in KVM + Get-WindowsUpdate -KBArticleID KB5032190 -Hide +} + +. "$PSScriptRoot/../../Generic/Windows/Install.ps1"; diff --git a/profiles/KVM/Windows/Setup.ps1 b/profiles/KVM/Windows/Setup.ps1 new file mode 100644 index 00000000..30157671 --- /dev/null +++ b/profiles/KVM/Windows/Setup.ps1 @@ -0,0 +1,4 @@ +#!/bin/pwsh +$env:SETUP_SCRIPT_NAME ??= [System.IO.Path]::GetRelativePath("$PSScriptRoot/../../..", "$PSScriptRoot/Install.ps1"); + +. "$PSScriptRoot/../../Generic/Windows/Setup.ps1";