[Feature Request]: Premade VHDs
Description
Does AutomatedLab have the capability to support premade VHDs? Microsoft publishes quite a few of these, and they could be a great way to get up and running quickly on an evaluation basis, without having to download or provide ISOs. One example is https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ and I've written some quick code to deploy this VM as a proof of concept.
#region download the VM
$currentUserDownloadsFolder = Join-Path -Path $env:USERPROFILE -ChildPath 'Downloads'
$transferParameters = @{
Source = 'https://aka.ms/windev_VM_hyperv'
Destination = Join-Path -Path $currentUserDownloadsFolder -ChildPath 'WindowsVM.zip'
}
if ((Test-Path -Path $transferParameters.Destination) -eq $false) {
Start-BitsTransfer @transferParameters
}
#endregion download the VM
#region extract the VM
$expandArchiveParameters = @{
Path = $transferParameters.Destination
DestinationPath = $currentUserDownloadsFolder
}
Expand-Archive @expandArchiveParameters
#endregion extract the VM
#region create the VM
$newVmParameters = @{
Name = 'Windows'
MemoryStartupBytes = 4GB
VHDPath = $vhdxFilePath
Generation = 2
}
$setVmParameters = @{
AutomaticCheckpointsEnabled = $false
DynamicMemory = $true
Passthru = $true
ProcessorCount = 2
}
$externalVmSwitch = Get-VMSwitch -SwitchType 'External' | Select-Object -First 1
New-VM @newVmParameters |
Set-VM @setVmParameters |
Start-VM -Passthru |
Get-VMNetworkAdapter |
Connect-VMNetworkAdapter -SwitchName $externalVmSwitch.Name
#endregion create the VM
I was just about to look at it, but the download page says: "Due to ongoing technical issues, as of October 23, 2024, downloads are temporarily unavailable."
The purpose of AL is to start virtual machines quickly. Once the base image has been created, it takes no more than 5 minutes to provision a machine and there are a variety of cmdlets provided by AL to customise the machine afterwards, e.g. to install Visual Studio.
It should be possible to add support for pre-built VMs to AL. However, there are some challenges. If the lab is not just a VM, how does networking work? Is it important to support Active Directory Domain Join?
What is your specific scenario?
Thanks for your reply. I don't have a specific scenario. I just thought it might help to use what's already easily available instead of the somewhat painful process of getting ISO files.
This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.
This issue has been automatically closed because it is has not had activity from the community in the last 40 days.