hashicorp/vagrant · error · Vagrant::Errors::SSHNotReady

The provider for this Vagrant-managed machine is reporting t

Error message

The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using.

What it means

`vagrant ssh-config` raises SSHNotReady when `machine.ssh_info` returns nil, i.e. the provider cannot report SSH connection details for the machine. This almost always means the VM is not created or not running, or has no reachable address yet — machine state, not a config-syntax problem. The message directs you to `vagrant status` to see the actual state.

Source

Thrown at plugins/commands/ssh_config/command.rb:41

        options = {}

        opts = OptionParser.new do |o|
          o.banner = "Usage: vagrant ssh-config [options] [name|id]"
          o.separator ""
          o.separator "Options:"
          o.separator ""

          o.on("--host NAME", "Name the host for the config") do |h|
            options[:host] = h
          end
        end

        argv = parse_options(opts)
        return if !argv

        with_target_vms(argv) do |machine|
          ssh_info = machine.ssh_info
          raise Vagrant::Errors::SSHNotReady if ssh_info.nil?

          if Vagrant::Util::Platform.windows?
            ssh_info[:private_key_path] = convert_win_paths(ssh_info[:private_key_path])
          end

          variables = {
            host_key: options[:host] || machine.name || "vagrant",
            ssh_host: ssh_info[:host],
            ssh_port: ssh_info[:port],
            ssh_user: ssh_info[:username],
            keys_only: ssh_info[:keys_only],
            verify_host_key: ssh_info[:verify_host_key],
            private_key_path: ssh_info[:private_key_path],
            log_level: ssh_info[:log_level],
            forward_agent: ssh_info[:forward_agent],
            forward_x11:   ssh_info[:forward_x11],
            proxy_command: ssh_info[:proxy_command],
            ssh_command:   ssh_info[:ssh_command],

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Boot the machine first: `vagrant up`, then retry `vagrant ssh-config`
  2. Check `vagrant status` and fix any `not created` / `poweroff` / `aborted` state (up, resume, or a halt cycle)
  3. For slow/cloud providers, retry ssh-config after the machine reports fully booted

Example fix

# before
# fresh clone, machine never started
vagrant ssh-config > ssh.config   # -> SSHNotReady

# after
vagrant up
vagrant ssh-config > ssh.config
Defensive patterns

Strategy: retry

Validate before calling

state = machine.state.id
abort "machine is '#{state}'; boot it first with: vagrant up" unless state == 'running'
info = machine.ssh_info

Try / catch

attempts = 0
begin
  machine.ssh_info or raise Vagrant::Errors::SSHNotReady
rescue Vagrant::Errors::SSHNotReady
  attempts += 1
  retry if attempts < 30  # machine may still be booting / getting an IP
end

Prevention

When it happens

Trigger: Running `vagrant ssh-config` before `vagrant up`, after `vagrant halt`/`vagrant destroy`, or while the provider still reports the machine as `not created`; a provider that cannot determine an address (no forwarded SSH port, no network IP).

Common situations: Fresh clones where the README assumed an already-running machine; CI jobs generating an SSH config before booting; cloud providers where IP assignment lags behind `vagrant up` returning.

Related errors


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/2163885ff7da7459. Report an issue: GitHub.