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 stuck on line SSH auth method: private key #2462

Closed
hamacekh opened this Issue Oct 10, 2016 · 45 comments

Comments

Projects
None yet
@hamacekh

hamacekh commented Oct 10, 2016

vagrant up gets always stuck on line SSH auth method: private key. My config.yaml is unchanged generated from puphpet. Box choice doesnt seem to matter. Using virtualbox 5.0.24 on Ubuntu 16.04 LTS with vagrant 1.8.1. Tried it with latest 1.8.6 and didnt help.
My config.yaml file follows:

vagrantfile:
    target: local
    vm:
        provider:
            local:
                box: puphpet/ubuntu1604-x64
                box_url: puphpet/ubuntu1604-x64
                box_version: '0'
                chosen_virtualizer: virtualbox
                virtualizers:
                    virtualbox:
                        modifyvm:
                            natdnshostresolver1: false
                        showgui: 0
                    vmware:
                        numvcpus: 1
                    parallels:
                        linked_clone: 0
                        check_guest_tools: 0
                        update_guest_tools: 0
                machines:
                    vflm_q0bj6dapz508:
                        id: machine1
                        hostname: machine1.puphpet
                        network:
                            private_network: 192.168.56.101
                            forwarded_port:
                                vflmnfp_pw849fk8tywp:
                                    host: '8262'
                                    guest: '22'
                                vflmnfp_xclszlgj2sog:
                                    host: '8080'
                                    guest: '80'
                        memory: '512'
                        cpus: '1'
        provision:
            puppet:
                manifests_path: puphpet/puppet/manifests
                module_path:
                    - puphpet/puppet/modules
                    - puphpet/puppet/manifests
                options:
                    - '--verbose'
                    - '--hiera_config /vagrant/puphpet/puppet/hiera.yaml'
        synced_folder:
            vflsf_znwrtegwhzpj:
                source: ./
                target: /var/www
                sync_type: default
                smb:
                    smb_host: ''
                    smb_username: ''
                    smb_password: ''
                    mount_options:
                        dir_mode: '0775'
                        file_mode: '0664'
                rsync:
                    args:
                        - '--verbose'
                        - '--archive'
                        - '-z'
                    exclude:
                        - .vagrant/
                        - .git/
                    auto: 'true'
                owner: www-data
                group: www-data
        usable_port_range:
            start: 10200
            stop: 10500
        post_up_message: ''
    ssh:
        host: 'false'
        port: 'false'
        private_key_path: 'false'
        username: vagrant
        guest_port: 'false'
        keep_alive: '1'
        forward_agent: 'false'
        forward_x11: 'false'
        shell: 'bash -l'
        insert_key: 'false'
    vagrant:
        host: detect
    proxy:
        http: ''
        https: ''
        ftp: ''
        no_proxy: ''
server:
    install: '1'
    packages: {  }
users_groups:
    install: '1'
    groups: {  }
    users: {  }
locale:
    install: '1'
    settings:
        default_locale: cs_CZ.UTF-8
        locales:
            - en_GB.UTF-8
            - en_US.UTF-8
            - cs_CZ.UTF-8
        timezone: Europe/Prague
firewall:
    install: '1'
    rules: {  }
cron:
    install: '1'
    jobs: {  }
nginx:
    install: '0'
    settings:
        version: present
        default_vhost: 1
        proxy_buffers: '4 256k'
        proxy_buffer_size: 128k
        proxy_connect_timeout: 600s
        proxy_send_timeout: 600s
        proxy_read_timeout: 600s
        names_hash_bucket_size: 128
    upstreams: {  }
    vhosts:
        nxv_n82mrcs448yk:
            server_name: awesome.dev
            server_aliases:
                - www.awesome.dev
            www_root: /var/www/awesome
            listen_port: '80'
            index_files:
                - index.html
                - index.htm
                - index.php
            client_max_body_size: 1m
            ssl: '0'
            ssl_cert: ''
            ssl_key: ''
            ssl_port: '443'
            ssl_protocols: ''
            ssl_ciphers: ''
            rewrite_to_https: '1'
            spdy: '1'
            locations:
                nxvl_zkpn8kghm3rz:
                    location: /
                    try_files:
                        - $uri
                        - $uri/
                        - /index.php$is_args$args
                    fastcgi: ''
                    fastcgi_index: ''
                    fastcgi_split_path: ''
                    proxy: ''
                    proxy_redirect: ''
                nxvl_3nof7q6setkk:
                    location: '~ \.php$'
                    try_files:
                        - $uri
                        - $uri/
                        - /index.php$is_args$args
                    fastcgi: '127.0.0.1:9000'
                    fastcgi_index: index.php
                    fastcgi_split_path: '^(.+\.php)(/.*)$'
                    fast_cgi_params_extra:
                        - 'SCRIPT_FILENAME $request_filename'
                        - 'APP_ENV dev'
                    set:
                        - '$path_info $fastcgi_path_info'
                    proxy: ''
                    proxy_redirect: ''
    proxies: {  }
apache:
    install: '1'
    settings:
        version: 2.4
        user: www-data
        group: www-data
        default_vhost: true
        manage_user: false
        manage_group: false
        sendfile: 0
    modules:
        - proxy_fcgi
        - rewrite
    vhosts:
        av_c31h8wnd6878:
            servername: www.awesome.dev
            serveraliases:
                - www.awesome.dev
            docroot: /var/www/awesome
            port: '80'
            setenv:
                - 'APP_ENV dev'
            setenvif:
                - 'Authorization "(.*)" HTTP_AUTHORIZATION=$1'
            custom_fragment: ''
            ssl: '0'
            ssl_cert: ''
            ssl_key: ''
            ssl_chain: ''
            ssl_certs_dir: ''
            ssl_protocol: ''
            ssl_cipher: ''
            directories:
                avd_uap27xk31t8d:
                    path: /var/www/awesome
                    options:
                        - Indexes
                        - FollowSymlinks
                        - MultiViews
                    allow_override:
                        - All
                    require:
                        - 'all granted'
                    custom_fragment: ''
                    files_match:
                        avdfm_t5mu83myqrg7:
                            path: \.php$
                            sethandler: 'proxy:fcgi://127.0.0.1:9000'
                            custom_fragment: ''
                            provider: filesmatch
                    provider: directory
letsencrypt:
    install: '1'
    settings:
        email: ''
    domains: {  }
php:
    install: '1'
    settings:
        version: '7.0'
    modules:
        php:
            - cli
            - intl
            - xml
        pear: {  }
        pecl: {  }
    ini:
        display_errors: 'On'
        error_reporting: '-1'
        session.save_path: /var/lib/php/session
        date.timezone: UTC
    fpm_ini:
        error_log: /var/log/php-fpm.log
    fpm_pools:
        phpfp_mtbe8nt9dc5z:
            ini:
                prefix: www
                listen: '127.0.0.1:9000'
                security.limit_extensions: .php
                user: www-user
                group: www-data
    composer: '1'
    composer_home: ''
xdebug:
    install: '1'
    settings:
        xdebug.default_enable: '1'
        xdebug.remote_autostart: '0'
        xdebug.remote_connect_back: '1'
        xdebug.remote_enable: '1'
        xdebug.remote_handler: dbgp
        xdebug.remote_port: '9000'
blackfire:
    install: '0'
    settings:
        server_id: ''
        server_token: ''
        agent:
            http_proxy: ''
            https_proxy: ''
            log_file: stderr
            log_level: '1'
        php:
            agent_timeout: '0.25'
            log_file: ''
            log_level: '1'
xhprof:
    install: '0'
wpcli:
    install: '0'
    version: v0.24.1
drush:
    install: '0'
    version: 8.0.5
ruby:
    install: '1'
    versions:
        rv_np5nznfl1cyw:
            default: '1'
            bundler: '1'
            version: 1.9.3
            gems:
                - deep_merge@1.0.1
                - activesupport@4.2.6
                - vine@0.2
python:
    install: '1'
    packages: {  }
    versions: {  }
nodejs:
    install: '0'
    settings:
        version: '6'
    npm_packages: {  }
hhvm:
    install: '0'
    composer: '1'
    composer_home: ''
    settings: {  }
    server_ini:
        hhvm.server.host: 127.0.0.1
        hhvm.server.port: '9000'
        hhvm.log.use_log_file: '1'
        hhvm.log.file: /var/log/hhvm/error.log
    php_ini:
        display_errors: 'On'
        error_reporting: '-1'
        date.timezone: UTC
mariadb:
    install: '1'
    settings:
        version: '10.1'
        root_password: '123'
        override_options: {  }
    adminer: 0
    users:
        mariadbnu_3n1l5iqd7e4e:
            name: dbuser
            password: 111
    databases:
        mariadbnd_45wuqqxt9x7b:
            name: database
            sql: ''
    grants:
        mariadbng_4obz2fj0ivqb:
            user: dbuser
            table: '*.*'
            privileges:
                - ALL
mysql:
    install: '0'
    settings:
        version: '5.7'
        root_password: '123'
        override_options: {  }
    adminer: 0
    users:
        mysqlnu_7wzdm56cyn4c:
            name: dbuser
            password: '123'
    databases:
        mysqlnd_12vid801kk1c:
            name: dbname
            sql: ''
    grants:
        mysqlng_puv6w001khhk:
            user: dbuser
            table: '*.*'
            privileges:
                - ALL
postgresql:
    install: '0'
    settings:
        global:
            encoding: UTF8
            version: '9.6'
        server:
            postgres_password: '123'
    databases: {  }
    users: {  }
    grants: {  }
    adminer: 0
mongodb:
    install: '0'
    settings:
        bind_ip: 127.0.0.1
        port: '27017'
    globals:
        version: '2.6'
    databases: {  }
redis:
    install: '0'
    settings:
        port: '6379'
sqlite:
    install: '0'
    adminer: 0
    databases: {  }
mailhog:
    install: '0'
    settings:
        smtp_ip: 0.0.0.0
        smtp_port: 1025
        http_ip: 0.0.0.0
        http_port: '8025'
        path: /usr/local/bin/mailhog
beanstalkd:
    install: '0'
    settings:
        listenaddress: 0.0.0.0
        listenport: '11300'
        maxjobsize: '65535'
        maxconnections: '1024'
        binlogdir: /var/lib/beanstalkd/binlog
        binlogfsync: null
        binlogsize: '10485760'
    beanstalk_console: 0
rabbitmq:
    install: '0'
    settings:
        port: '5672'
    users: {  }
    vhosts: {  }
    plugins: {  }
elastic_search:
    install: '0'
    settings:
        version: 2.3.1
        java_install: true
    instances:
        esi_sgws6p4v2ar7:
            name: es-01
solr:
    install: '0'
    settings:
        version: 5.5.2
        port: '8984'

And this is output when running vagrant up:

Bringing machine 'machine1' up with 'virtualbox' provider...
==> machine1: Importing base box 'puphpet/ubuntu1604-x64'...

�[KProgress: 10%
�[KProgress: 30%
�[KProgress: 40%
�[KProgress: 60%
�[KProgress: 70%
�[KProgress: 80%
�[KProgress: 90%
�[K==> machine1: Matching MAC address for NAT networking...
==> machine1: Checking if box 'puphpet/ubuntu1604-x64' is up to date...
==> machine1: Setting the name of the VM: pV3D5Z_machine1_1476032836304_87431
==> machine1: Fixed port collision for 80 => 8080. Now on port 10200.
==> machine1: Fixed port collision for 22 => 2222. Now on port 10201.
==> machine1: Clearing any previously set network interfaces...
==> machine1: Preparing network interfaces based on configuration...
    machine1: Adapter 1: nat
    machine1: Adapter 2: hostonly
==> machine1: Forwarding ports...
    machine1: 22 (guest) => 8262 (host) (adapter 1)
    machine1: 80 (guest) => 10200 (host) (adapter 1)
    machine1: 22 (guest) => 10201 (host) (adapter 1)
==> machine1: Running 'pre-boot' VM customizations...
==> machine1: Booting VM...
==> machine1: Waiting for machine to boot. This may take a few minutes...
    machine1: SSH address: 127.0.0.1:10201
    machine1: SSH username: vagrant
    machine1: SSH auth method: private key

After a while, it outputs to stderr message starting: Timed out while waiting for the machine to boot.

Tried to increase boot_timeout but 15 min waiting didnt help.
I believe this is puphpet issue, because i succesfully started vagrant virtual machine with different box. I also succesfully set up vagrant machine using phansible.

@matt127127

This comment has been minimized.

matt127127 commented Oct 10, 2016

I had the same problem but on OSX, i installed the lateset version of vagrant 1.8.5 and Virtual box 5.1.x, completely cleared my .vagrant folder in my user profile and deleted all the virtual machines that were related in virtualbox, ran vagrant up again and its working.

@jtreminio

This comment has been minimized.

Member

jtreminio commented Oct 10, 2016

Upgrade virtualbox.

@jtreminio jtreminio closed this Oct 10, 2016

@hamacekh

This comment has been minimized.

hamacekh commented Oct 10, 2016

Virtualbox upgrade to 5.1.6 solved the issue.

@lechero

This comment has been minimized.

lechero commented Oct 19, 2016

I'm experiencing the same problem with virtualbox version 5.1.8 and vagrant version 1.8.6

@Jurigag

This comment has been minimized.

Jurigag commented Nov 29, 2016

Same on 5.1.0 virtualbox and latest vagrant.

@exones

This comment has been minimized.

exones commented Jan 9, 2017

Same on Virtualbox 5.1.10 and Vagrant 1.9.1

@hamacekh

This comment has been minimized.

hamacekh commented Jan 13, 2017

I did encounter this problem again. Downgrade virtualbox to 5.0.x helped (currently running 5.0.30).

Homepage of puphpet https://puphpet.com/ says "The official recommended Virtualbox version is 5.0.26!"

@saurjain108

This comment has been minimized.

saurjain108 commented Feb 17, 2017

I am also facing the same problem. I tried different combination of virtual box and vagrant, but didn't got any success .
image

@arundasan91

This comment has been minimized.

arundasan91 commented Feb 17, 2017

What is the version of Vagrant and Virtualbox you are running. I am also facing a similar issue.

@saurjain108

This comment has been minimized.

saurjain108 commented Feb 17, 2017

All of the version mentioned above.

@saurjain108

This comment has been minimized.

saurjain108 commented Feb 17, 2017

need a immediate help.

@ghost

This comment has been minimized.

ghost commented Feb 20, 2017

same issue, vbox 5.1.14 vagrant 1.9.1, tried vbox 5.0.32 without success

@subimage

This comment has been minimized.

subimage commented Feb 21, 2017

+1 "me too".

  • OS X 10.11.6
  • Virtualbox 5.1.14 r112924
  • Vagrant 1.9.1
  • debian/jessie64
@ghost

This comment has been minimized.

ghost commented Feb 21, 2017

opening VirtualBox GUI, saw an issue with VT-x disabled.
Enable SVM Virtualization in BIOS (for AMD PRO A10 proc or VT-x for Intel) solved the issue

@peteroruba

This comment has been minimized.

peteroruba commented Feb 23, 2017

Same here, not working. Debian Jessie, VirtualBox 5.1.14r112924, Vagrant 1.9.1

@imuller

This comment has been minimized.

imuller commented Feb 23, 2017

http://stackoverflow.com/questions/40968297/laravel-homestead-hangs-at-ssh-auth-method-private-key-on-mac

I also got this issue today. Step 3-6 helped me, check link above :)

@hubes

This comment has been minimized.

hubes commented Feb 27, 2017

On Windows 10, Virtualbox 5.1.14/Vagrant 1.9.1, enabling the Virtualization Technology (VT) helped me resolve a few errors:

  • boot_timeout error
  • ssh auth method
  • guest machine state error

Used this video: https://www.youtube.com/watch?v=lOfN8byV9uo

@subimage

This comment has been minimized.

subimage commented Mar 1, 2017

@peteroruba: Same here, not working. Debian Jessie, VirtualBox 5.1.14r112924, Vagrant 1.9.1

FWIW, I was on the same box and issues seem to have gone away switching to "bento/debian-8.7". I've read elsewhere that it has something to do with improper packing of the boxes. Guessing whoever is packing the debian/jessie64 boxes has the old version of the packing util.

@guenhter

This comment has been minimized.

guenhter commented Mar 15, 2017

Same here:
virtualbox: 5.1.16-113841
vagrant: 1.9.2
OS-X: 10.12.3 (16D32)
Box: debian/jessie64

We tried to reinstall virtualbox and vagrant + also purging all configurations

Error:

master2: SSH address: 127.0.0.1:2200
    master2: SSH username: vagrant
    master2: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
@Auram02

This comment has been minimized.

Auram02 commented Mar 16, 2017

Same here:
We tried to reinstall virtualbox and vagrant + also purging all configurations

I had the same issue appear randomly this week and just fixed it this morning. Here's how...

Even with vagrant logging at the debug level ( vagrant up --provision --debug 2&>1 | tee debug.log ) it wasn't showing me any relevant errors. Instead, I went looking in the VirtualBox logs. I'm on a Windows machine, so for me, they are located at..

C:\Users\[your_windows_name]\VirtualBox VMs\[vagrant_box_id]\Logs\

In VBox.log, I noticed errors being thrown in the NAT port mapping section. It turns out that some other application (over a month ago) installed a program called "Web Companion", one of those browser add-ons which get bundled with other applications, made by LavaSoft (of Avast! fame)

As part of Web Companion, some LavaSoft TCP dll's were installed and VirtualBox somehow started to try to use those for doing the port mapping, including the SSH port that the guest uses when provisioning, and it fails.

The Fix (for me)

  1. Uninstall "Web Companion". On Windows, go to Control Panel->Programs and Features and find it in the list. Select and click Uninstall
  2. Open a command prompt as Administrator and run: netsh winsock reset
  3. Reboot your PC
  4. Remove the DLL's it was trying to load. They should be located in located in two locations

C:\Windows\System32\LavasoftTcpService.dll
C:\Windows\SysWOW64\LavasoftTcpService.dll

Note: There were also two similarly named .ini files. I removed them as well but that isn't strictly necessary

  1. vagrant up --provision
  2. With any luck, this was your issue and the vagrant guest will now be able to ssh into the box during provisioning to setup your environment
@n8green

This comment has been minimized.

n8green commented Mar 17, 2017

@Auram02 You sir, I owe you a beer.

This has caused me a real headache this week, when all of my vagrant boxes, seemingly randomly, failed to get past SSH auth. Great work, great explanation. Thank you.

It does however beg the question - how did it actually happen?

@Auram02

This comment has been minimized.

Auram02 commented Mar 17, 2017

@Auram02 You sir, I owe you a beer.

No problem, glad to hear it fixed your issue! Let me know if you're ever in the central Illinois area :)

It does however beg the question - how did it actually happen?

I have no clue which application installed Web Companion on me, or why it suddenly activated. When I uninstalled Web Companion, it had an install date of 02/21/17 and I had rebooted multiple times since then. In this instance, Vagrant stopped working after my system crashed. When I rebooted and attempted to start vagrant, I started experiencing the error above.

I don't install anything other than was is strictly necessary on this development machine, and definitely don't recall installing anything that would bundle this, but it got there somehow. Sorry, can't help you there

@oLDu67

This comment has been minimized.

oLDu67 commented Mar 18, 2017

@Auram02 I solved this problem.Thank you.

@asabanovic

This comment has been minimized.

asabanovic commented Mar 19, 2017

@Auram02 Thank you so much ! It is 3:58 AM now. It's been about 9hours today trying to fix this.

@frix360

This comment has been minimized.

frix360 commented Mar 26, 2017

@Auram02 Thank you very much! Was looking for a fix for ages...

@Ruudt

This comment has been minimized.

Ruudt commented Mar 28, 2017

I had the problem @hubes described as well. My error message read:

Stderr: VBoxManage.exe: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)

Having corrected this in the BIOS, Vagrant came up without any further errors! (Luckily this was on an HP as well, or would this be part of the cause??)

@sfeurtado408

This comment has been minimized.

sfeurtado408 commented Mar 29, 2017

Removing Web Companion option worked for me...the other listed suggestion did not work. Thank You @Auram02

@faridmovsumov

This comment has been minimized.

faridmovsumov commented Mar 30, 2017

This command solved my problem. Thanks @Auram02

netsh winsock reset
@raeslm

This comment has been minimized.

raeslm commented Apr 2, 2017

I had the same problem, update virtualbox v5.1.18 and everything works great.

@HenricF

This comment has been minimized.

HenricF commented Apr 3, 2017

Thank you @Auram02, I have no idea how Web Companion got installed on my host. I would probably never have realised it was the culprit if it wasn't for this post - it's saved me days of troubleshooting.

@guesl

This comment has been minimized.

guesl commented Apr 13, 2017

Thank you @Auram02. You save my life.

@manishnakar

This comment has been minimized.

manishnakar commented Apr 19, 2017

I faced same problem on Ubuntu.. have fixed with vagrant reload

Happy coding

@lnrowboat

This comment has been minimized.

lnrowboat commented May 29, 2017

_ Open git bash as administrator
_ netsh winsock reset
_ vagrant reload

Solved

@lnrowboat

This comment has been minimized.

lnrowboat commented May 29, 2017

@charlesfleche

This comment has been minimized.

charlesfleche commented May 31, 2017

The winsock trick didn't work for me.

@ClemTar

This comment has been minimized.

ClemTar commented Jun 20, 2017

Worked for me, thanks.

@mrmedina87

This comment has been minimized.

mrmedina87 commented Jul 5, 2017

@Auram02 you are a god, thanks!

@thankit

This comment has been minimized.

thankit commented Aug 22, 2017

I had the same issue, with vagrant version - 1.9.7 and Virtual Box 5.1.26.
I just deleted the Vagrant default Profile () created, and re initialize the process. It worked for me. :)

@xiaotuanyu120

This comment has been minimized.

xiaotuanyu120 commented Sep 1, 2017

@Auram02 Thank you, I don't have Web Companion installed, but the command netsh winsock reset solved my problem

@doobieroo

This comment has been minimized.

doobieroo commented Sep 13, 2017

@Auram02 Thank you so much!! I've been struggling with this exact issue for several days. I had the darn Lavasoft dll's installed also, with absolutely no recollection of having installed anything that would have contained them. You are amazing!

@parkerjgit

This comment has been minimized.

parkerjgit commented Dec 4, 2017

Enabling virtualization in the bios cpu settings fixed this for me after trying everything else. (win 7)

@josephdpurcell

This comment has been minimized.

josephdpurcell commented Dec 14, 2017

My issue was the vm's file system was corrupted somehow. I resolved this by using @liginaga suggestion to start the machine using the VirtualBox GUI--this revealed the machine was booting to an initramfs prompt.

Now, to get past the initramfs prompt I did:

# Get the filesystem name
(initramfs) ls /dev/mapper
# Fix the filesystem, see also https://askubuntu.com/a/817660/187239
(initramfs) fsck /dev/mapper/vagrant--vg-root -y

Then, I shut down the machine via VirtualBox GUI and then on the CLI I ran vagrant up and it worked fine.

@byronglendon

This comment has been minimized.

@bethhard-zero

This comment has been minimized.

bethhard-zero commented May 6, 2018

I had the same issue:
os:win10
vagrant:2.1.0
virtualBox:5.2.10

fix with follow command:
_ Open git bash as administrator
_ netsh winsock reset
_ vagrant reload

Thank you @lnrowboat

@tgaertner

This comment has been minimized.

tgaertner commented May 14, 2018

Same problem on LM18.3-Host (Ubuntu) - nothing solved my problem so far...
randomly get timeout on this line: SSH auth method: private key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment