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

always hang at waiting for ssh #20

Closed
iamtutu opened this issue Oct 26, 2016 · 37 comments
Closed

always hang at waiting for ssh #20

iamtutu opened this issue Oct 26, 2016 · 37 comments

Comments

@iamtutu
Copy link

iamtutu commented Oct 26, 2016

when i build the metasploitable3 as expected after downloads etc. it always hang at waiting for ssh

@bcook-r7
Copy link
Contributor

What are the versions of all of the things (e.g. what OS are you bootstrapping on, etc.) ? It might be helpful if you posted more of the output.

@LonerVamp
Copy link

If you're building this on Windows, make sure you have the Microsoft Visual C++ 2010 Redistributable installed. I needed that to get past the SSH part of my installation.

@iamtutu
Copy link
Author

iamtutu commented Oct 27, 2016

@LonerVamp okay will try that.

@jbarnett-r7
Copy link
Contributor

Did installing Microsoft Visual C++ 2010 fix the issue for you? If so I will put a PR up to add that requirement to the docs and the build script.

@iamtutu
Copy link
Author

iamtutu commented Nov 2, 2016

@jbarnett-r7 actually havent tried. i could not install C++ 2010 as i had a later version installed, yet the same problem occured. I am using a Windows 10 Professional OS.

@ghost
Copy link

ghost commented Nov 6, 2016

I am having the same issue.

  • Using MacOS Sierra
  • just installed packer and vagrant
  • VBox is 5.1.8.

The script hangs at "waiting for SSH to become available". What other info do you need from me to get this rolling?

Edit: so I was trying the initial steps in the readme, but it looks like someone updated what I was looking at. using the build script (which highlighted I needed to RTFM about the Vagrant version) everything went through just fine.

@bcook-r7
Copy link
Contributor

Is this still an issue for anyone else? I'd like to close this if not.

@moj0x0
Copy link

moj0x0 commented Nov 16, 2016

I am seeing this issues as well. Attempting to build inside of the latest version of Kali Rolling. Running Virtualbox 5.1.6, Vagrant (I've tried both 1.8.6 & 1.8.7), Packer 0.10.1. Let me know if there is more info that you need. Thanks!

@GanbaruTobi
Copy link

Please be patient on this step, by having a look in the VM, i could see that it run the full windows installation while only showing "Waiting for SSH" in the script. On my PC it took around 10 Minutes to get new entries in my shell log(to finish the Windows installation).

@moj0x0
Copy link

moj0x0 commented Nov 17, 2016

Thank you for the feedback. I have let it sit at this step for several hours both on Vagrant 1.8.6 and 1.8.7 and it just stays there. Once I did find that Kali had rebooted, but the build had not completed. I'll keep trying things and report back if I find a solution.

@GanbaruTobi
Copy link

Have u tried to view the VM in progress? I'm not certain, but u might see something there.
Also you meantion using Virtualbox 5.1.6. Try the new Version maybe (5.1.8). Worked for me.

@moj0x0
Copy link

moj0x0 commented Nov 21, 2016

I was able to get my metasploitable3 built finally. I did end up using Virtualbox 5.1.8 (I had to change the build_win2008.sh file to accept the 5.1.8 version).

I viewed the VM in progress and saw that every time it would start to boot it would move to an "Aborted" state very quickly. I dug into the vagrant-windows_2008_r2.template and windows_2008_r2.json files and saw that it was trying to build a VM with a 60GB HDD and 2GB of RAM. The system I was building it on had only a 40GB HDD and 2GB of RAM total. I added a bigger HDD and increased it to 4GB RAM and the system built successfully.

Thanks @GanbaruTobi for the assist!!

Did I miss a list of system requirements?

@bcook-r7
Copy link
Contributor

Probably we've been testing on very beefy machines (big fast SSD's, etc.) and didn't realize that resources are constrained. It sounds like bumping the ram on the VM is probably the main thing we should do, because we're running a lot of resources in it.

@jbarnett-r7
Copy link
Contributor

@moj0x0 I just added some base system requirements to the README to point make it more apparent that those minimums are required. Thank you for the heads up on this.

@brut34orce
Copy link

I was having the same exact issue, but I found that setting the "boot_wait" variable to 10m in windows_2008_r2.json solved the issue. It seems that some systems are taking longer to boot than originally anticipated.

vbox 5.1.8, vagrant 1.8.7, packer 0.12.0, Kali rolling (~Debian Jessie)

@Phlogi
Copy link

Phlogi commented Dec 10, 2016

Same here, also I cannot rdp to the machine - the connection times out. OS X 10.11.6

@ragenkagen
Copy link

I am also getting timeout waiting for ssh. I have the following setup:

-OS X Sierra 10.12.1
-Vagrant 1.9.1
-Packer 0.12
-VirtualBox 5.1.10

Are there any logs anywhere that can be checked?

@ragenkagen
Copy link

I switched to my Windows box as a host system and had no problems at all. Vagrant, Packer and VirtualBox versions were the same as I had on my OS X Sierra system. I think there are more dependencies...

@Eenki
Copy link

Eenki commented Dec 13, 2016

I also encountered such a problem, I add the memory, decrease the size of the file, hope it useful

@Phlogi
Copy link

Phlogi commented Dec 13, 2016

What is the minim size for the disk? Can anyone check after its done (disk use)?

@jbarnett-r7
Copy link
Contributor

@Phlogi The recommended size for available space on the host machine is 65GB. The VM is created with a disk that requires 40GB, so the extra space gives wiggle room.

@sun9git
Copy link

sun9git commented Dec 16, 2016

hello,when i'a building packer,command output is waiting for ssh to become available.what should i do

@Phlogi
Copy link

Phlogi commented Dec 16, 2016

It worked for me after making sure there I enough free disk space and: I had to allow the download of the openssh.exe binary in my fw.

@derhornspieler
Copy link

Same issue: SSH hangs and times out.

MacOS Sierra 10.12.2 (16C67)
Version 5.1.10 r112026
Packer 0.12.1
Vagrant 1.9.1

Using ./build provided script.

@derhornspieler
Copy link

derhornspieler commented Dec 17, 2016

UPDATE @jbarnett-r7
Go into Windows Server VM

Go to C:\Program Files\OpenSSH\ and manually run ssh-agent.exe

This agent fails to start.

script resumed afterwards.

@jbarnett-r7
Copy link
Contributor

@derhornspieler Do you still have that build of the VM? Are there any errors on the VM that indicate why that failed to start? Maybe in the Windows Event Viewer?

@derhornspieler
Copy link

@jbarnett-r7 yes and not sure of any errors. Did not check that far.

@flyun8
Copy link

flyun8 commented Dec 21, 2016

I have the same problem in first, I download the os iso again, and can success to Connected to SSH! and can get the box file. When I do "vagrant box add the box file", I have an error and the script is break.

==> virtualbox-iso (vagrant): Creating Vagrant box for 'virtualbox' provider
virtualbox-iso (vagrant): Copying from artifact: output-virtualbox-iso\packer-virtualbox-iso-1482289063-disk1.vmdk
virtualbox-iso (vagrant): Copying from artifact: output-virtualbox-iso\packer-virtualbox-iso-1482289063.ovf
virtualbox-iso (vagrant): Renaming the OVF to box.ovf...
virtualbox-iso (vagrant): Using custom Vagrantfile: vagrantfile-windows_2008_r2.template
virtualbox-iso (vagrant): Compressing: Vagrantfile
virtualbox-iso (vagrant): Compressing: box.ovf
virtualbox-iso (vagrant): Compressing: metadata.json
virtualbox-iso (vagrant): Compressing: packer-virtualbox-iso-1482289063-disk1.vmdk
Build 'virtualbox-iso' finished.

==> Builds finished. The artifacts of successful builds are:
--> virtualbox-iso: 'virtualbox' provider box: windows_2008_r2_virtualbox.box
Box successfully built by Packer.
Attempting to add the box to Vagrant...
cmd.exe : Vagrant failed to initialize at a very early stage:
D:\metasploitable3-master\build_win2008.ps1:114 char: 5

  • cmd.exe /c vagrant box add metasploitable3 windows_2008_r2_virtua ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (Vagrant failed ...ry early stage::String) [], RemoteException
    • FullyQualifiedErrorId : NativeCommandError

@flyun8
Copy link

flyun8 commented Dec 21, 2016

System: windows 10 with the Microsoft Visual C++ 2013/2012(x86/x64)/2008(x86/x64) Redistributable.
virtualbox: 5.1.10
packerv: 0.12.1
vagrant: 1.9.1
vagrantreload: 0.0.1

@sersarov
Copy link

sersarov commented Jan 5, 2017

Same issue here.

Mac OSX 10.11.6
Virtualbox 5.1.12
Packer 0.12.1
Vagrant 1.9.1

I RDP'd to the box and manually ran ssh-agent.exe, but the build still times out at "Waiting for SSH..."

@Pai-Po
Copy link

Pai-Po commented Jan 8, 2017

i have fixed this problem. You should pen the box, and check if your openssh had been installed successfully and the command excutes successfully. My situation is OpenSSH can't download, because i access the website too slow using http request. so i download it first, then config a http server. Then change the content in file ".\scripts\installs\OpenSSH.ps1" to my url. Then it works. IIf some one need help. contact me.

@syeedshah
Copy link

SSH Timeout Error really guys after more than a year and you have not got a provisioning script that is robust and works. Your not exactly kicking the doors in with this new approach. I'll try the numerous fixes listed here but it might be quicker building my own env from scratch. Not happy Rapid7 =(

@jbarnett-r7
Copy link
Contributor

The SSH timeout errors are related to Packer/Vagrant and not a problem with Metasploitable itself. If you do some Google searching you will see this is a pretty general error.

Regardless, we're working on having a pre-built version for people to download if they're running into issues like this. As soon as PR #140 is landed we can make that available.

@syeedshah
Copy link

syeedshah commented Jun 16, 2017

When getting stuck on SSH I checked to see if the download had been sucessful. There was no SSH on the system. Checking network setting and I had not internet connectivity. Fixed this when first booting up by setting the network settings with a second adapter with hostonly. started the image and

←[1;32m==> virtualbox-iso: Typing the boot command...←[0m
←[1;32m==> virtualbox-iso: Waiting for SSH to become available...←[0m
←[1;32m==> virtualbox-iso: Connected to SSH!←[0m
←[1;32m==> virtualbox-iso: Uploading VirtualBox version info (5.1.18)←[0m
←[1;32m==> virtualbox-iso: Uploading VirtualBox guest additions ISO...←[0m
←[1;32m==> virtualbox-iso: Provisioning with shell script: ./scripts/installs/vm-guest-tools.bat←[0m```

unfortunately it now hangs on 

←[1;32m==> virtualbox-iso: Gracefully halting virtual machine...←[0m
←[0;32m    virtualbox-iso: Removing floppy drive...←[0m
←[1;32m==> virtualbox-iso: Preparing to export machine...←[0m
←[0;32m    virtualbox-iso: Deleting forwarded port mapping for the communicator (SSH, WinRM, etc) (host port 2724)←[0m
←[1;32m==> virtualbox-iso: Exporting virtual machine...←[0m
←[0;32m    virtualbox-iso: Executing: export packer-virtualbox-iso-1497635667 --output output-virtualbox-iso\packer-virt
ualbox-iso-1497635667.ovf←[0m```

and so it continues... 
p.s You guys(contributors) rock don't mind me I'm just a grumpy old man =|

@l0ca1h0st
Copy link

I have resolved it,I check vagrantfile-windows_2008_r2.template,found port map is 2222->22,and then I tried connect to localhost:2222 ,but I can't connect it!I check virtualbox port fordward.......I found the port is 2292:22! I did't know why this happend.But after I change the port map is 2222->22 manually, Press Eneter, it works!

@marm0ta
Copy link

marm0ta commented Dec 15, 2017

I solved the problem with this systems:
Ubuntu 16.04 64-bits
Virtualbox 5.1.18
Packer 1.0.0
Vagrant 1.9.2
When say "waiting for SSH" waiting till Windows Server Desktop appear this take several minutes.

@mathiasconradt mathiasconradt mentioned this issue Mar 4, 2020
@gubertoli
Copy link

I just created an issue on Vagrant GitHub due to this issue, I tried everything here and beyond but the Metasploitable box was unable to pass SSH connection:
hashicorp/vagrant#11553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests