Hello,

I would like to setup a Windows Vagrant box as a build bot for managing 
cross-platform application builds. The idea is to leverage Vagrant to 
compile systems programming language apps for C, C++, Rust, and the like, 
against a Windows target, regardless of which operating system the 
developer is using as host.

I've gotten pretty far with this, setting up a Windows Vagrant box that can 
do most of the critical Vagrant things, like running downstream user file 
and shell provisioning in their Vagrantfile's, and vagrant rsync source 
code into the guest. `vagrant ssh` successfully launches a Command Prompt 
session that runs commands entered in over an interactive tty.

Packer source:

https://github.com/mcandre/packer-templates/tree/8ec39984f5834ce8b8ebacdfcd63de0438154cc0/windows

It's awesome that `vagrant ssh` works for interactive typing, however I 
want to be able to send commands over `vagrant ssh -c <command>`, in order 
to automate the application build steps. When I do this with other boxes 
like Debian, MINIX, FreeBSD, and so on, then it works great as a CLI-driven 
workflow! Unfortunately, `vagrant ssh -c "echo hello"` does not appear to 
work out of the box (pun intended) for Windows guests. Instead of 
outputting "hello", this prints a bunch of blank lines and then hangs 
indefinitely. If I add a --no-tty flag, the output complains of a missing 
bash program.

I can imagine a number of workarounds, like setting up bash.exe (either 
from bash on Ubuntu on Windows, or Git Bash, or cygwin, or whatever). Or 
using `vagrant powershell` instead of `vagrant ssh`. But that would defeat 
the purpose of a cross-compilation VM, as this would require the host to 
also be Windows.

Does anyone know of a Vagrantfile or packer configuration to fix `vagrant 
ssh -c ...` for Windows guests? Or should I look into forking and patching 
Vagrant itself? It's silly that `vagrant ssh` launches a working Command 
Prompt session, but `vagrant ssh -c` fails (and defaults to bash!)

-- 
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 vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/5ce0e1a8-b484-49c2-a2f4-f13db6dd276f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to