Search code examples
windowscentosvagrantvirtualbox

Not able to access vagrant box from host on windows 10


I have a vagrant box setup with below config

  config.vm.hostname = "devops-sk-vm"
  config.ssh.forward_agent = true
  config.ssh.username = "vagrant"
  config.vm.box = "generic/centos8"

I have a Jenkins running on VM however I am not able to access that from host machine. below are the ports forward and I didn't supply any specific IP. Running Jenkins on 9003.

  for i in 9000..9100
      config.vm.network :forwarded_port, guest: i, host: i
  end

Box provider: Virtual box version: 6.1.16 Vagrant version: 2.2.14 Host: Windows 10 Pro 2020 All inputs appreciated.


Solution

  • I have been able to solve this by checking the firewall service running on generic/centos8. firewalld service runs by default it seems and I had to whitelist the ports to get the traffic in.

    Followed this guide to initially disable it and then open the ports. https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-7