3
votes

This issue thread explains the problem I'm experiencing pretty well, though it's not related to a single cmd client: https://github.com/bliker/cmder/issues/347#issuecomment-111849036

This is for a Laravel Homestead instance and I'm running Homestead 2.1.6, I currently have the very latest versions of the Laravel/Homestead box, Vagrant, VirtualBox (to fix a separate issue with Windows 10).

Basically, when I SSH using "homestead ssh" into the VM, unless I'm actively typing into the command prompt, it times out after about 30 seconds of inactivity. The window stays open but it no longer accepts any input, other than the exit sequence mentioned in the link above.

This makes doing composer update virtually impossible (unless I type random characters to keep the connection alive).

I've tried multiple command line clients (windows cmd, git bash, cmder), I've installed different versions of VirtualBox and Vagrant several times, I tried using a separate instance of OpenSSH to connect instead and I've tried the ServerAliveInterval suggestion and I'm still experiencing this problem.

It's fine on my PC (also Windows 8.1) but on my Windows 8.1 laptop which is now running on Windows 10, I've not been able to get it working properly.

Any ideas?

EDIT: As I mentioned in my comments below I've tried the ServerAliveInterval command in a file called config in both ~/.ssh/ and also the cmder's config directory. Is this correct for Windows? Can I check if this config is being used?

5

5 Answers

2
votes

This may be a general problem with ServerAliveInterval in SSH configuration. I'm not using Windows so I don't know where (and if there is) a ssh_config file. If you'll find it please set something like that: ServerAliveInterval 10

Also I'm enabling this setting: ForwardAgent yes

2
votes

As indicated in this page: http://www.solarpolar.co.uk/laravel-homestead-setup-on-windows-7/ this can be circumvented by using vagrant.

First type vagrant global-status then a list of virtual machines will show:

$ vagrant global-status
id       name    provider   state   directory
--------------------------------------------------------------------------------------------------------
4d0a8c6  default virtualbox saved   C:/CarlosPC/vagrant_getting_started
57a7a6a  default virtualbox running C:/Users/CarlosPC/AppData/Roaming/Composer/vendor/laravel/homestead

note the id of the homestead virtual machine, in this case is 57a7a6a.

Second, do you ssh with the vagrant ssh command and the mentioned id, like this:

vagrant ssh 57a7a6a

And done! No more freezes.

1
votes

I had the same issue, though it only happened on a particular network. Something to do with their ISP's DNS provider.

I fixed it by using Google's public DNS servers 8.8.8.8.

Worth a shot.

1
votes

Turns out the freezing I described was an issue with using the "homestead ssh" command on Windows.

It's been described here: http://stagerightlabs.com/blog/running-homestead-2-on-windows

Running "vagrant up" works fine (once I rebuilt the machine using "vagrant up" instead). That problem had been driving me insane!

-1
votes

As Carlos mentioned, you can use:

vagrant ssh {vagrant_id}

or you can create an alias and use a single command without knowing the vagrant_id.

vi ~/.bashrc

paste these lines in:

alias homestead_ssh="homesteadSsh"
function homesteadSsh(){
        vagrant ssh $(vagrant global-status | grep homestead | awk '{print $1}')
}

save it, and run this to apply the changes

. ~/.bashrc

and now you can simply use homestead_ssh in your terminal.