-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
login to guest example #22
Comments
Hi, If you are referring to login to the guest by establishing a mouse-keyboard-screen connection then you could use the AcquireTicket() method of a By using the acquired ticket in combination with the VMware Remote Console (VMRC) SDK you should be able to get a mouse-keyboard-screen session. I should also mention that I haven't tried that myself, but reading through the documentation you should be able to do so. Hope that helps. Regards, |
I'm actually thinking in terms of being able to leverage the guest tools to manipulate files on the guestvm. I've been looking at GuestOperationsManager. |
This is some sample code i'm running though. I'm having a hard time getting the NamePasswordAuthentication passed to the method. I'm just not sure how to create the auth object si = SmartConnect(host=host, user=username, pwd=password, port=443)
sc = si.RetrieveServiceContent()
pm = sc.guestOperationsManager.processManager
pm.ListProcesses(vm) --> TypeError: Required field "auth" not provided (not @optional) |
Hi, I see now what you are trying to do. Here is an example which shows how to login to a VM and get all processes:
When I run this script on my host here is the result:
Hope that helped you. Regards, |
Btw, I've just committed a new
And this command here will request additional process properties:
You can find Regards, |
That example made a breakthrough for me. As my original goal was to execute something on the vm this is what's needed to add on your example. # executes /bin/touch /tmp/hello.txt
cmdspec = pyVmomi.vim.vm.guest.ProcessManager.ProgramSpec(arguments='/tmp/hello.txt', programPath='/bin/touch')
# cmdoutput returns a pid
cmdoutput = si.content.guestOperationsManager.processManager.StartProgramInGuest(vm=vm, auth=creds, spec=cmdspec) I will have to checkout vPoller. Thank you!! |
Can I get an example for login to the remote vm console and run a command like pinging vcenter ip from the vm console ? |
"If you are referring to login to the guest by establishing a mouse-keyboard-screen connection then you could use the AcquireTicket() method of a VirtualMachine managed object." Can this be done in the case where we have to trigger keyboard action while installing live cd in the virtualmachine? (selecting options before actually os installation begin) |
I'm looking for an example on how to use pyvmomi to login to the guest.
As i understand i should be possible if the guest has vmwaretools installed.
Thanks.
The text was updated successfully, but these errors were encountered: