fabric8io / fabric8-installer

To install fabric8 into a Kubernetes, OpenShift or Atomic environment
12 stars 37 forks source link

Latest vagrantfile on osx - ssh command fails #14

Closed itsjimbo closed 8 years ago

itsjimbo commented 9 years ago

I am running OSX 10.10.3 and had this working in the previous version, just trying to find out why ssh is failing after following the instructions..

which nmcli >/dev/null 2>&1 && nmcli c reload enp0s8 Following the instructions I did the following (install landrush plugin)

j:~/git/fabric8-installer/vagrant/openshift/latest$ vagrant plugin install landrush
Installing the 'landrush' plugin. This can take a few minutes...
Installed the plugin 'landrush (0.18.0)'!

Now start up

j:~/git/fabric8-installer/vagrant/openshift/latest$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'jimmidyson/centos-7.1' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: = 1.1.2
==> default: Loading metadata for box 'jimmidyson/centos-7.1'
    default: URL: https://atlas.hashicorp.com/jimmidyson/centos-7.1
==> default: Adding box 'jimmidyson/centos-7.1' (v1.1.2) for provider: virtualbox
    default: Downloading: https://atlas.hashicorp.com/jimmidyson/boxes/centos-7.1/versions/1.1.2/providers/virtualbox.box
==> default: Successfully added box 'jimmidyson/centos-7.1' (v1.1.2) for 'virtualbox'!
==> default: Importing base box 'jimmidyson/centos-7.1'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'jimmidyson/centos-7.1' is up to date...
==> default: Setting the name of the VM: latest_default_1436863788863_65979
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: [landrush] Host DNS resolver config looks good.
==> default: [landrush] starting dns server
[landrush] Starting daemon...
[landrush] Waiting for daemon to start...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2200 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: [landrush] setting up machine's DNS to point to our server
==> default: [landrush] network: :private_network, {:ip=>"172.28.128.4", :protocol=>"tcp", :id=>"9b0ab21c-5bc5-46e3-9b0a-8abe956bb541"}
==> default: [landrush] network: :forwarded_port, {:guest=>22, :host=>2200, :host_ip=>"127.0.0.1", :id=>"ssh", :auto_correct=>true, :protocol=>"tcp"}
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 4.3.28
    default: VirtualBox Version: 5.0
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

which nmcli >/dev/null 2>&1 && nmcli c reload enp0s8

Stdout from the command:

Stderr from the command:

As you can see some error ocurrs, which happened after I pulled the latest VagrantFile..

rhuss commented 9 years ago

Did you patch Vagrant ? I ask because AFAIK Vagrant still doesn't support VirtualBox 5.0 out of the Box ?

jimmidyson commented 9 years ago

@rhuss 1.7.3 does. Might have to tweak the base box to work around the fact that vagrant has now fixed a bug networking too :(

pulse00 commented 9 years ago

Same here. Vagrant 1.7.3 and Virtualbox 5.0. Other boxes we use internally work fine.

itsjimbo commented 9 years ago

I was also using vagrant 1.7.3

j:~/git/fabric8-installer/vagrant/openshift/latest$ vagrant version
Installed Version: 1.7.3
Latest Version: 1.7.3
itsjimbo commented 9 years ago

Just a quick followup .. I managed to get it working, seems that what the problem it was having is that it could not find nmcli, which i guess is the redhat network manager package, very strange (I am a noob to fabric8 and this vagrant setup, so pardon me)...

In order to fix this i just did a

vagrant ssh

Then install the nmcli package..

sudo yum install NetworkManager
sudo shutdown

Back in OSX, kill the process, because it did not shut down gracefully..

ps aux | grep -i 'vagrant'
kill -9 XXXX

Started it back up

~/git/fabric8-installer/vagrant/openshift/latest$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'jimmidyson/centos-7.1' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: [landrush] Host DNS resolver config looks good.
==> default: [landrush] starting dns server
[landrush] Starting daemon...
Daemon in unknown state! Will clear previous state and continue.
[landrush] Daemon status: unknown
[landrush] Waiting for daemon to start...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
;==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: [landrush] setting up machine's DNS to point to our server
==> default: [landrush] network: :private_network, {:ip=>"172.28.128.4", :protocol=>"tcp", :id=>"0134e54d-c57f-49d4-a7cd-76f398df25d5"}
==> default: [landrush] network: :forwarded_port, {:guest=>22, :host=>2222, :host_ip=>"127.0.0.1", :id=>"ssh", :auto_correct=>true, :protocol=>"tcp"}
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default: 
    default: Guest Additions Version: 4.3.28
    default: VirtualBox Version: 5.0
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: [landrush] adding machine entry: vagrant.f8 => 172.28.128.4
==> default: Mounting shared folders...
    default: /vagrant => /Users/jimbo/git/fabric8-installer/vagrant/openshift/latest
==> default: Running provisioner: shell...
    default: Running: inline script
==> default: Downloading OpenShift binaries...
==> default: ./
==> default: ./oc
==> default: ./oadm
==> default: ./openshift
==> default: /var/lib/openshift /home/vagrant

And it works fine!!

jimmidyson commented 9 years ago

Awesome! Let me update the base image to fix this. Thanks for working through the problems.

itsjimbo commented 9 years ago

Also can you update the image for docker version 1.7? The rationale is that it is the later version, but I am not sure if it will break anything else, I know the client api (when I do a mvn fabric8:apply) throws an exception if the server/client versions don't match... Thanks!

https://docs.docker.com/installation/centos/

jimmidyson commented 9 years ago

The problem is centos rpms from official centos yum repos carry some patches especially around security & selinux - I've seen conflicts with the official docker rpms before & so am a little bit wary of using them instead of the centos provided ones.

itsjimbo commented 9 years ago

Ok thanks for the info, did not know.. I appreciate all that you guys are doing on this project! Thanks!

rhuss commented 9 years ago

Seems to be a known Vagrant issue --> https://github.com/mitchellh/vagrant/issues/5953 which should be fixed in 1.7.4

I don't know whether we should upgrade to NetworkManager only because of this bug.

rhuss commented 9 years ago

In the meantime you can apply this patch to /opt/vagrant/embedded/gems/gems/vagrant-1.7.3/plugins/guests/fedora/cap/configure_networks.rb which fill fix this, too.

jimmidyson commented 9 years ago

I'd rather not enable NetworkManager - it is quote often a PITA... good old plain network files for me ;)

davsclaus commented 9 years ago

Have you tried with latest release, a lot has changed since.

davsclaus commented 8 years ago

Reopen if still a problem but the vagrant image has improved a lot, and its just to do a vagrant up and you should be running