# vmconnect.exe running in background service when we run with ansible

**URL:** <https://forum.ansible.com/t/vmconnect-exe-running-in-background-service-when-we-run-with-ansible/31495>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 21, 2019, 11:35am UTC](https://forum.ansible.com/t/vmconnect-exe-running-in-background-service-when-we-run-with-ansible/31495 "2019-10-21T11:35:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raviteja\_Jinkala](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@Raviteja\_Jinkala](https://forum.ansible.com/u/Raviteja_Jinkala)\
**Post date:** [October 21, 2019, 11:35am UTC](https://forum.ansible.com/t/vmconnect-exe-running-in-background-service-when-we-run-with-ansible/31495/1 "2019-10-21T11:35:49Z")

</div>

Hi All,

Need your guidance on vmconnect.exe on ansible.

I am trying to connect to new Virtual machine using vmconnect.exe in ansible with below playbook but it is running as service. Can you please help how can i run as foreground in windows.

This works fine when we run same command on powershell to connect VM.

- name: connect to VM  
win\_shell: vmconnect.exe localhost demomachine

also tried win\_scheduler\_task to connect but this also runs in background.

- name: Connect to VM  
win\_scheduled\_task:  
name: Interactive Process  
actions:
- path: vmconnect.exe localhost demomachine  
logon\_type: interactive\_token  
username: ansible

Thanks  
Raviteja
