VMware Cloud Community
vin01
Expert
Expert
Jump to solution

Send Special Key Commands into the virtual machine which are not installed with vmwaretools

Is it possible to send commands into vms which are not configured with vmwaretools using invoke-vmscript?

I have some where listened in vmware world sessions given by William Lam.

If possible can some one share the cmdlets examples.

Regards Vineeth.K
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You are probably referring to William's VMkeystorkes.ps1 script in Automating VM keystrokes using the vSphere API & PowerCLI

It's as if you are typing at the console of the guest OS of the VM.

But it is not really fit for sending and running large scripts.

You also have to know where to send what.

I use that function in my Deploy Photon 2.0 – Part 1 post to reset the password of the root account of the Photon OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

5 Replies
daphnissov
Immortal
Immortal
Jump to solution

To my knowledge, they must have VMware Tools installed. Why would you *not* have VMware Tools installed? It's far more important than just being able to send keystrokes.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

You are probably referring to William's VMkeystorkes.ps1 script in Automating VM keystrokes using the vSphere API & PowerCLI

It's as if you are typing at the console of the guest OS of the VM.

But it is not really fit for sending and running large scripts.

You also have to know where to send what.

I use that function in my Deploy Photon 2.0 – Part 1 post to reset the password of the root account of the Photon OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

LucD
Leadership
Leadership
Jump to solution

Chip, my Photon deployment post shows at least 1 use case for being able to send key strokes.


When Photon comes up the 1st time it prompts for a new password.

Even though VMware Tools are installed, I can't use Invoke-VMScript to enter the new password.

That can only be done from the console.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

So then yes, Set-VMKeystrokes doesn't require VMware Tools to be installed or available since it's using an API method, but you do have a dependency on the version of vSphere (6.5 minimum).

0 Kudos
vin01
Expert
Expert
Jump to solution

Thanks The scripts shared are helpful.

Regards Vineeth.K
0 Kudos