1

I am provisioning a guest windows machine (both win7 and 10) with Vagrant and I want to start a process on the guest (the selenium server jar) that is visible to the guest. In other words, when the user logs into the gui I want the command window sitting there open running my jar.

How can I do this?

I've been able to start the process using vagrant's shell provisioning to run a ps1 file but it is always hidden when I log into the gui.

Here is the shell portion of my Vagrantfile:

win7.vm.provision "shell", path: "start_selenium.ps1", powershell_args: "-WindowStyle Normal"

And here is start_selenium.ps1:

$selenium_out = "C:\sel\selenium.jar"
$java = "C:\Program Files\Java\jre*\bin\java.exe"
Start-Process $java -ArgumentList '-jar', $selenium_out -WindowStyle normal
user2859458
  • 2,285
  • 1
  • 17
  • 27

1 Answers1

0

The process runs but it does not open in PowerShell window. If you look in task explorer you will see the Java process or you can check in PowerShell Get-Job

You can look at this question/answer to redirect the output of the java command in an output so you can review when the node connects to hub etc

Community
  • 1
  • 1
Frederic Henri
  • 51,761
  • 10
  • 113
  • 139