2
votes

I am trying to install chef-server 11 on Virtual Machine via vagrant(Vagrant version 1.0.6).

In Vagrantfile settings are as follows:

config.vm.box_url = "opscode-ubuntu-12.04.box"
config.vm.network :bridged
config.vm.forward_port 80, 8080

I am not able to access chef-server by secured localhost or secured localhost:8080(Redirects to https://vagrant.vm/).

It works fine when I set the networking to hostonly

But I am interested in bridged, as it needs to be accessed by any external networks.

Steps I am following:

  1. vagrant up
  2. vagrant ssh
  3. In side VM : dpkg -r chef (As chef 10 was already in opscode-ubuntu-12.04.box)
  4. then dpkg -i chef-server_11.0.6-1.ubuntu.12.04_amd64.deb
  5. sudo chef-server-ctl reconfigure
  6. sudo chef-server-ctl status : All good
  7. sudo chef-server-ctl test : All 70 examples green

Thanks

1
Maybe you need to forward port 443 too?cmur2
port forwarding not workingTanmay

1 Answers

0
votes

Chef server tries to redirect you to https://hostname/. That's why try to change hostname of vm and/or add in your hosts' hosts-file record.

Also you have two interfaces in your vm. Solutions:

eth0 - NAT, only two ports forwarded. Open https and use eth0s' ipaddres in hosts-file

or

use ipaddress of eth1 in hosts-file as this interface actually bridged.

/etc/hosts:

...
<ip_address> <hostname_of_vm>

PS. In organization network bridged network should works because server automatically registered in network with dhcp/dns (of course, if organization supports it).

Also OHAI may return wrong fqdn/ip because it tries to bind to first interface (eth0/10.0.2.15).

Try this:

vagrant up --no-provision
vagrant ssh
sudo route del default
sudo route add default dev eth1 # just find a way to get eth1' route as default
^D
vagrant provision