1

I'll get right into the point. The problem is:

  • my localmachine is a Windows OS
  • I launched a Windows Virtual Machine (through VirtualBox) that awaits some python commands
  • on my localhost I have a python script that I execute and
  • after the VM is started, I want the script to open inside the VM, a cmd.exe process
  • after cmd.exe opens up, the python script should send to that cmd.exe, inside the VM, the delete command "del c:\folder_name"

I did searched on various issue on StackOverflow that suggested me using subprocess.call or subprocess.Popen, but unfortunately none of them worked in my case, because I'm sure that all of the solutions were meant to work on localhost, and not inside a virtual machine, how I want it.

Any suggestions? Thank you.

PS: I'm trying to do this without installing other packages in host/guest.

UPDATE: Isn't there any solution, that will allow me to do this without installing something on VM ?!

Eugen
  • 785
  • 6
  • 22

1 Answers1

0

You can install an ssh server on the Windows machine and then use the paramiko module to communicate with it or you can also use wmi command to remotely execute command on Windows system.

nagato
  • 93
  • 5
  • thanks, I've updated the question. I'm trying to do this just with what I wrote .. trough python script and cmd.exe from VM. I don't want to install some other programs and stuff. All is done trough other scripts that start, control and close the VM, scripts execution and so on. So, for me, most useful would be if I can add some more instructions to do this. – Eugen Oct 26 '15 at 12:31