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

Vagrant ssh throws winpty.exe file does not exist #9311

Closed
mesiarm opened this issue Dec 27, 2017 · 18 comments
Closed

Vagrant ssh throws winpty.exe file does not exist #9311

mesiarm opened this issue Dec 27, 2017 · 18 comments

Comments

@mesiarm
Copy link

mesiarm commented Dec 27, 2017

Vagrant version

2.0.1.

Host operating system

Windows 10 64-bit

Guest operating system

Ubuntu 64-bit

Expected behavior

After vagrant ssh connected screen should appear.

Actual behavior

It throws error:
Exec error: exec: "C:\HashiCorp\Vagrant\embedded\bin\cygwin\winpty.exe": file does not exist
When I opened cygwin dir I saw directories 32 a 64 there and both contains winpty.exe file

Steps to reproduce

  1. Run vagrant up in dir with Vagrantfile
  2. Run vagrant ssh
@briancain
Copy link
Member

@mesiarm - Could you please provide a gist link with the debug log? Thanks!

@rodrigobrim
Copy link

Same error here.

@ryanhalley
Copy link

How can I generate a debug log from this command?
The workaround is to open a powershell prompt in the same directory, then 'vagrant ssh' works for me.

@ryanhalley
Copy link

OK, that's interesting. I saw this thread #9027 which shows me the undocumented debug command, but also, shows that 'vagrant --debug ssh' does actually connect fine..

I'll acquire the debug log for you in a mo.

@ryanhalley
Copy link

Log: https://github.com/ryanhalley/vagrantssh

Since 'vagrant --debug ssh' works without an error, this may not help you.

@cjmcdonn
Copy link

Same error:
Exec error: exec: "C:\\HashiCorp\\Vagrant\\embedded\\bin\\cygwin\\winpty.exe": file does not exist

vagrant --debug ssh

It seems the winpty.exe and associated files have been moved one layer deeper in the file structure: C:\HashiCorp\Vagrant\embedded\bin\cygwin\64\winpty.exe

Copying the files up into cygwin fixes the original error but creates a new one:
C:/HashiCorp/Vagrant/bin/vagrant.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

@wsergio
Copy link

wsergio commented Jan 25, 2018

Copying the files up into cygwin fixes the original error but creates a new one:
C:/HashiCorp/Vagrant/bin/vagrant.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

That workaround works for me, but make sure to copy the right winpty.exe version: if you installed the 32-bit vagrant, you'll want to copy the C:\HashiCorp\Vagrant\embedded\bin\cygwin\32\winpty.exe.

@rodrigobrim
Copy link

Copy the files do not solved the problem:

[2018-01-30 09:48.09] ~/Vagrant/devstation
[brimr.BRITOLIVEFL596C] ➤ vagrant.exe ssh

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[2018-01-30 09:48.53] ~/Vagrant/devstation

Now, simply do nothing.

@rodrigobrim
Copy link

After upgrade (2.0.2):

[brimr.BRITOLIVEFL596C] ➤ vagrant.exe ssh
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/subprocess.rb:146:in rescue in execute': (216) (Vagrant::Util::Subprocess::LaunchError) from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/subprocess.rb:139:in execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/subprocess.rb:22:in execute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/ssh.rb:96:in exec'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/ssh_exec.rb:39:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_running.rb:16:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_accessible.rb:18:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_created.rb:16:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in block in run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in busy' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in action_raw' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:in block in action'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:184:in block in action' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in action'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/commands/ssh/command.rb:66:in block in execute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/plugin/v2/command.rb:238:in block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/plugin/v2/command.rb:232:in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/plugin/v2/command.rb:232:in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/commands/ssh/command.rb:46:in execute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/cli.rb:46:in execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/environment.rb:269:in cli' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/bin/vagrant:151:in

'

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[2018-01-30 11:42.43] ~/Vagrant/devstation
[brimr.BRITOLIVEFL596C] ➤

@neilluna
Copy link

neilluna commented Feb 6, 2018

See if you have an environment variable called VAGRANT_DETECTED_OS. Setting this was necessary to fix a Vagrant/Cygwin bug in earlier versions of Vagrant. Try removing this variable.

@neilluna
Copy link

neilluna commented Feb 6, 2018

Here is what fixed this issue for for me.

  • Do not copy the winpty executables up one level as suggested in earlier posts. Leave things where they were installed.
  • If you have the VAGRANT_DETECTED_OS variable set, then unset it. This should allow Vagrant to find winpty,exe inside the 32/64 subdirectories. VAGRANT_DETECTED_OS was used to address a Cygwin/Vagrant bug in earlier versions of Vagrant.
  • export VAGRANT_PREFER_SYSTEM_BIN=1. See Issues with shell when SSH-ing into Vagrant #9143 (comment)
  • Now try your vagrant ssh command.

@cjmcdonn
Copy link

cjmcdonn commented Feb 6, 2018

@neilluna nailed it. To save anyone else the search for unsetting environment variables:

  1. unset VAGRANT_DETECTED_OS
  2. export VAGRANT_PREFER_SYSTEM_BIN=1

Upon closer inspection, export VAGRANT_DETECTED_OS=cygwin was in my .bashrc, so I removed and replaced it with export VAGRANT_PREFER_SYSTEM_BIN=1.

@rodrigobrim
Copy link

The error continues:

[2018-02-07 08:19.32] /Vagrant/devstation
[brimr.BRITOLIVEFL596C] ➤ set | grep -i vagrant
PATH='/bin:/drives/c/Users/brimr/DOCUME
1/MobaXterm/slash/bin:/drives/c/windows:/drives/c/windows/system32:/drives/c/ProgramData/Oracle/Java/javapath:/drives/c/windows/system32:/drives/c/windows:/drives/c/windows/System32/Wbem:/drives/c/windows/System32/WindowsPowerShell/v1.0:/drives/c/Program Files (x86)/Common Files/EMC:/drives/c/Program Files/Intel/WiFi/bin:/drives/c/Program Files/Common Files/Intel/WirelessCommon:/drives/c/Program Files/Git/cmd:/drives/c/Program Files/Git/mingw64/bin:/drives/c/Program Files/Git/usr/bin:/drives/c/HashiCorp/Vagrant/bin:/drives/c/Program Files/Intel/WiFi/bin:/drives/c/Program Files/Common Files/Intel/WirelessCommon'
PWD=/home/mobaxterm/Vagrant/devstation
VAGRANT_PREFER_SYSTEM_BIN=1
WINPATH='C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Common Files\EMC;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon'


[2018-02-07 08:19.25] ~/Vagrant/devstation
[brimr.BRITOLIVEFL596C] ➤ vagrant.exe ssh
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/subprocess.rb:146:in rescue in execute': (216) (Vagrant::Util::Subprocess::LaunchError) from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/subprocess.rb:139:in execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/subprocess.rb:22:in execute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/ssh.rb:96:in exec'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/builtin/ssh_exec.rb:39:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_running.rb:16:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_accessible.rb:18:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_created.rb:16:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/warden.rb:34:in call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/builder.rb:116:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in block in run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/util/busy.rb:19:in busy' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/action/runner.rb:66:in run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:227:in action_raw' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:202:in block in action'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:184:in block in action' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/machine.rb:188:in action'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/commands/ssh/command.rb:66:in block in execute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/plugin/v2/command.rb:238:in block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/plugin/v2/command.rb:232:in each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/plugin/v2/command.rb:232:in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/plugins/commands/ssh/command.rb:46:in execute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/cli.rb:46:in execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/lib/vagrant/environment.rb:269:in cli' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.0.2/bin/vagrant:151:in

'

@rodrigobrim
Copy link

[2018-02-07 08:23.02] ~/Vagrant/devstation
[brimr.BRITOLIVEFL596C] ➤ vagrant.exe version
Installed Version: 2.0.2
Latest Version: 2.0.2

You're running an up-to-date version of Vagrant!

@ryanhalley
Copy link

ryanhalley commented Feb 7, 2018

Hi all. Problem resolved for me.

  1. I had the problem with Vagrant 2.0.1
  2. I did not already have VAGRANT_DETECTED_OS, so no change made.
  3. I already had VAGRANT_PREFER_SYSTEM_BIN=1, so no change made.
  4. I installed Vagrant 2.0.2, rebooted, ran 'vagrant plugin repair', 'vagrant up', then 'vagrant ssh' - problem is now gone.

Thanks for help.

@chrisroberts
Copy link
Member

@rodrigobrim What shell are you running vagrant within? Do you have an ssh executable installed on your system that is available in your PATH?

@chrisroberts
Copy link
Member

Hey there,

I am going to close this due to lack of response. If this is still occurring, please open a new issue and follow the provided issue template that appears when you click the "New Issue" button. This will help us in getting a reproduction and fix. Thanks! 😄

@ghost
Copy link

ghost commented Mar 30, 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 Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants