HagenAnuth
HagenAnuth

Reputation: 99

Set VM IP via vagrant

Is it possible to declare a static text IP in vagrant?

So far I am using this:

Vagrant.configure("2") do |config|
  config.vm.network "public_network", ip: "192.168.1.111"
  end

I am looking for something like

Vagrant.configure("2") do |config|
  config.vm.network "public_network", ip: "testVM"
  end

I want to access my Wildfly-Server (running on the VM) with testVM:8080

Thanks for any help in advance

Upvotes: 2

Views: 52

Answers (1)

Frederic Henri
Frederic Henri

Reputation: 53703

testVM is not an IP so you cannot use that as the ip parameter.

You can set your host file to redirect the specific ip to your test domain, so you can add this line in your /etc/hosts file on your host

192.168.1.111    testVM.local

Upvotes: 2

Related Questions