This script provisions a Gen 2 Ubuntu 22.04 VM pre-configured for DVLS development on Linux. It uses the Ubuntu Server installer ISO for unattended installation, then provisions the VM over SSH.
qemu-img is required to create the VHDX disk image. Install it via Chocolatey:
choco install qemu -yThen ensure qemu-img is available in your PATH:
qemu-img --versionDownload the Ubuntu 22.04 Server ISO and copy it to C:\Hyper-V\ISOs\ubuntu-22.04.5-live-server-amd64.iso:
https://releases.ubuntu.com/22.04/ubuntu-22.04.5-live-server-amd64.iso
Hyper-V must be enabled with an internal switch named LAN Switch. Run the following to check available switches and update $SwitchName in the script if needed:
Get-VMSwitch | Select-Object NameThe router VM must be running before provisioning, as the script checks reachability of 10.10.0.2:
Start-VM -Name 'IT-HELP-RTR'- A blank VHDX is created and the Ubuntu installer ISO + seed ISO are attached as DVD drives.
- The VM boots from the installer ISO (VHDX is blank, UEFI falls through to the DVD).
- The installer picks up the autoinstall config from the seed ISO (labeled
cidata) and installs Ubuntu unattended (~10-15 min). - After reboot, the script waits for SSH to become available.
- A provisioning script is uploaded via SCP and executed over SSH, installing .NET, PowerShell, and setting up the DVLS service account.
Run from an elevated PowerShell prompt inside the powershell directory:
.\dev_dvls_linux_vm.ps1Once done, connect with:
ssh devuser@10.10.0.10The provisioning script writes logs on the VM:
# Full provisioning output
cat /var/log/provision.log
# Verification summary
cat /var/log/provision-verify.logOr verify each component manually:
dotnet --info
pwsh --version
git --version
curl --version
wget --version
openssl version
id dvls
ls /opt/devolutions/dvls
systemctl status dvls