PowerShell: Connecting to a Virtual Machine

Quick and easy, with a small caveat or two…This is the command to connect to a local Virtual Machine on a Windows 10 system;

& "C:\windows\System32\vmconnect.exe" localhost slc-dc01

You can connect to a remote Hyper-V host (by changing localhost) and the name of the VM is at the end (slc-dc01).  You can also replace the VM name at the end with -G [GUID] if you know the GUID of the VM you want to connect to.

There are other versions of the vmconnect program included for use on other Operating Systems.  If you’re having no joy with that version of vmconnect look in C:\Program Files\Hyper-V (or wherever it is installed to).  There’s subfolders with different versions of the vmconnect software in there.

The final thing I discovered is that connecting to a VM from the Hyper-V Manager doesn’t require additional authorisation but running vmconnect does.  Only administrators or members of the Hyper-V Administrators local group can access them so you either need to be a member of either of those groups OR run the command from a PowerShell window you’ve run as an admin.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: