{"record":{"id":"bdb1945a0dd31037","repo":"hashicorp/vagrant","slug":"your-host-does-not-support-powershell-a-remote-po","errorCode":null,"errorMessage":"Your host does not support PowerShell. A remote PowerShell connection can only be made from a windows host.","messagePattern":"Your host does not support PowerShell\\. A remote PowerShell connection can only be made from a windows host\\.","errorType":"exception","errorClass":"VagrantPlugins::CommandPS::Errors::HostUnsupported","httpStatus":null,"severity":"error","filePath":"plugins/commands/powershell/command.rb","lineNumber":74,"sourceCode":"            raise Vagrant::Errors::VMNotCreatedError\n          end\n\n          if options[:command]\n            if machine.config.vm.communicator != :winrm\n              raise VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady\n            end\n\n            out_code = machine.communicate.execute(options[:command].dup, elevated: options[:elevated]) do |type,data|\n              machine.ui.detail(data) if type == :stdout\n            end\n            if out_code == 0\n              machine.ui.success(\"Command: #{options[:command]} executed successfully with output code #{out_code}.\")\n            end\n            next\n          end\n\n          # Check if the host even supports ps remoting\n          raise Errors::HostUnsupported if !@env.host.capability?(:ps_client)\n\n          ps_info = VagrantPlugins::CommunicatorWinRM::Helper.winrm_info(machine)\n          ps_info[:username] = machine.config.winrm.username\n          ps_info[:password] = machine.config.winrm.password\n          # Extra arguments if we have any\n          ps_info[:extra_args] = options[:extra_args]\n\n          result = ready_ps_remoting_for(machine, ps_info)\n\n          machine.ui.detail(\n            \"Creating powershell session to #{ps_info[:host]}:#{ps_info[:port]}\")\n          machine.ui.detail(\"Username: #{ps_info[:username]}\")\n\n          begin\n            @env.host.capability(:ps_client, ps_info)\n          ensure\n            if result[\"PreviousTrustedHosts\"]\n              reset_ps_remoting_for(machine, ps_info)","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/powershell/command.rb#L56-L92","documentation":"The interactive `vagrant powershell` path requires the host to expose the ps_client host capability, which only Windows hosts implement. When @env.host.capability?(:ps_client) is false (macOS/Linux), Vagrant raises Errors::HostUnsupported. The --command branch bypasses this check by executing through the guest's winrm communicator instead.","triggerScenarios":"Running `vagrant powershell` (no --command) on macOS or Linux; the check fires before any session is attempted, after winrm_info resolution is prepared.","commonSituations":"Developers on Mac/Linux managing Windows guests; following Windows-host-oriented docs; forgetting that only the interactive remote session is host-restricted.","solutions":["Run the command from a Windows host for interactive sessions.","On non-Windows hosts, use command mode with the winrm communicator: set `config.vm.communicator = \"winrm\"` in the Vagrantfile, then `vagrant powershell --command \"whoami\"`.","Or manage the guest over SSH where an OpenSSH server is available."],"exampleFix":"# before (on macOS/Linux)\nvagrant powershell                    # HostUnsupported\n# after\n# Vagrantfile: config.vm.communicator = \"winrm\"\nvagrant powershell --command \"whoami\"","handlingStrategy":"validation","validationCode":"require 'rbconfig'\nabort 'interactive vagrant powershell requires a Windows host; use --command with the winrm communicator instead' unless RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\nsystem('vagrant', 'powershell')","typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::Environment.new.cli(['powershell'])\nrescue VagrantPlugins::CommandPowershell::Errors::HostUnsupported => e\n  warn e.message # fall back: --command via winrm, or vagrant ssh\n  exit 1\nend","preventionTips":["Gate interactive `vagrant powershell` on the host being Windows.","Default to `--command` plus `config.vm.communicator = \"winrm\"` for cross-platform automation.","Document host requirements in the project README so Mac/Linux contributors do not hit it."],"tags":["vagrant","powershell","host-capability","platform","windows"],"backgroundTag":"unsupported-host-platform","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}