Disable ipv6 on incus

I running ubuntu22 and running incus.
I want to disable ipv6 for incus vm. or for some vm
i set ipv6 to each incus vm (net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 1). it’s not help i need to stop it before i start my vm.
how to do it?

One idea is to disable it at the Incus network level, or create a new Incus network that does not support IPv6.

Another idea is to disable it from inside the VM. That way Incus is not involved. How to do this depends on the OS of the VM.

There might be a way of getting those other Incus settings to work. I have not used them.

i did i set the same in ubuntu
i set ipv6 to each incus vm (net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 1
and sysctl -p and reboot my ubuntu. i still have a ipv6 on all my vm.

If you’re talking about actual VMs rather than containers, then you can add ipv6.disable=1 to the kernel command line parameters of each VM

(for Ubuntu: edit /etc/default/grub, add that flag to GRUB_CMDLINE_LINUX_DEFAULT, and run update-grub)

If these VMs/containers are using the default network (incusbr0) then you can create a new network which has IPv4 but not IPv6. That would be the simplest solution.

There is of course the question about why you need to disable IPv6 in the first place.

not working i need to stop in incus. please help

Sorry, we can’t provide a solution without a clearly-defined problem. Ideally this would be a step-by-step reproduction, showing at each stage what you did, what you saw, and what you expected or wanted to see instead.

this is my incus network ls
incus network ls
±----------------±---------±--------±-------------±--------------------------±------------±--------±--------+
| NAME | TYPE | MANAGED | IPV4 | IPV6 | DESCRIPTION | USED BY | STATE |
±----------------±---------±--------±-------------±--------------------------±------------±--------±--------+
| enx083a886287bb | physical | NO | | | | 0 | |
±----------------±---------±--------±-------------±--------------------------±------------±--------±--------+
| incusbr0 | bridge | YES | 10.9.71.1/24 | fd42:c9e8:f086:bfec::1/64 | | 6 | CREATED |
±----------------±---------±--------±-------------±--------------------------±------------±--------±--------+
| lxdbr0 | bridge | NO | | | | 0 | |
±----------------±---------±--------±-------------±--------------------------±------------±--------±--------+
| wlp9s0 | physical | NO | | | | 0 | |
±----------------±---------±--------±-------------±--------------------------±------------±--------±--------+

and i can’t disable ipv6 on it.

i edit it now. i don’t save it and going out. sorry. it working. thanks

What do you mean by “it”? The incusbr0 network?

But I’m glad you’ve sorted your problem.

yes i edit the incusbr0 and remove ipv6 from that.