en-US 0409:00000409 en-US en-US en-US D:\viostor\w10\amd64 E:\viostor\w10\amd64 F:\viostor\w10\amd64 D:\vioscsi\w10\amd64 E:\vioscsi\w10\amd64 F:\vioscsi\w10\amd64 D:\NetKVM\w10\amd64 E:\NetKVM\w10\amd64 F:\NetKVM\w10\amd64 OnError 0 true 1 EFI 260 2 MSR 16 3 Primary true 1 1 FAT32 2 2 3 3 C NTFS /IMAGE/INDEX 1 0 3 false OnError M7XTQ-FN8P6-TTKYV-9D4CC-J462D OnError true Silvio Dante Bada Bing! 1 Elevate admins without a UAC prompt reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f * Pacific Standard Time Silvio Dante Bada Bing! true false 1 2 0409:00000409 en-US en-US en-US true true true true true Work 3 mdwelcome true</PlainText> </AdministratorPassword> <LocalAccounts> <LocalAccount wcm:action="add"> <Name>silviodante</Name> <DisplayName>Silvio Dante</DisplayName> <Description>Local administrator for automated VM builds</Description> <Group>Administrators</Group> <Password> <Value>mdwelcome</Value> <PlainText>true</PlainText> </Password> </LocalAccount> </LocalAccounts> </UserAccounts> <!-- Persistent autologon. Drop LogonCount to 1 if you'd rather the VM land on a logon screen once provisioning finishes. --> <AutoLogon> <Enabled>true</Enabled> <Username>silviodante</Username> <LogonCount>999</LogonCount> <Password> <Value>mdwelcome</Value> <PlainText>true</PlainText> </Password> </AutoLogon> <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet> <!-- =============================================================== FIRST LOGON COMMANDS - run once, elevated, as silviodante. =============================================================== --> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <Description>Show file extensions</Description> <CommandLine>reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <SynchronousCommand wcm:action="add"> <Order>2</Order> <Description>Allow signed PowerShell scripts</Description> <CommandLine>powershell -NoProfile -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force"</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <!-- NetKVM has to be in place before anything can be downloaded, so the guest tools go on from the ISO first. Scans every drive for the installer rather than assuming a letter, since the VirtIO disc moves around post-install. Waits at most 15 minutes, so a stuck installer can never block the next step. --> <SynchronousCommand wcm:action="add"> <Order>3</Order> <Description>Install VirtIO guest tools</Description> <CommandLine>powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-Volume | Where-Object DriveLetter | ForEach-Object { $exe = $_.DriveLetter + ':\virtio-win-guest-tools.exe'; if (Test-Path $exe) { $p = Start-Process $exe -ArgumentList '/install','/quiet','/norestart' -PassThru; [void]$p.WaitForExit(900000) } }"</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> <!-- Provisioning: pulls oobe-vms.ps1 from the repo so the VM always gets the current version, retrying for ~2.5 minutes while the network comes up. If that fails, falls back to the copy of oobe-vms.ps1 baked into the root of the ISO. The script is saved to C:\ProgramData\OOBE and started elevated in its own window, so this step finishes as soon as it has launched it. The script installs the MeshCentral agent, applies the power/RDP/SSH settings and restarts the VM itself, so this must stay the LAST command. Step log: C:\ProgramData\OOBE\firstlogon.log (download / fallback / launch) Log: C:\ProgramData\OOBE\oobe-vms.log --> <SynchronousCommand wcm:action="add"> <Order>4</Order> <Description>Run oobe-vms.ps1 (url.isworking.fyi, else ISO copy)</Description> <CommandLine>powershell -NoProfile -ExecutionPolicy Bypass -Command "$d = Join-Path $env:ProgramData 'OOBE'; New-Item -ItemType Directory -Force $d | Out-Null; Start-Transcript (Join-Path $d 'firstlogon.log') -Append; [Net.ServicePointManager]::SecurityProtocol = 'Tls12'; $s = $null; for ($i = 1; $i -le 10; $i++) { try { $s = irm 'https://url.isworking.fyi/oobe-vms' -UseBasicParsing; 'Downloaded'; break } catch { 'Attempt ' + $i + ' failed: ' + $_; sleep 15 } }; if (-not $s) { $f = Get-PSDrive -PSProvider FileSystem | % { Join-Path $_.Root 'oobe-vms.ps1' } | ? { Test-Path $_ } | select -First 1; if ($f) { 'Using ' + $f; $s = Get-Content -Raw $f } }; if ($s) { $p = Join-Path $d 'oobe-vms.ps1'; Set-Content $p $s; Start-Process powershell -Verb RunAs -ArgumentList ('-NoProfile -ExecutionPolicy Bypass -File ' + $p); 'Started ' + $p } else { Write-Warning 'oobe-vms.ps1 not found online or on any drive'; sleep 60 }"</CommandLine> <RequiresUserInput>false</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands> </component> </settings> </unattend>