VMware Cloud Community
chrischrischris
Enthusiast
Enthusiast
Jump to solution

How do I use PowerCLI to determine the exact Linux kernel version of a VM?

Hi all,

How do I use PowerCLI to determine the exact Linux kernel version of a VM?

Thanks in advance!

-Chris

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Do you have VMware Tools running in those VMs?

If yes, the Guest property will contain an indication if it is a Windows or Linux guest OS.

Based on that you can send a PowerShell or a Bash script to retrieve the exact guest OS version.


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

View solution in original post

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Do you have VMware Tools running in those VMs?

If yes, the Guest property will contain an indication if it is a Windows or Linux guest OS.

Based on that you can send a PowerShell or a Bash script to retrieve the exact guest OS version.


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

Reply
0 Kudos
chrischrischris
Enthusiast
Enthusiast
Jump to solution

Thanks Luc!

Is there any way to execute commands through VMware Tools for those VMs that I do not have a valid login for?

Interestingly, I'm gathering this info for our security team!

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Not afaik, you will have to provide GuestCredential on the Invoke-VMScript cmdlet.

Or call the Invoke-VMScript with an account that also has rights inside the guest OS.

If you don't, this for example

Get-VM MyVM | Invoke-VMScript -ScriptType Bash -ScriptText "uname -a"

will fail with this type of error

sspi.png


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

Reply
0 Kudos
chrischrischris
Enthusiast
Enthusiast
Jump to solution

Thanks Luc!!

Reply
0 Kudos