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 connects to node, instead of qemu/lxc IP address #33

Open
linuxmail opened this issue Apr 26, 2016 · 5 comments
Open

ssh connects to node, instead of qemu/lxc IP address #33

linuxmail opened this issue Apr 26, 2016 · 5 comments

Comments

@linuxmail
Copy link

hi,
the most parts works, but vagrant ssh. Vagrant tries to connect via the node, instead of the configured IP address with public_network.

[...]
config.vm.define :box, primary: true do |box|
box.vm.box = 'dummy'
box.vm.network :public_network, ip: '192.168.100.100', interface: 'eth0', bridge: 'vmbr0', gw: '192.168.100.1'
end

Vagrant tries to connect to 192.168.100.5 which is my node.

Any suggestions?

@linuxmail
Copy link
Author

hi,

can anybody explain, why ssh-config is set to host ":<22{containerID}>" instead of the IP address defined in public_network?
:-)
cu denny

@linuxmail
Copy link
Author

linuxmail commented May 12, 2016

hi,

we found the reason, but we don't know, if it is a bug, or a feature. We located the rootcause
in action.rb line 167 "b.use AdjustForwardedPortParams" has to be commented out / removed. Than it works as expected :-)

So, for me it works now .. but I think, that is maybe a bug in combination with public_network and LXC.

Maybe the problem is here: Link

@gustavovalverde
Copy link

gustavovalverde commented Jun 10, 2016

I'm also having this problem, even though the VM gets created, it won't SSH into it. Obviously, in my case, I'm having vagrant in an external network. My proxmox endpoint is resolves to a domain (using reverse proxy with Nginx), so it won't work with the IP.

My host and the created box (both) ping to the Internet, but I'm not a network expert and I think this plugin will only connect from inside the server where proxmox is installed, not from the outside. But if you have a solution for this, please let me now.

I think @devekko had this problem, but I don't know if he could solve it.

@linuxmail
Copy link
Author

linuxmail commented Jun 11, 2016

hi gustavovalverde,

usually, you connect to the node (VirtualBox) and the host forwards the packages to the created VM. that is the default setup for Vagrant.
In my case, I'm in the same network like the created VM ... so I can do a ping to the LXC container. That doesn't have anything to do with the Proxmox host, because you need only to send commands via HTTP(S), as you said via NGINX.
So, you can think about to let NGINX also forwarding the SSH port to the LXC container.

@gustavovalverde
Copy link

gustavovalverde commented Jun 14, 2016

Ok, so I have come a long way trying to SSH my LXC containers from the outside using portforwarding. Now I've test that I can ssh my vagrant box manually doing ssh -i ~/.vagrant.d/insecure_private_key [email protected] -p 22100 -vv

Just to be clear...in action.rb line 167 "b.use AdjustForwardedPortParams", this is not a bug. If you're using vagrant with proxmox, this is the natural behavior for a Proxmox installed in bare-metal and vagrant being outside the node (WAN).

But the plugin is assuming that my bridge vmbr0 is my WAN interface, which is not because I'm with a VPS using Proxmox on Debian, and my WAN interface is eth0, with a local bridge for NATing.

When debugging the plugging is actually trying to connect through vmbr0, here's the error:

==> box: translation missing: en.vagrant_proxmox.adjust_forwarded_port_params
INFO interface: Machine: action ["read_ssh_info", "end", {:target=>:box}]
INFO ssh: Attempting SSH connection...
INFO ssh: Attempting to connect to SSH...
INFO ssh: - Host: 192.168.2.254 <--- vmbr0
INFO ssh: - Port: 22100
INFO ssh: - Username: vagrant
INFO ssh: - Password? false
INFO ssh: - Key Path: ["C:/Users/gvalverde/.vagrant.d/insecure_private_key"]
DEBUG ssh: == Net-SSH connection debug-level log START ==
DEBUG ssh: D, [2016-06-14T18:36:01.076501 #9576] DEBUG -- net.ssh.transport.session[1f71354]: establishing connection to 192.168.2.254:22100

How can I change this behavior so the plugin connects to my Node IP and not my Bridge IP?

Maybe @tdcox or @GamerSource can help with this one? (based on your pull requests) 👍

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