Why can I not ping and apt update?

  1. My host runs a Linux distribution (Ubuntu). WSL is a special case and likely requires extra care.
  2. A firewall that normally protects other network interfaces, may block access to the managed (by Incus) network interface. It’s a common occurence but likely does not apply here.
  3. I can run apt update.
  4. And ping to external websites.
  5. The /cloud that is appended, adds some extra configuration that is not relevant here. It’s a matter of habit from my side. The extra configuration is cloud-init support, which means that you have the ability (if you want to) to provide extra configuration in the form of cloud-init commands so that when the instance boots up, it will automatically get configured with those commands. By doing so, you can have a somewhat custom instance without having to recompile anything beforehand. Also, the instance will get a non-root account so that you can get a shell as a non-root user. The Ubuntu images get a ubuntu non-root account, debian for Debian instances, alpine for Alpine instances, etc.
  6. I think this is the issue here. Incus, that runs on the host (WSL), has to add special Linux firewall rules just to make sure that the managed Incus network bridge is able to provide network connectivity to the instances. Being WSL, something did not work here, hence the lack of network connectivity.

I do not know what’s the state of support for Incus VMs in WSL.

  1. Do you use WSL or WSL-2? They are quite different, the latter is a Linux VM running in Hyper-V in Windows, and in there you are running Incus.
  2. There’s this issue Running Incus VM's on WSL-2 · microsoft/WSL · Discussion #11167 · GitHub which I do not know if it has been resolved. By running incus commands on the VM instances I believe it’s resolved for the Debian WSL-2 Linux kernel.
  3. Use sudo iptables -L or sudo nft list ruleset to list those firewall rules that have been added by Incus so that the managed (by Incus) bridge is able to provide network connectivity to the instances.