8

I use Windows 10 home (build 17134.471) with WSL-Ubuntu 16.04 (xenial).

I executed apt update -y && ufw --force enable and got the following trace (I don't know what it means - maybe some kernel functions missing thus some failed syscalls).

Is there any way to use WSL-Ubuntu as for today anyway?

Trace:

ERROR: problem running ufw-init
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-17134-Microsoft/modules.dep.bin'
modprobe: FATAL: Module nf_conntrack_ftp not found in directory /lib/modules/4.4.0-17134-Microsoft
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-17134-Microsoft/modules.dep.bin'
modprobe: FATAL: Module nf_nat_ftp not found in directory /lib/modules/4.4.0-17134-Microsoft
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-17134-Microsoft/modules.dep.bin'
modprobe: FATAL: Module nf_conntrack_netbios_ns not found in directory /lib/modules/4.4.0-17134-Microsoft
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 12
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 12
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.

Problem loading ipv6 (skipping)
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/after.rules'
Problem running '/etc/ufw/user.rules'
1

1 Answer 1

9

Because you don't have a Linux kernel.

ufw is a frontend for netfilter. Netfilter is the Linux Kernels support for filtering IP packets. Windows has a different mechanism, commonly named Windows Firewall.

ufw only supports netfilter, not Windows Firewall or other IP filtering technologies. It thus only works on systems with a Linux kernel.

The man page mentions this:

This  program  is for managing a Linux firewall and aims to provide an
easy to use interface for the user.

Some tools are really not portable to different platforms. This includes tools that, like ufw, attempts to interface the operating system kernel.

2
  • Taken from wiki.ubuntu.com: WSL2 features a Linux kernel running inside Windows 10 and is built on the core technology of Hyper-V to provide better Linux application support and improved file performance . I use WSL2 and cannot access internet since installing ufw. Do I have to uninstall ufw and reboot?
    – Timo
    Oct 20, 2020 at 14:13
  • @Timo Just disable it I think? sudo ufw disable
    – Jplus2
    Jun 2, 2021 at 9:24

You must log in to answer this question.