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

Console wont connect to VMs on external HOST #28

Closed
emdo-pa opened this issue Feb 15, 2019 · 7 comments · Fixed by #44
Closed

Console wont connect to VMs on external HOST #28

emdo-pa opened this issue Feb 15, 2019 · 7 comments · Fixed by #44

Comments

@emdo-pa
Copy link

emdo-pa commented Feb 15, 2019

As in topic, WebConsole aquires IP address from VMS config and tries to connect to 127.0.0.1 or 0.0.0.0 on port 5900 (for the first VM). To be able to connect I was forced to manualy edit XML and set the address to some routable address.

A good starting pooint would be to take an IP from the Host's Connection details (when used as a qemu+ssh/tcp/tls)

@dantti
Copy link
Member

dantti commented Feb 16, 2019

That's exactly what is done but address must be set to 0.0.0.0 as 127.0.0.1 won't allow remote connections:
https://github.com/cutelyst/Virtlyst/blob/master/src/ws.cpp#L47

@emdo-pa
Copy link
Author

emdo-pa commented Feb 16, 2019

seems it doesnt work in my case,
CUTELYST_VERSION=v2.6.0
VIRTLYST_VERSION=v1.2.0

in logs i can see:
6:8 virtlyst.ws[debug] Connecting TCP socket to "0.0.0.0" 5900 6:8 virtlyst.ws[warning] Console Proxy error: QAbstractSocket::ConnectionRefusedError "Connection refused"

in XML of a VM I had set:
<graphics listen="0.0.0.0" autoport="yes" port="5900" passwd="TryToGuess" type="spice"> <listen address="0.0.0.0" type="address"/> <image compression="off"/> </graphics>

and on a HOST system, port is open and listening
tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN 7097/qemu-system-x86....

Virtlyst is using QEMU+SSH to a host 192.168.4.10

@dantti
Copy link
Member

dantti commented Feb 17, 2019

This is fixed in git master, I haven't tagget a Virtlyst release after that yet

@misery
Copy link
Contributor

misery commented Jan 21, 2024

Is it possible to use ssh to redirect if 127.0.01 is used? I'm using localhost and virt-manager can do this with ssh without any problems. Maybe libvirt already supports it?

@dantti
Copy link
Member

dantti commented Jan 21, 2024

Both use libvirt under the hood so likely possible, the main issue with SSH is if it want's to prompt for password, you better use ssh-keys then

@misery
Copy link
Contributor

misery commented Jan 21, 2024

Both use libvirt under the hood so likely possible, the main issue with SSH is if it want's to prompt for password, you better use ssh-keys then

Yeah, I already added ssh key and it works perfect. Just the console is not working because I like to use localhost and authorization over ssh.
Do you have a hint for me where libvirt is called in Virtlyst? So I can look into it.

@dantti
Copy link
Member

dantti commented Jan 21, 2024

hmm don't know exactly what you want, but likely https://github.com/cutelyst/Virtlyst/blob/master/src/lib/connection.cpp

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

Successfully merging a pull request may close this issue.

3 participants