Skip to content
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

Does "knife vsphere vm execute VMNAME COMMAND ARGS" work for Windows Guest? #507

Open
yangpeng-chn opened this issue Oct 2, 2020 · 0 comments

Comments

@yangpeng-chn
Copy link

Hi,

I need to run several commands against my Windows Guest after cloning a VM from the template. I tried to configure "Run Once" in Customization Specification Manager from vSphere but it does not seem to work. Then I noticed I can run command on Guest with knife vsphere vm execute VMNAME COMMAND ARGS but it does not seem to work either. The error is:

knife vsphere vm execute HOSTNAME--exec-user ADMIN--exec-passwd PASSWORD -- C:\\Windows\\System32\\xcopy C:\\Windows\\System32\\drivers\\etc\\hosts C:\\tmp
ERROR: RbVmomi::Fault: FileNotFound: File C:\Windows\System32\xcopy was not found

I also tried the following but with no luck.

knife vsphere vm execute HOSTNAME--exec-user ADMIN--exec-passwd PASSWORD -- /C/Windows/System32/xcopy /C/Windows/System32/drivers/etc/hosts /C/tmp
knife vsphere vm execute HOSTNAME--exec-user ADMIN--exec-passwd PASSWORD -- C:\Windows\System32\xcopy C:\Windows\System32\drivers\etc\hosts C:\tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant