Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform on Bash on Ubuntu on Windows #6194

Closed
abosley opened this issue Apr 15, 2016 · 17 comments
Closed

Terraform on Bash on Ubuntu on Windows #6194

abosley opened this issue Apr 15, 2016 · 17 comments
Labels

Comments

@abosley
Copy link

abosley commented Apr 15, 2016

As an experiment, I attempted to run the Linux version of 0.6.14 on Bash on Ubuntu on Windows - a beta feature on Windows 10. Running terraform -v generates the following error:

runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: newosproc

runtime stack:
runtime.throw(0xfb3ab0, 0x9)
/opt/go/src/runtime/panic.go:530 +0x90
runtime.newosproc(0xc820026000, 0xc820035fc0)
/opt/go/src/runtime/os1_linux.go:149 +0x18c
runtime.newm(0x11a0d80, 0x0)
/opt/go/src/runtime/proc.go:1513 +0x135
runtime.main.func1()
/opt/go/src/runtime/proc.go:125 +0x2c
runtime.systemstack(0x1547800)
/opt/go/src/runtime/asm_amd64.s:291 +0x79
runtime.mstart()
/opt/go/src/runtime/proc.go:1048

goroutine 1 [running]:
runtime.systemstack_switch()
/opt/go/src/runtime/asm_amd64.s:245 fp=0xc820020770 sp=0xc820020768
runtime.main()
/opt/go/src/runtime/proc.go:126 +0x62 fp=0xc8200207c0 sp=0xc820020770
runtime.goexit()
/opt/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8200207c8 sp=0xc8200207c0

@jen20 jen20 added the windows label Apr 15, 2016
@jen20
Copy link
Contributor

jen20 commented Apr 15, 2016

Hi @abosley! Thanks for opening an issue here.

This is deep inside the Go runtime. Go is known to be problematic for system call translation - the experience of Joyent with Illumos LX zones shows that. This is not something we can fix in Terraform - it will require Microsoft to more accurately emulate Linux. Since this is currently preview software and way beyond our control, I'm going to close this issue for now - when there is a released version of Windows containing this functionality we can take another look.

In the meantime, there are native Windows binaries for Terraform released - the last version dramatically improved support for Windows.

@jen20 jen20 closed this as completed Apr 15, 2016
@jen20
Copy link
Contributor

jen20 commented Apr 16, 2016

I just found there is an "open" issue tracker for the system call translation on Windows - Terraform working seems to be contingent at least on this:

microsoft/WSL#158

We know there is nothing inherently in the Linux binaries for Terraform incapable of working with such systems in general, as it runs fine in an LX zone - so I think the solution here is to just wait and test again periodically.

@yeungs
Copy link

yeungs commented Oct 2, 2016

FYI, I downloaded Terraform version 0.7.4 of the Linux 64-bit for my bash on Ubuntu on Windows 10. I get this error with "resource aws_instance" with just terraform plan

_Error configuring: 1 error(s) occurred:

  • plugin exited before we could connect__

@yasserf
Copy link

yasserf commented Oct 27, 2016

I'm getting same issue with 0.7.7

Error configuring: 3 error(s) occurred:

* plugin exited before we could connect
* plugin exited before we could connect
* plugin exited before we could connect

@jen20
Copy link
Contributor

jen20 commented Oct 27, 2016

This is likely due to bugs in Windows' Linux subsystem handling of UNIX domain sockets, which plugins use on platforms that are not Windows.

@liquidghondi
Copy link

liquidghondi commented Nov 30, 2016

Bump. I too am having issues getting this running. Glad I'm not the only one trying :-)
Probably futile to try and ask on the MS developers forum,

@jen20
Copy link
Contributor

jen20 commented Dec 1, 2016

Hi @liquidghondi - probably the MS forum for the Linux subsystem (if there is one) is the only place anyone can assist with this. As the SmartOS system call table replacement shows, there is nothing in principle that stops this working - the Windows implementation is simply not finished.

@farmerbean
Copy link

Just found this issue as having Terraform 'problem' (not a problem). Then remembered I had this 'problem' a month ago and was on this page. Looking forward to Bash on Windows looking/working as well as/better than Cygwin in the near future so we can use tools like Terraform ftw, FTW!

@elocnatsirt
Copy link

Just ran into this, not liking this bash implementation as much as I'd hoped.

@panmanphil
Copy link

Still there with terraform 0.9.1 Here was the linux kernel info
Linux VM-xxxxxxx 3.4.0+ #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux

Too bad, would love for this to work.

@jen20
Copy link
Contributor

jen20 commented Mar 28, 2017

@panmanphil This is something you need to raise with Microsoft - their system call table implementation is not presenting correctly as Linux, otherwise this would work.

@panmanphil
Copy link

yep, no doubt. I just tried this on a windows insider build, version 15063 (stable ring). It works! Mileage may vary of course on a larger build with more resources, but a quick sample with a few s3 buckets worked about the same as on my mac.

@phils
Copy link

phils commented Apr 17, 2017

Seems to be working OK in the final official 'Creators Update' released recently. The only issue I have is that terraform sometimes takes a long time (10+ seconds) to return to the bash prompt after seemingly finishing its activities.

@jen20
Copy link
Contributor

jen20 commented Apr 17, 2017

My guess is this is related to one of two things: writing the state to disk (less likely) or something around the fork/exec that both provider plugins (in combination with domain sockets) and panicwrap use extensively. However, it sounds like good progress is being made, and this will eventually work correctly!

@panmanphil
Copy link

I was able to use it on a pretty large configuration with hundreds of resources and only ran into problems with some remote-exec ansible operations that requires some more tweaking. That used remote state so always has some delay at the end,

@ryankmcintyre
Copy link

Just finished installing on Creators update using Ubuntu 16.04, so far so good.

@ghost
Copy link

ghost commented Apr 13, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

10 participants