Output of this Packer template is Hyper-V Gen2 VM with Debian 10 that supports direct connection via vsock
thus no internet connectivity is needed.
$key = "$env:USERPROFILE\.ssh\lab01_rsa"
$publicKey = Get-Content "$($key).pub"
packer build -force -var "ssh_key=$($publicKey)" packer-debian-10.json
$vmName = "packer-deb-buster-tpl"
$key = "$env:USERPROFILE\.ssh\lab01_rsa"
hvc ssh -oLogLevel=ERROR -oStrictHostKeyChecking=no -i $key "packer@$vmName"
Hello @mohamed3laa33, I am sorry for late response, you can find updated Packer template with inline definition of preferences in separate repo I created for templates https://github.com/microsoft/MSLab-templates/blob/main/templates/debian-11/debian-11.pkr.hcl#L105