0

Problem Extract information from a Windows app running on host OS by using win32 APIs from inside of Virtual machine. Details I need to run a background job on a clients' machine and I want to script to be work on different windows versions. Currently I don't have the time/resources to test my scripts(python) on different windows versions. So I have decided to install a VM on the client machine and run my scripts inside the VM.

My question now is can my python script access windows of host OS while running inside the VM?

1 Answer 1

2

No you can't access the host Windows OS directly.

Depending on the used virtualization system you may access certain resources of the host such as:

  • Available network drives/TCP/UDP ports (requires at least Host-Only network between guest and host)
  • Certain files and folders on the host (requires "Shared folders" functionality to be configured and VirtualBox guest tools installed on guest os)
  • Certain USB devices (configure the USB device to be passed through to the guest os)

IMHO your approach with the VM is not recommendable. Usually Python scripts are not very sensitive to the used Windows version. The only parts that may change between the versions is the location of certain user or program files. But as there are effectively only two Windows versions left at the moment (Windows 8 and Windows 10 plus the correspondent server versions) the test effort is manageable.

3
  • Thanks for the reply Robert. Is docker any different in this respect ie; ability to call win32 APIs of the host OS? Packaging my scripts as a docker image is very convenient..
    – s3kv
    Commented Apr 14, 2020 at 15:14
  • @s3kv Sorry but I am not familiar with the Windows version of Docker and Windows based docker images. I still don't see the necessity for any virtualization or container system just to run a Python script on Windows.
    – Robert
    Commented Apr 14, 2020 at 15:19
  • no problem. To be more specific, my client machine doesn't have python installed, so I need to a way to package my scripts along with a python runtime to make it easier for non-technical clients to be able to install my package. Docker is one of the options I am considering for this. If docker does not work I will move on to other options like creating a windows exe which installs a python runtime and then run my scripts.
    – s3kv
    Commented Apr 14, 2020 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .