Deploy VMware Unified Access Gateway on Hyper-V using powershell

Running VMware Unified access gateway (UAG) on Hyper-V is one of supported deployments scenarios of UAG , for Horizon use case you may have DMZ servers hosted in Hyper-V and  workspace one use case you may have the Internal servers running on hyper V , so how to deploy it

Requirements

  1. Download files.
  • Unifed Access Gateway (UAG) 2303 PowerShell scripts to get all scripts to deploy the appliance
  • Unifed Access Gateway (UAG) 2303 for Microsoft Azure to have .vhd file so Hyper-V disk format file.
  • Convert the vhd file to vhdx : to convert vhd to vhdx , we will use “Convert-VHD” command in powershell

Note: if the command not found , run the following command :

  • Add-WindowsFeature RSAT-Hyper-V-Tools –IncludeAllSubFeature
  • Import-Module ServerManager
  • Then restart the server

To convert vhd to vhdx

Convert-VHD <source .vhd>  <distnation .vhdx>

Convert-VHD  euc-unified-access-gateway-23.03.0.0-21401666_OVF10.vhd euc-unified-access-gateway-23.03.0.0-21401666_OVF10.vhdx

  • Deploy the vhdx file

From the powershell scripts we need  “uagdeploy.ps1 ” and “uag9-awhv.ini”

Create folder UAG under c:\ and copy 3 files to this path

– euc-unified-access-gateway-23.03.0.0-21401666_OVF10.vhdx

– uagdeploy.ps1

– uag9-awhv.ini

And now we can edit the uag9-awhv.ini file to deploy the Appliance  (replace the file content with the below )

[General]

# UAG virtual appliance unique name (between 1 and 32 characters).

# If name is not specified, the script will prompt for it.

name=UAG9

# Full path filename of the UAG Hyper-V .vhdx virtual machine image

source=C:\UAGs\euc-unified-access-gateway-23.03.0.0-21401666_OVF10.vhdx

# Hyper-V datastore folder

ds=E:\Hyper-V\Virtual Hard Disks

# Hyper-V Network names. (assume UAG with single NIC and will connect to” VM Network” )

netInternet=VM Network

netManagementNetwork=VM Network

netBackendNetwork=VM Network

# UAG Network configuration.

dns=192.168.0.1

defaultGateway=192.168.0.1

deploymentOption=onenic

ip0=192.168.0.101

netmask0=255.255.255.0

#additional settings

#enable SSH

sshEnabled=true

sshPasswordAccessEnabled=true

# Enter a customized username of the high privilege user #during Unified Access Gateway deployment.

#Maximum length of the username is 32 characters and can be a #combination of a-z, 0-9, underscore _ and, hyphen -.

#When this user is configured, the root login is deactivated.

# refer to https://docs.vmware.com/en/Unified-Access-Gateway/2303/uag-deploy-config/GUID-08347D7E-1AE3-492C-995C-90AB7861789D.html#GUID-08347D7E-1AE3-492C-995C-90AB7861789D

#we are creating super user instead of root named uemadmin

osLoginUsername =uemadmin

Once edited for our environment we can launch the deployment :

set-executionpolicy - unrestricted

cd C:\UAG

.\uagdeploy.ps1 -iniFile  uag9-awhv.ini

And check at the end that everything’s ok , the deployment will start and you will be prompted to enter password for uemadmin and admin account

Leave a Reply

Your email address will not be published. Required fields are marked *