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

machines: can't connect to the spice address #73

Closed
andreasn opened this issue Feb 21, 2019 · 8 comments
Closed

machines: can't connect to the spice address #73

andreasn opened this issue Feb 21, 2019 · 8 comments
Assignees

Comments

@andreasn
Copy link

Cockpit version: 183
OS: Fedora 28
Page: Machines

I have a VM running on a remote server. I wanted to connect to it using GNOME Boxes. I inputted the address it told me in Cockpit, but it didn't work.

Steps to reproduce

  1. Go to the VM page in Cockpit
  2. Select an existing VM and run it.
  3. Go to the Consoles page
  4. Copy the address there
  5. Open GNOME Boxes
  6. Under the Remote tab, select New and input the address.
  7. Boxes fails to connect

screenshot from 2019-02-21 12-26-45

screenshot from 2019-02-21 12-25-54

screenshot from 2019-02-21 12-26-37

@martinpitt
Copy link
Member

This is still true AFAICS, the displayed spice/vnc address don't get "translated" for remote machines.

@KKoukiou KKoukiou transferred this issue from cockpit-project/cockpit Apr 6, 2021
@joolli
Copy link

joolli commented Apr 19, 2021

I'm having this problem too.It seems like the remote viewing is not going through ssh like the rest of the management connection. I can enable vnc or spice to listen on 0.0.0.0 but it'd be better if it would go through SSH like in virt-manager.

@madwax
Copy link

madwax commented Oct 3, 2021

Work around

  1. edit your hosts /etc/libvirt/qemu.conf file
  2. find #spice_listen = "0.0.0.0"
  3. uncomment and put your hosts IPv4 address. (Don't know if IPv6 works)
    This only works when creating a new VM (the value is read by install_machines.py)

@cameronetchart
Copy link

Work around

1. edit your hosts /etc/libvirt/qemu.conf file

2. find #spice_listen = "0.0.0.0"

3. uncomment and put your hosts IPv4 address. (Don't know if IPv6 works)
   This only works when creating a new VM (the value is read by install_machines.py)

I have figured out how to fix this issue another way without a network card change, as @madwax's solution unfortunately did not work for me, but it inspired me where to look.

In my example, my headless cockpit host machine (ubuntu server) is 192.168.11.10, and my manjaro VM is 192.168.11.9. I'm trying to use SPICE to connect from a separate Windows PC (using windows virt-viewer) to the manjaro VM, but using the cockpit "proxy."

  • Create the VM using cockpit normally (I only use a direct attachment network driver, linked to my Cockpit server's ethernet port, so that my network issues it an IP in my normal homelab subnet)

  • On the cockpit machine terminal, run "virsh edit VM-NAME-HERE"

  • Look for the spice graphics portion, which will have a "listen=" entry and a "address=" entry as 127.0.0.1. Change this to the IP of your cockpit machine (mine is 192.168.11.10). I also changed this for the VNC entries above, but I haven't tested it since I don't use VNC.
    image

  • I rebooted the VM, and SPICE works!

This solution has the side effect of making the "launch remote viewer" .vv download button in Cockpit work, as it fixes the address from the 127 address to the correct internal IP.
image

@grigio
Copy link

grigio commented Aug 11, 2023

@cameronetchart I love you! this issue is still relevant.. I should have found this hack sooner

@zalnaRs
Copy link

zalnaRs commented Sep 23, 2023

@cameronetchart Thank you so much! This should be fixed asap, this is the biggest thing holding cockpit back :)

@KKoukiou
Copy link
Collaborator

Duplicate of #1078

@KKoukiou KKoukiou marked this as a duplicate of #1078 Dec 14, 2023
@testman42
Copy link

This should probably be re-opened, as the issue still persists.
At least for me (Fedora 40, cockpit 318, cockpit-machines 314).
Creating new VM results in VNC address being 127.0.0.1, and of course attempting VNC connection to <host_local_IP>:5900 does not work.
And I am not even doing any crazy networking wizardry, just a host connected to a local network.

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

9 participants