How to config ssh port forwording using Test-Kichen withVagrant


#1

I am trying to use 2233 port for host machine but it is not using 2233 port and it is still trying to use default 2222 port. below is the kitchen.yml code.

suites:
- name: bpm_dmgr
driver:
vm_hostname: bpmdmgr.royalgreens.com
network:
- ["forwarded_port", {guest: 22, host: 2233}]
- ["private_network", {ip: "192.168.35.10"}]
customize:
memory: 2048
cpus: 2`

I have read this documentation but did not find the solution. can anyone please help


#2

With the vagrant driver, Vagrant needs the id for this port to know to change the SSH port forwarding.

network:
  - ["forwarded_port", {guest: 22, host: 2233, id: 'ssh'}]

I am curious about why allowing Vagrant to determine and assign forwarded ports does not work for you.


#3

thank you so much. it is resolved after passing id