What's this error in SSH on Windows Subsystem for Linux? setsockopt IPV6_TCLASS 16: Operation not permitted

I am using Windows Subsystem for Linux. When I login to my home server using SSH, I first get the following error

setsockopt IPV6_TCLASS 16: Operation not permitted:

and then everything works as expected:

Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-77-generic x86_64)
etc

From what I can gather, setsockopt is a... thing (it's not a runnable command) used to change socket options, but I have no idea by who or why.

I am mostly interested in what this error is and why it pops up and, since everything still works, less interested in how to fix it (unless it's a big bad scary thing), though that would be nice to know too.

FWIW this is a freshly installed server and I am using keys for SSH. WSL Ubuntu version: 16.04.2 LTS. Windows version: 1703, build number: 15063.296.


Solution 1:

setsockopt is a Linux syscall - a command sent to the Linux kernel from a userspace application. setsockopt is a very generic one used to set various options on all kind of sockets. In your case it's most likely a descriptor to the udp connection used to resolve the name (DNS) or the tcp connection to your home server (SSH).

IPV6_TCLASS is used to set the IPV6 Traffic class, and the reason it fails is either Windows or WSL do not support that operation or requires special privileges you don't have (The Operation not permitted text comes from the standard library for the ENOPERM error, and although it's about permissions it's not impossible WSL returned it for other reason to maintain app compatibility).

You can safely ignore this error, all it means is that some of the network connections likely did not use the traffic class the application desired, which is unlikely to cause you any issue anyway.

If you'd like to understand more about how WSL works under the hood there is a great video series with accompanying blog articles covering every aspects of WSL (Scroll down the blog posts for the video):

  1. Windows Subsystem for Linux: Architectural Overview
  2. Windows Subsystem for Linux: Process Architecture
  3. Windows Subsystem for Linux: WSL System Calls
  4. Windows Subsystem for Linux: WSL File System Support
  5. Windows and Ubuntu Interoperability
  6. WSL Networking