Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH access to vagrant VMs is denied #72

Closed
akiskourtis opened this issue Jan 23, 2017 · 20 comments
Closed

SSH access to vagrant VMs is denied #72

akiskourtis opened this issue Jan 23, 2017 · 20 comments

Comments

@akiskourtis
Copy link

Hello I have been trying to set up the vagrant script for ovn-kubernetes, everything works fine until, the script tries to access the VM

k8s-master: Forwarding ports...
k8s-master: 22 (guest) => 2222 (host) (adapter 1)
==> k8s-master: Running 'pre-boot' VM customizations...
==> k8s-master: Booting VM...
==> k8s-master: Waiting for machine to boot. This may take a few minutes...
k8s-master: SSH address: 127.0.0.1:2222
k8s-master: SSH username: ubuntu
k8s-master: SSH auth method: password
k8s-master: Warning: Remote connection disconnect. Retrying...
k8s-master: Warning: Remote connection disconnect. Retrying...

This goes on for several seconds, and if you do a vagrant up 2 more times you have your VMs ready

However, when you try to access them via ssh, you cannot, wither using ubuntu/ubuntu, or vagrant/vagrant, or via changing the Vagrantfile, setting a username and password and reloading the configuration.

Thank you,

Akis

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

(I am not an expert in Vagrant.)

What is your base OS? I know that it works on a mac with vagrant 1.8.5. I would check your vagrant version.

@akiskourtis
Copy link
Author

I am on ubuntu 16.04, with vagrant version 1.8.1, maybe it needs the latest, I will update and report back, thanks!

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

The fact that vagrant ssh does not work for you makes me believe that something is wrong with the "routes" that vagrant sets up. May be there is some conflict with the IP address that vagrant uses with your host routing table? I would also look at "route -n" to see whether there is conflicts.

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

And only do "vagrant up k8s-master" to save on time.

@akiskourtis
Copy link
Author

vagrant is trying to ssh, though local net 127.0.0.1 I would not see any profound conflict.
I also checked my route -n and do not see any 127.0.0.1 conflicts, I will try some other images also, see if they work.

@akiskourtis
Copy link
Author

Also when I try to ssh in the VM, the ubuntu/combination does not work, what is the password?

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

Doesn't using "vagrant ssh k8s-master" from the vagrant directory not work (I think it uses SSH keys)? I think using ssh via password is disabled. But let me check to make sure by spinning up a vagrant env.

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

May be you are hitting this?
https://bugs.launchpad.net/cloud-images/+bug/1569237

@akiskourtis
Copy link
Author

yes this is probable, however I tried some other images and the ssh never seems to work, it is strange..
I did a tcpdump and they seem to communicate with each other. And on the ubuntu/xenial image it just asks the password.
Shouldn't the ubuntu/ubuntu combination just work?

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

Shouldn't the ubuntu/ubuntu combination just work?

No. Nobody apparently knows the password for username "ubuntu". Just to make sure, doesn't "vagrant ssh k8s-master" not work from the vagrant directory?

@akiskourtis
Copy link
Author

No, it just asks for the unknown password, I also tried the bce13c362bdf6d1518510c23, which someone mentions with no luck.
For you the "vagrant ssh k8s-master" does not ask for a password right?

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

For you the "vagrant ssh k8s-master" does not ask for a password right?

No. It does not ask for a password. Did you upgrade your vagrant to atleast 1.8.5?

@akiskourtis
Copy link
Author

Yes i upgraded to 1.9.1

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

Yes i upgraded to 1.9.1

I don't know whether upgrading the virtualbox too will help. I am trying to see if trusty64 works.

@akiskourtis
Copy link
Author

akiskourtis commented Jan 23, 2017

Ok i somehow, managed to ssh into the VM

  1. changed the image to bento/ubuntu-16.04

  2. add the ssh_key part to the Vagrantfile

config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true

  1. when you ssh, it again requests a password, with "vagrant" you get in.

However, vagrant up still cannot connect, and so the VM remains emtpy, as it does not execute any script further. And sidenote, although I have told it to use a private key, it still resorts to password method (??)

Would it make sense to run the scripts from inside the VM?

PS: This is with virtualbox 5.1, also upgraded.

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

Would it make sense to run the scripts from inside the VM?

It should work.

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

Btwn, I am available as "shettyg" in openvswitch IRC channel, if you prefer faster turnarounds.

@akiskourtis
Copy link
Author

Ok good to know, I will ping you from there, I will do a dry run on a Mac tomorrow, and let you know

Thanks for the support!

@shettyg
Copy link
Collaborator

shettyg commented Jan 23, 2017

Surprisingly, I was able to "vagrant ssh k8s-master" on a Ubuntu 16.04 host with vagrant 1.9.1

@akiskourtis
Copy link
Author

akiskourtis commented Jan 24, 2017

I did a dry run on vagrant windows 10 works like a charm, then tried a fresh install on ubuntu 16.04 and it works!

NOTE: Always run vagrant with sudo (!!!)

stbenjam pushed a commit to stbenjam/ovn-kubernetes that referenced this issue Jul 26, 2020
Bug 1798613: OVN: Bump image to include ovn2.12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants