How do I change the WinRM port in test-kitchen?

Andrew DuFour -

If you're using a non-vagrant driver and the Windows image you're standing up uses a non-standard WinRM port you can configure it in the transport section of your platform.

For example, if your WinRM port is 8888:

  - name: windows2012r2
      name: winrm
      port: 8888

In the case of Vagrant, your Vagrantfile should do the work for you. An example config to adjust the default WinRM port, and disable the WinRM SSL port forwarding is:

Vagrant.configure("2") do |config|

    config.vm.communicator = "winrm"
    config.winrm.guest_port = 8888 :forwarded_port,
        guest: 8888,
        host: 18888,
        host_ip: "",
        id: "winrm",
        auto_correct: true :forwarded_port, guest: 5986, host: 55986, id: "winrm-ssl", disabled: true


Remember, although we like to think of Chef as doing all the things, we integrate with other technologies down the stack and in some cases they are responsible for actions and delegation.

For more on magic you can do in a Vagrantfile please see Hashicorp's Vagrant documentation:

Have more questions? Submit a request


Powered by Zendesk