DEV Community

Discussion on: Install Docker on Windows (WSL) without Docker Desktop

 
bowmanjd profile image
Jonathan Bowman

Just double-checking: are you sure you have iptables installed?

Thread Thread
 
sw1tch73ch profile image
sw1tch73ch

Yes. I did "sudo apt-get install iptables" to be sure. It seems like there is another package that adds the iptables-legacy links. I even removed and installed fresh wsl. Either Windows is remembering somewhere that it doesn't add the iptables-legacy rules, or I'm missing a package (or more than one) somewhere.

Thread Thread
 
bowmanjd profile image
Jonathan Bowman

Well, let's check. On your Debian install, what is the result of dpkg -S /usr/sbin/iptables-legacy?

Thread Thread
 
sw1tch73ch profile image
sw1tch73ch

dpkg shows:

$ dpkg -S /usr/sbin/iptables-legacy
dpkg-query: no path found matching pattern /usr/sbin/iptables-legacy

iptables is installed:
$ iptables --version
iptables v1.6.0

Thread Thread
 
sw1tch73ch profile image
sw1tch73ch

I'm not sure what happened to the previous reply:

$ dpkg -S /usr/sbin/iptables-legacy
dpkg-query: no path found matching pattern /usr/sbin/iptables-legacy
$ iptables --version
iptables v1.6.0

I think iptables installs when Debian itself is installed. It just isn't setting up the legacy rules. Searching around google, the answer that keeps popping up is to use the update-alternatives, which is the whole problem

Thread Thread
 
bowmanjd profile image
Jonathan Bowman

I probably sound like I am quite fixated on the iptables package, but would you try reinstalling it? Using apt install --reinstall iptables

Thread Thread
 
sw1tch73ch profile image
sw1tch73ch

So I looked in /usr/sbin... I only have one entry if I look for iptables:

$ ls /usr/sbin/iptable*
/usr/sbin/iptables-apply

I believe there should be nearly a dozen links to other objects there.

Thread Thread
 
sw1tch73ch profile image
sw1tch73ch

$ sudo apt install --reinstall iptables
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 288 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 deb.debian.org/debian stretch/main amd64 iptables amd64 1.6.0+snapshot20161117-6 [288 kB]
Fetched 288 kB in 0s (2,349 kB/s)
(Reading database ... 36399 files and directories currently installed.)
Preparing to unpack .../iptables_1.6.0+snapshot20161117-6_amd64.deb ...
Unpacking iptables (1.6.0+snapshot20161117-6) over (1.6.0+snapshot20161117-6) ...
Setting up iptables (1.6.0+snapshot20161117-6) ...

$ update-alternatives --config iptables
update-alternatives: error: no alternatives for iptables

I agree it must be something in iptables too. It just doesn't set the default links in the install process to be able to switch to the legacy rules.

Thread Thread
 
bowmanjd profile image
Jonathan Bowman

Debian 9, I see. I honestly haven't tried this with older versions of Debian. Did 9 even use nftables? Pretty sure there is no legacy version because iptables wasn't legacy then. Does dockerd work?

Thread Thread
 
sw1tch73ch profile image
sw1tch73ch

I didn't notice the 9. It is the latest from Microsoft - or so I thought. Dockerd does work. Maybe the project I'm trying to compile doesn't like Debian 9! Here I thought it was because the iptables didn't follow the instructions. Strange my Debian is so far behind.