Running a Python script on a Win10

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Running a Python script on a Win10

vagrantfp
Hi,

I am having difficulties running a Python script on a Win10 box - "talisker/windows10pro" (I tried different boxes, all are acting the same).

MY VAGRANT FILE:
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

   config.vm.define "win10" do |win10|
     win10.vm.box = "talisker/windows10pro"
     win10.vm.provision :shell, :inline => "C:\\Users\\vagrant\\Desktop\\brow.py", privileged: true
   end

 # ENABLE GUI WHEN MACHINE IS BOOTING
   config.vm.provider "virtualbox" do |v|
     v.gui = true
   end
end

The script is present on the box, Python is installed and I am able to run it when connected to the VM/box itself.
The issue happens when I try to run "vagrant provision".

It seems that every time I run the "vagrant provision" command, a popup window jumps on the Win machine saying "The Scheduled logoff is canceled"

Any assistance will be much much appreciated!!!


BTW, I have this exact setup on several Linux machines and everything works fine.



Thanks.
Avi.




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a4b9b649-3ae1-406a-869b-53884fccf42c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Running a Python script on a Win10

Alvaro Miranda Aguilera
Hello

Can you try this:


This repo can run a python script (will install it if not there)

I am not sure will be able to run with a provisioning scrip a desktop task as there is no desktop if there is no auto login.


Thanks
Alvaro

On Mon, Dec 4, 2017 at 3:07 PM, <[hidden email]> wrote:
Hi,

I am having difficulties running a Python script on a Win10 box - "talisker/windows10pro" (I tried different boxes, all are acting the same).

MY VAGRANT FILE:
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

   config.vm.define "win10" do |win10|
     win10.vm.box = "talisker/windows10pro"
     win10.vm.provision :shell, :inline => "C:\\Users\\vagrant\\Desktop\\brow.py", privileged: true
   end

 # ENABLE GUI WHEN MACHINE IS BOOTING
   config.vm.provider "virtualbox" do |v|
     v.gui = true
   end
end

The script is present on the box, Python is installed and I am able to run it when connected to the VM/box itself.
The issue happens when I try to run "vagrant provision".

It seems that every time I run the "vagrant provision" command, a popup window jumps on the Win machine saying "The Scheduled logoff is canceled"

Any assistance will be much much appreciated!!!


BTW, I have this exact setup on several Linux machines and everything works fine.



Thanks.
Avi.




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a4b9b649-3ae1-406a-869b-53884fccf42c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezSfMG0zu7%3DEfCp9jaM2j%2BLg4YVEOSYxPn4SeCj0_gZHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Running a Python script on a Win10

vagrantfp
Hi Alvaro,

First, thanks for taking the time to look into it.

Regarding running a desktop task, I noticed that every time I run "vagrant provision", a popup window jumps saying that the "scheduled log off is canceled".
About the login, while I'm running the provision, the box is up and logged-in.

Not sure if I mentioned or not, but on Linux machines it works perfectly.
Looks like something is blocking the provisioning (I even tried to disable Firewall and such).

Please let me know if you have any ideas on how to run the Desktop task.

Thanks!! 




On Tue, Dec 5, 2017 at 9:30 AM, Alvaro Miranda Aguilera <[hidden email]> wrote:
Hello

Can you try this:


This repo can run a python script (will install it if not there)

I am not sure will be able to run with a provisioning scrip a desktop task as there is no desktop if there is no auto login.


Thanks
Alvaro

On Mon, Dec 4, 2017 at 3:07 PM, <[hidden email]> wrote:
Hi,

I am having difficulties running a Python script on a Win10 box - "talisker/windows10pro" (I tried different boxes, all are acting the same).

MY VAGRANT FILE:
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

   config.vm.define "win10" do |win10|
     win10.vm.box = "talisker/windows10pro"
     win10.vm.provision :shell, :inline => "C:\\Users\\vagrant\\Desktop\\brow.py", privileged: true
   end

 # ENABLE GUI WHEN MACHINE IS BOOTING
   config.vm.provider "virtualbox" do |v|
     v.gui = true
   end
end

The script is present on the box, Python is installed and I am able to run it when connected to the VM/box itself.
The issue happens when I try to run "vagrant provision".

It seems that every time I run the "vagrant provision" command, a popup window jumps on the Win machine saying "The Scheduled logoff is canceled"

Any assistance will be much much appreciated!!!


BTW, I have this exact setup on several Linux machines and everything works fine.



Thanks.
Avi.




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a4b9b649-3ae1-406a-869b-53884fccf42c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/Nv41YNyzHGo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezSfMG0zu7%3DEfCp9jaM2j%2BLg4YVEOSYxPn4SeCj0_gZHQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHsFPZUmyCys%3DwSJhoh8ycUAYfz%2BREXJdUP9QHVq1sqs_%2BtzDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Running a Python script on a Win10

Alvaro Miranda Aguilera
hello
vagrant provisions over winrm that uses a administrative interface that is not the desktop user, and even the desktop is not even logged in.

so 2 problems to solve.

1. enable autologin so there is something in the console
2. make some sort of wrapper that make the command run over the desktop user.

i tried a simple powershell that just open the browser:


for what has been designed it works. provision and run cli scripts.

Alvaro.


On Tue, Dec 5, 2017 at 9:35 AM, Vagrant Vagrant <[hidden email]> wrote:
Hi Alvaro,

First, thanks for taking the time to look into it.

Regarding running a desktop task, I noticed that every time I run "vagrant provision", a popup window jumps saying that the "scheduled log off is canceled".
About the login, while I'm running the provision, the box is up and logged-in.

Not sure if I mentioned or not, but on Linux machines it works perfectly.
Looks like something is blocking the provisioning (I even tried to disable Firewall and such).

Please let me know if you have any ideas on how to run the Desktop task.

Thanks!! 




On Tue, Dec 5, 2017 at 9:30 AM, Alvaro Miranda Aguilera <[hidden email]> wrote:
Hello

Can you try this:


This repo can run a python script (will install it if not there)

I am not sure will be able to run with a provisioning scrip a desktop task as there is no desktop if there is no auto login.


Thanks
Alvaro

On Mon, Dec 4, 2017 at 3:07 PM, <[hidden email]> wrote:
Hi,

I am having difficulties running a Python script on a Win10 box - "talisker/windows10pro" (I tried different boxes, all are acting the same).

MY VAGRANT FILE:
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

   config.vm.define "win10" do |win10|
     win10.vm.box = "talisker/windows10pro"
     win10.vm.provision :shell, :inline => "C:\\Users\\vagrant\\Desktop\\brow.py", privileged: true
   end

 # ENABLE GUI WHEN MACHINE IS BOOTING
   config.vm.provider "virtualbox" do |v|
     v.gui = true
   end
end

The script is present on the box, Python is installed and I am able to run it when connected to the VM/box itself.
The issue happens when I try to run "vagrant provision".

It seems that every time I run the "vagrant provision" command, a popup window jumps on the Win machine saying "The Scheduled logoff is canceled"

Any assistance will be much much appreciated!!!


BTW, I have this exact setup on several Linux machines and everything works fine.



Thanks.
Avi.




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a4b9b649-3ae1-406a-869b-53884fccf42c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/Nv41YNyzHGo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezSfMG0zu7%3DEfCp9jaM2j%2BLg4YVEOSYxPn4SeCj0_gZHQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHsFPZUmyCys%3DwSJhoh8ycUAYfz%2BREXJdUP9QHVq1sqs_%2BtzDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezj5wF1C9yx58-g6yB6xcLv7nL%2BLc%3DG_0AkhKsLouM8dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Running a Python script on a Win10

vagrantfp
Hi Alvaro,

1. Auto-login is enabled on my box.
2. Not sure how to do that. I created a second user with no Admin rights, but still having the same issue.

Can you please share the setup you used above?


Thanks.

On Tue, Dec 5, 2017 at 3:07 PM, Alvaro Miranda Aguilera <[hidden email]> wrote:
hello
vagrant provisions over winrm that uses a administrative interface that is not the desktop user, and even the desktop is not even logged in.

so 2 problems to solve.

1. enable autologin so there is something in the console
2. make some sort of wrapper that make the command run over the desktop user.

i tried a simple powershell that just open the browser:


for what has been designed it works. provision and run cli scripts.

Alvaro.


On Tue, Dec 5, 2017 at 9:35 AM, Vagrant Vagrant <[hidden email]> wrote:
Hi Alvaro,

First, thanks for taking the time to look into it.

Regarding running a desktop task, I noticed that every time I run "vagrant provision", a popup window jumps saying that the "scheduled log off is canceled".
About the login, while I'm running the provision, the box is up and logged-in.

Not sure if I mentioned or not, but on Linux machines it works perfectly.
Looks like something is blocking the provisioning (I even tried to disable Firewall and such).

Please let me know if you have any ideas on how to run the Desktop task.

Thanks!! 




On Tue, Dec 5, 2017 at 9:30 AM, Alvaro Miranda Aguilera <[hidden email]> wrote:
Hello

Can you try this:


This repo can run a python script (will install it if not there)

I am not sure will be able to run with a provisioning scrip a desktop task as there is no desktop if there is no auto login.


Thanks
Alvaro

On Mon, Dec 4, 2017 at 3:07 PM, <[hidden email]> wrote:
Hi,

I am having difficulties running a Python script on a Win10 box - "talisker/windows10pro" (I tried different boxes, all are acting the same).

MY VAGRANT FILE:
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

   config.vm.define "win10" do |win10|
     win10.vm.box = "talisker/windows10pro"
     win10.vm.provision :shell, :inline => "C:\\Users\\vagrant\\Desktop\\brow.py", privileged: true
   end

 # ENABLE GUI WHEN MACHINE IS BOOTING
   config.vm.provider "virtualbox" do |v|
     v.gui = true
   end
end

The script is present on the box, Python is installed and I am able to run it when connected to the VM/box itself.
The issue happens when I try to run "vagrant provision".

It seems that every time I run the "vagrant provision" command, a popup window jumps on the Win machine saying "The Scheduled logoff is canceled"

Any assistance will be much much appreciated!!!


BTW, I have this exact setup on several Linux machines and everything works fine.



Thanks.
Avi.




--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a4b9b649-3ae1-406a-869b-53884fccf42c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/Nv41YNyzHGo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezSfMG0zu7%3DEfCp9jaM2j%2BLg4YVEOSYxPn4SeCj0_gZHQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHsFPZUmyCys%3DwSJhoh8ycUAYfz%2BREXJdUP9QHVq1sqs_%2BtzDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/Nv41YNyzHGo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezj5wF1C9yx58-g6yB6xcLv7nL%2BLc%3DG_0AkhKsLouM8dw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHsFPZV_M3%2Bu_3pMdWkJ3K3V4tNEra%3DTtrcbZNZWpvgu1SShrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Running a Python script on a Win10

Alvaro Miranda Aguilera
Just did a PS script


cat test2.bat 

echo "hello from bat in windows"

powershell C:\vagrant\test2.ps1

cat test2.ps1 



$username = 'vagrant'

$password = 'vagrant'


$securePassword = ConvertTo-SecureString $password -AsPlainText -Force

$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword

Start-Process -Path "http://www.microsoft.com/"-Credential $credential


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ex2B7-ZQ%2B3b-9YW%3DKeBpnGnqgsTwgdaqwULmo83yWTJ4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.