Vagrant can't ssh to guest - Connection refused

Discussion in 'Parallels Provider for Vagrant' started by EzsraM, Sep 10, 2019.

  1. EzsraM

    EzsraM Bit poster

    Messages:
    3
    I am new to Parallels. I have been using Vagrant with VirtualBox for a few months. This week I purchased a copy of Parallels Desktop 15 for Business.

    Parallels Desktop 15 for Business
    Vagrant, Installed Version: 2.2.5
    MacOS: 10.14.6

    First thing I did was install the plugin
    $ vagrant plugin install vagrant-parallels

    Next I tried creating a centos7 guest.
    $ mkdir centos7p
    $ cd centos7p
    $ vagrant init "generic/centos7"
    $ vagrant up --provider=parallels

    The box begins to load and finally I see the following:
    ==> default: Registering VM image from the base box 'generic/centos7'...
    ==> default: Creating new virtual machine as a linked clone of the box image...
    ==> default: Unregistering the box VM image...
    ==> default: Setting the default configuration for VM...
    ==> default: Checking if box 'generic/centos7' version '1.9.28' is up to date...
    ==> default: Setting the name of the VM: centos7p_default_1568126911696_44025
    ==> default: Fixed port collision for 22 => 2222. Now on port 2200.
    ==> default: Preparing network interfaces based on configuration...
    default: Adapter 0: shared
    .......
    ==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 10.211.55.14:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection refused. Retrying...
    default: Warning: Connection refused. Retrying...
    default: Warning: Connection refused. Retrying...
    default: Warning: Connection refused. Retrying...

    I checked the SSH configuration:
    $ vagrant ssh-config
    Host default
    HostName 10.211.55.15
    User vagrant
    Port 22
    UserKnownHostsFile /dev/null
    StrictHostKeyChecking no
    PasswordAuthentication no
    IdentityFile /Users/somewhere/.vagrant.d/insecure_private_key
    IdentitiesOnly yes
    LogLevel FATAL

    This is not what I am used to. Normally vagrant used a port forward with virtualboxes. So I checked and can not access port 22 on 10.211.55.15. SSH is running and no firewall is enabled.

    I tried other Boxes. They all do the same things, Ubuntu, Centos, does not seem to matter.

    I googled around for a while but did not find any solutions. Any assistance would be appreciated.
     
  2. EzsraM

    EzsraM Bit poster

    Messages:
    3
    I was able to work around this by adding the following to my vagrant file:

    config.ssh.host = "127.0.0.1"
    config.ssh.port = 2322
    config.vm.network "forwarded_port", guest: 22, host: 2322

    This is not desirable but for some reason Vagrant is unable to figure out the port forward on its own.
     
  3. EzsraM

    EzsraM Bit poster

    Messages:
    3
    Well, I also installed the parallels guest tools on the guest and it seems to have resolved the issue. Odd.

    # Have Vagrant update/install guest Tools
    websrv.vm.provider "parallels" do |prl|
    prl.update_guest_tools = true
    end
     

Share This Page