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

Spice fails with only IPV4. (no IPV6) #3588

Closed
jsaenzh01 opened this issue May 18, 2024 · 3 comments · Fixed by GNS3/gns3-server#2387
Closed

Spice fails with only IPV4. (no IPV6) #3588

jsaenzh01 opened this issue May 18, 2024 · 3 comments · Fixed by GNS3/gns3-server#2387
Labels

Comments

@jsaenzh01
Copy link

I have the opposite case to
#2352

Gns3 is always opening a IPV6 connection even if IPV6 is disabled.

I have disabled ipv6 with sysctl:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 0
net.ipv6.conf.tun0.disable_ipv6 = 1
net.ipv6.conf.br0.disable_ipv6 = 1

In "ip address show", ipv6 is not showed (not even in loopback):
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc knockout state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group 57841 qlen 1000
link/ether..... )

However, spice connection is always an error-> It tried to connect is always with ::

Start QEMU with /usr/bin/qemu-system-x86_64 -name Debian12-1 -m 2048M -smp cpus=1,sockets=1 -enable-kvm -machine smm=off -boot order=c -drive file=/run /media/jesus/GNS3/projects/forense/project-files/qemu/2d7239e9-8e1d-406b-bd07-7662ef0cebad/hda_disk.qcow2,if=virtio,index=0,media=disk,id=drive0 -uuid 2d7239e9- 8e1d-406b-bd07-7662ef0cebad -spice addr=::,port=5003,disable-ticketing ....
Execution log:
qemu-system-x86_64: -spice addr=::,port=5003,disable-ticketing: warning: short-form boolean option 'disable-ticketing' deprecated
Please use disable-ticketing=on instead
qemu-system-x86_64: warning: Spice: reds.cpp:2551:reds_init_socket: getaddrinfo(::,5003): Address family for hostname not supported
qemu-system-x86_64: warning: Spice: reds.cpp:3441:do_spice_init: Failed to open SPICE sockets
qemu-system-x86_64: failed to initialize spice server.

I am able to fix it changing this:
sudo nano /usr/lib/python3.11/site-packages/gns3server/compute/qemu/qemu_vm.py

if self._console: console_host = self._manager.port_manager.console_host if console_host == "0.0.0.0": if socket.has_ipv6: # to fix an issue with Qemu when IPv4 is not enabled # see https://github.com/GNS3/gns3-gui/issues/2352 # FIXME: consider making this more global (not just for Qemu + SPICE) console_host = "0.0.0.0" else:

Its not a big deal, i write this if It help anyone.
Cheers

GNS3 version and operating system (please complete the following information):

  • OS: Linux
  • GNS3 version 2.2.47
  • Local service

To Reproduce
Steps to reproduce the behavior:

  1. Open a VM
  2. Click on Start
  3. See errror
@jsaenzh01 jsaenzh01 added the Bug label May 18, 2024
@jsaenzh01 jsaenzh01 changed the title Spice fails whit only IPV4. Spice fails with only IPV4. (no IPV6) May 18, 2024
@grossmj
Copy link
Member

grossmj commented Jun 16, 2024

We rely on Python to tell us that IPv6 is enabled. Can you try the following command please?

python -c "import socket ; print(socket.has_ipv6)"

@ghost
Copy link

ghost commented Jun 16, 2024

A look into the Python sources tells me that socket.has_ipv6 returns a boolean value indicating if IPv6 is supported by this Python binary. But it doesn't tell, if IPv6 is active in the OS. This can be tested in a Docker container. Although Docker uses interfaces with only IPv4 addresses socket.has_ipv6 returns True.

I find the following StackOverflow discussion interesting:
https://stackoverflow.com/questions/66246308/detect-if-ipv6-is-supported-os-agnostic-no-external-program

@jsaenzh01
Copy link
Author

Hi,

Of course. My output:
Captura de pantalla_20240617_091403

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants