Skip to content

Commit 0801fb3

Browse files
heschigopherbot
authored andcommitted
env/windows-arm64/azure: update instructions
- Account for the new production environment - Use smaller, cheaper machines - Fix the antivirus instructions For golang/go#57408. Change-Id: I219677c570787a907d67763e0d88552ebdc142c4 Reviewed-on: https://go-review.googlesource.com/c/build/+/462516 Reviewed-by: Than McIntosh <[email protected]> Auto-Submit: Heschi Kreinick <[email protected]> Run-TryBot: Heschi Kreinick <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 13f4f0b commit 0801fb3

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

env/windows-arm64/azure/README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ Deployment VMs are set up with invocations of the following az CLI command:
3333
```
3434
az vm create \
3535
--name=MyNewVmName \
36-
--resource-group=dev_buildlets \
36+
--resource-group=<dev/prod>_buildlets \
3737
--admin-username=gopheradmin \
3838
--admin-password=<password from valentine> \
3939
--image=microsoftwindowsdesktop:windows11preview-arm64:win11-22h2-ent:latest \
40-
--nsg-rule=NONE \
41-
--size=Standard_D8ps_v5 \
42-
--subscription=<set subscription ID here> \
40+
--nsg=<dev/prod>_buildlets-security-group \
41+
--size=Standard_D4ps_v5 \
42+
--subscription=<Development/Production> \
4343
--public-ip-address ""
4444
```
4545

@@ -57,7 +57,8 @@ Once a VM has been created, you can apply Go-specific configuration to it by run
5757
az vm run-command invoke \
5858
--command-id=RunPowerShellScript \
5959
--name="MyNewVM" \
60-
--resource-group=dev_buildlets \
60+
--subscription=<Development/Production> \
61+
--resource-group=<dev/prod>_buildlets \
6162
--scripts @startup.ps1
6263
```
6364

@@ -67,25 +68,27 @@ Notes:
6768

6869
* output from the command is in JSON
6970
* exit status of the "az" command does NOT accurately reflect exit status of the powershell script.
71+
* errors about things already existing are expected
72+
73+
## First login
74+
75+
Log into the new builder as "gopher" at least once so as to go through the "initial login" Windows workflow. Find the VM in the Azure portal, and enter the login in the Bastion section. Choose "no" on all the setup prompts.
7076

7177
## Follow-ons to disable antivirus
7278

7379
In later versions of windows, it can be very difficult to completely disable the system's antivirus software, due to "features" such as [tamper protection](https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/prevent-changes-to-security-settings-with-tamper-protection?view=o365-worldwide), which make it almost impossible to programmatically turn off windows defender (and which ensure that any changes made are undone when the system reboots).
7480

75-
Running this command should help somewhat:
81+
Open Windows Security, Virus & threat protection, Manage settings, and turn off Tamper Protection. Then run this command:
7682

7783
```
7884
az vm run-command invoke \
7985
--command-id=RunPowerShellScript \
8086
--name="MyNewVM" \
81-
--resource-group=dev_buildlets \
87+
--subscription=<Development/Production> \
88+
--resource-group=<prod/dev>_buildlets \
8289
--scripts @antivirusadditions.ps1
8390
```
8491

85-
## First login
86-
87-
Log into the new builder as "gopher" at least once so as to go through the "initial login" Windows workflow.
88-
8992
## Builder key
9093

9194
Generate a builder key for the VMs according to the directions in [x/build/cmd/genbuilderkey](https://go.googlesource.com/build/+/fdfb99e1de1f68b555502056567be459d98a0e71/cmd/genbuilderkey/README.md).

env/windows-arm64/azure/antivirusadditions.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ Write-Host "Adding drive and process exclusions"
88

99
# Antivirus setup.
1010

11-
$drive = "C"
12-
13-
Add-MpPreference -ExclusionPath "$(drive):\" -ErrorAction SilentlyContinue
14-
Add-MpPreference -ExclusionProcess "$(drive):\*" -ErrorAction SilentlyContinue
11+
Add-MpPreference -ExclusionPath "C:\" -ErrorAction SilentlyContinue
12+
Add-MpPreference -ExclusionProcess "C:\*" -ErrorAction SilentlyContinue
1513

1614
Write-Host "Attempting to disable scanning engines via Set-MpPreference"
1715

0 commit comments

Comments
 (0)