From a4bb165f7cd5181bb3332ee4263f496c4d2711f5 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Fri, 19 Jun 2020 17:48:40 +0500 Subject: [PATCH 1/7] Add WSL --- images/win/Windows2019-Azure.json | 6 ++++++ .../win/scripts/Installers/Windows2019/Install-WSL1.ps1 | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index cf10a90330f7..35ec774f6d84 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -125,6 +125,12 @@ "{{ template_dir }}/scripts/Installers/Install-ContainersFeature.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL1.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "10m" diff --git a/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 b/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 new file mode 100644 index 000000000000..af1fa84b525f --- /dev/null +++ b/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 @@ -0,0 +1,8 @@ +################################################################################ +## File: Install-WSL1.ps1 +## Desc: Install Windows Subsystem for Linux +################################################################################ + +Write-Host "Install Windows Subsystem for Linux" + +Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux \ No newline at end of file From da6e6abcee67a5882009838ed06b4e9e12859a93 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Mon, 22 Jun 2020 20:15:57 +0500 Subject: [PATCH 2/7] Move WSL to the end of the provision --- images/win/Windows2019-Azure.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 35ec774f6d84..71c507e526f7 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -125,12 +125,6 @@ "{{ template_dir }}/scripts/Installers/Install-ContainersFeature.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL1.ps1" - ] - }, { "type": "windows-restart", "restart_timeout": "10m" @@ -666,6 +660,12 @@ "{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL1.ps1" + ] + }, { "type": "windows-restart", "restart_timeout": "10m" @@ -1068,4 +1068,4 @@ ] } ] -} \ No newline at end of file +} From eaeaf190bc59100ca4340a33a8619110c0904aac Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Wed, 24 Jun 2020 13:25:30 +0500 Subject: [PATCH 3/7] Add elevated_user --- images/win/Windows2019-Azure.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 71c507e526f7..772e55a56b5d 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -109,6 +109,14 @@ ], "execution_policy": "unrestricted" }, + { + "type": "powershell", + "elevated_user": "SYSTEM", + "elevated_password": "", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL1.ps1" + ] + }, { "type": "powershell", "scripts":[ @@ -660,12 +668,6 @@ "{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL1.ps1" - ] - }, { "type": "windows-restart", "restart_timeout": "10m" From dfae2775e93d234ff55534847b28b07a9a85b524 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Thu, 25 Jun 2020 12:18:04 +0500 Subject: [PATCH 4/7] No restart VM --- images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 b/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 index af1fa84b525f..e77668e6d7e4 100644 --- a/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 +++ b/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 @@ -5,4 +5,4 @@ Write-Host "Install Windows Subsystem for Linux" -Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux \ No newline at end of file +Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart \ No newline at end of file From 95c95e770ac1ee04a8b88995da2560a942d0506c Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Fri, 26 Jun 2020 13:42:02 +0500 Subject: [PATCH 5/7] Add Validation --- images/win/Windows2019-Azure.json | 6 ++++++ images/win/scripts/Installers/Validate-WSL.ps1 | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 images/win/scripts/Installers/Validate-WSL.ps1 diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 772e55a56b5d..24dac1bfffad 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -251,6 +251,12 @@ "{{ template_dir }}/scripts/Installers/Validate-Wix.ps1" ] }, + { + "type": "powershell", + "scripts":[ + "{{ template_dir }}/scripts/Installers/Validate-WSL.ps1" + ] + }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Validate-WSL.ps1 b/images/win/scripts/Installers/Validate-WSL.ps1 new file mode 100644 index 000000000000..83da69339b2b --- /dev/null +++ b/images/win/scripts/Installers/Validate-WSL.ps1 @@ -0,0 +1,14 @@ +################################################################################ +## File: Validate-WSL.ps1 +## Desc: Validate WSL CLI existst +################################################################################ + +if (Get-Command -Name 'wsl') +{ + Write-Host 'wsl is on path' +} +else +{ + Write-Host 'wsl not on path' + exit 1 +} From 71dacffa639d0d3732303c8fc14c6e3bc0f334af Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Tue, 30 Jun 2020 10:26:57 +0500 Subject: [PATCH 6/7] Add WSL note in Readme.md --- .../win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 6e643fcf0ef2..bc538c840842 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -22,6 +22,11 @@ $markdown += New-MDList -Style Unordered -Lines @( "Image Version: $env:ImageVersion" ) +$markdown += New-MDHeader "Enabled windows optional features" -Level 2 +$markdown += New-MDList -Style Unordered -Lines @( + "Windows Subsystem for Linux" +) + $markdown += New-MDHeader "Installed Software" -Level 2 $markdown += New-MDHeader "Language and Runtime" -Level 3 From 5f8c1f6fa16011d687358ab0858f8efad6a1e983 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Wed, 1 Jul 2020 13:27:45 +0500 Subject: [PATCH 7/7] Rename WSL1 to WSL --- images/win/Windows2019-Azure.json | 2 +- .../Windows2019/{Install-WSL1.ps1 => Install-WSL.ps1} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename images/win/scripts/Installers/Windows2019/{Install-WSL1.ps1 => Install-WSL.ps1} (92%) diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 24dac1bfffad..d5bf5f739bbe 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -114,7 +114,7 @@ "elevated_user": "SYSTEM", "elevated_password": "", "scripts":[ - "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL1.ps1" + "{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL.ps1" ] }, { diff --git a/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 b/images/win/scripts/Installers/Windows2019/Install-WSL.ps1 similarity index 92% rename from images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 rename to images/win/scripts/Installers/Windows2019/Install-WSL.ps1 index e77668e6d7e4..2e83a1b857a8 100644 --- a/images/win/scripts/Installers/Windows2019/Install-WSL1.ps1 +++ b/images/win/scripts/Installers/Windows2019/Install-WSL.ps1 @@ -1,5 +1,5 @@ ################################################################################ -## File: Install-WSL1.ps1 +## File: Install-WSL.ps1 ## Desc: Install Windows Subsystem for Linux ################################################################################