WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
    • VMware Cloud Foundation 9
  • VKS
  • Homelab
    • Hardware Options
    • Hardware Reviews
    • Lab Deployment Scripts
    • Nested Virtualization
    • Homelab Podcasts
  • VMware Nostalgia
  • Apple
You are here: Home / vSphere / Generating a vSphere UI link to a specific Virtual Machine

Generating a vSphere UI link to a specific Virtual Machine

04.05.2023 by William Lam // 4 Comments

For some organizations, after a VM has been provisioned, it is customary to send a notification (email, slack, etc) to their end users with login credentials including the URL for the vSphere UI.

Typically, the provided URL is just the vCenter Server base URL and end users would then have to login and navigate to their specific VM(s) within the vSphere Inventory. A question was brought up on whether a better end user experience could be provided to their internal users? They were interested in providing their end users with a specific URL link that would take them directly to their VM, which they can also bookmark for future uses.

Furthermore, the customer was also interested in generating the URL programmatically, so that it can be incorporated into their existing provisioning workflows.

This can easily be achieved as each inventory object in the vSphere UI has a unique URL. For the purpose of this blog post, I will primarily be focusing on the VM inventory object, which can exists under the Hosts/Clusters view or VM/VM Templates view, but the concept will apply to other vSphere Inventory objects.

Under the Hosts/Clusters view, the URL for a VM would look like the following: https://vcsa.primp-industries.local/ui/app/vm;nav=h/urn:vmomi:VirtualMachine:vm-40043:056a402b-2b3d-4f74-93f7-fa818adff697/summary

Under the VM/VM Template view, the URL for a VM would look like the following: https://vcsa.primp-industries.local/ui/app/vm;nav=v/urn:vmomi:VirtualMachine:vm-40043:056a402b-2b3d-4f74-93f7-fa818adff697/summary

As you can see from both URLs above, the only difference is the "nav=" key that specifies whether the view is in the Hosts/Clusters (h) or VM/VM Templates (v) and the rest of the URL is the same including the VM Managed Object Reference (MoRef) ID in blue and the vCenter Server Instance UUID in orange.

With all of this information, we can easily automate the generation of the URL for a specific VM within the vSphere UI. To demonstrate this, we will be using the vSphere API and consuming that through PowerCLI with the following snippet:

$vmName = "Rocky-Linux-9"
$uiView = "v"

$vcHostname = $global:DefaultVIServer.name
$vcInstanceUUID = $global:DefaultVIServer.InstanceUuid
$vmId = ((Get-VM $vmName).id).replace("VirtualMachine-","VirtualMachine:")

Write-Host "https://${vcHostname}/ui/app/vm;nav=${uiView}/urn:vmomi:${vmId}:${vcInstanceUUID}/summary"

Note: Users will still need to login to vCenter Server even with the direct link to their VM and if they do not have the appropriate permissions, they will not be able to view or do anything.

Categories // vSphere Tags // vSphere UI

Comments

  1. *protectedhenketh says

    04/06/2023 at 1:02 am

    Where do I find the "VM Managed Object Reference (MoRef) ID and the vCenter Server Instance UUID" for a specific VM?

    Reply
    • William Lam says

      04/06/2023 at 10:29 am

      Did you take a look at the blog post, the details are there 🙂

      Reply
  2. *protectedanon says

    11/14/2025 at 8:33 am

    It would be nice to have the means to provide the actual name of the host in place of the "MoRef"

    Reply
    • William Lam says

      11/14/2025 at 8:46 am

      There's a reason for using a MoRef, as thats the only reliable/stable Id within a vCenter Server since the hostname can change and similarly for other resources with labels.

      Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Installing Realtek Network Driver Fling using Free ESXi 8.0 Update 3e ISO 02/05/2026
  • Modern Kubernetes Visualization using Radar 02/01/2026
  • Bypassing the ESX Tunnel Endpoint (TEP) 1600 MTU Check in the VCF Installer 01/29/2026
  • Quick Tip - NSX Edge fails DNS pre-check as part of VCF 9.0.2 Upgrade 01/23/2026
  • Quick Tip - No space left on device when upgrading VCF Operations using VCF Operations Fleet Manager to VCF 9.0.2 01/22/2026

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.

To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2026

 

Loading Comments...