LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-05-2019, 05:09 PM   #1
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 810

Rep: Reputation: 40
[VAGRANT] connectivity to VM fails


Hi,
Im not sure if this is a right place to write about VAGRANT but if it is maybe someone can help me?

I am following a guide to deploy OpenStack on VirtualBox using VAGRANT 2.0.1.
Host OS: Ubuntu 16.04.6 LTS
Virtualbox: Oracle VM VirtualBox Manager 5.1.38_Ubuntu


When I execute "vagrant up" instantiation is going good up to the moment when it tries to connect to VM...
Code:
root@xPC:/home/labuser/Desktop/openstacklab/vagrant-openstack# vagrant up
Bringing machine ‘compute-01’ up with ‘virtualbox’ provider…
Bringing machine ‘controller-01’ up with ‘virtualbox’ provider…
Bringing machine ‘openstack-client’ up with ‘virtualbox’ provider…
==> compute-01: Checking if box ‘bento/ubuntu-18.04’ is up to date…
==> compute-01: Clearing any previously set forwarded ports…
==> compute-01: Clearing any previously set network interfaces…
==> compute-01: Preparing network interfaces based on configuration…
compute-01: Adapter 1: nat
compute-01: Adapter 2: hostonly
compute-01: Adapter 3: hostonly
compute-01: Adapter 4: hostonly
compute-01: Adapter 5: hostonly
==> compute-01: Forwarding ports…
compute-01: 22 (guest) => 2222 (host) (adapter 1)
==> compute-01: Running ‘pre-boot’ VM customizations…
==> compute-01: Booting VM…
==> compute-01: Waiting for machine to boot. This may take a few minutes…
compute-01: SSH address: 127.0.0.1:2222
compute-01: SSH username: vagrant
compute-01: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured (“config.vm.boot_timeout” value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you’re using a custom box, make sure that networking is properly
working and you’re able to connect to the machine. It is a common
problem that networking isn’t setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout (“config.vm.boot_timeout”) value.
Obviously, there is no error in above output. So, I try manually connect to the localhost on 2222 but it fails.

Code:
root@xPC:/home/labuser/Desktop/openstacklab/vagrant-openstack# netstat -anop | grep 2222 | grep -v unix
tcp 0 0 127.0.0.1:2222 0.0.0.0:* LISTEN 2573/VBoxHeadless off (0.00/0/0)
root@xPC:/home/labuser/Desktop/openstacklab/vagrant-openstack# ssh 127.0.0.1 -p 2222
ssh_exchange_identification: read: Connection reset by peer

root@xPC:/home/labuser/Desktop/openstacklab/vagrant-openstack# ssh -v 127.0.0.1 -p 2222
OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
ssh_exchange_identification: read: Connection reset by peer

Any idea what might be wrong?
 
Old 12-05-2019, 10:53 PM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 3,892

Rep: Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092Reputation: 1092
I just tried this and had no problems connecting to the compute node.

My guess: Your root account doesn't seem to have any SSH identity. Use ssh-keygen to create one, then try again.

EDIT: The command vagrant ssh-config tells you how vagrant connects to the VM. It should provide clues. Here is my output:
Code:
$ vagrant ssh-config
Host compute-01
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /home/bbausch/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL
...
$ ls -l /home/bbausch/.vagrant.d/insecure_private_key
-rw-------. 1 bbausch bbausch 1675 Oct  4  2016 /home/bbausch/.vagrant.d/insecure_private_key
This means that it uses the standard Vagrant key in $HOME/.vagrant.d.

You can configure a different key by setting config.ssh.private_key_path in the Vagrantfile.

Last edited by berndbausch; 12-05-2019 at 11:06 PM.
 
Old 12-06-2019, 10:37 AM   #3
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 810

Original Poster
Rep: Reputation: 40
Hi,
I have created ssh-keygen -t rsa, like suggested but that did not help.
Code:
root@xPC:~# ls -al /root/.ssh/
total 16
drwx------  2 root root 4096 Dez  6 16:25 .
drwx------ 11 root root 4096 Dez  6 16:08 ..
-rw-------  1 root root 1679 Dez  6 16:25 id_rsa
-rw-r--r--  1 root root  390 Dez  6 16:25 id_rsa.pub
Code:
root@xPC:/lab/vagrant-openstack# vagrant ssh-config
WARNING: Vagrant has detected the `vagrant-triggers` plugin. This plugin conflicts
with the internal triggers implementation. Please uninstall the `vagrant-triggers`
plugin and run the command again if you wish to use the core trigger feature. To
uninstall the plugin, run the command shown below:

  vagrant plugin uninstall vagrant-triggers

Note that the community plugin `vagrant-triggers` and the core trigger feature
in Vagrant do not have compatible syntax.

To disable this warning, set the environment variable `VAGRANT_USE_VAGRANT_TRIGGERS`.
Host compute-01
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /root/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using.
It is not only created but also running...
Code:
root@xPC:/lab/vagrant-openstack# vagrant status
WARNING: Vagrant has detected the `vagrant-triggers` plugin. This plugin conflicts
with the internal triggers implementation. Please uninstall the `vagrant-triggers`
plugin and run the command again if you wish to use the core trigger feature. To
uninstall the plugin, run the command shown below:

  vagrant plugin uninstall vagrant-triggers

Note that the community plugin `vagrant-triggers` and the core trigger feature
in Vagrant do not have compatible syntax.

To disable this warning, set the environment variable `VAGRANT_USE_VAGRANT_TRIGGERS`.
Current machine states:

compute-01                running (virtualbox)
controller-01             not created (virtualbox)
openstack-client          not created (virtualbox)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.

Note, there is no option: config.ssh.private_key_path in Vagrant file.
However by looking at: playbooks/deploy-ssh-keys.yml it seems like it wants to create its own id_rsa and id_rsa.pub and distribute it to root and vagrant users...
Not clear though if this is executed on HOST or VM...
If on HOST then I never created vagrant user.

Last edited by czezz; 12-06-2019 at 10:49 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Vagrant: Sharing folders with vagrant-sshfs LXer Syndicated Linux News 0 04-05-2016 02:53 PM
[SOLVED] Kali 3.12 no iNET connectivity >> boot 3.7 >> connectivity = fine bostonsean Linux - Networking 6 04-19-2014 06:41 PM
Vagrant+Ansible playbooks. How to use same playbook on non vagrant provision markotitel Linux - Virtualization and Cloud 1 12-06-2013 10:00 AM
Outgoing Connectivity problems. Incoming connectivity fine Fionnbharr Linux - Newbie 1 10-02-2008 01:51 PM
connectivity or not connectivity munkie_poo Linux - Newbie 0 05-07-2004 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 04:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration