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

9,220

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
Share:
9,220

Related videos on Youtube

donut
Author by

donut

Updated on September 18, 2022

Comments

  • donut
    donut over 1 year

    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.

  • Startec
    Startec over 3 years
    Good to know we can safely ignore it - how do we make it go away permanently?
  • MaXi32
    MaXi32 almost 3 years
    @Startec You can ignore this error by adding -oAddressFamily=inet into ssh call. Vote me up if you find this useful.
  • MaXi32
    MaXi32 almost 3 years
    You might got a new warning message Warning: Permanently added the ECDSA host key for IP address '103.3.60.123' to the list of known hosts. Now add another extra option like this: -o "StrictHostKeyChecking no"
  • Thomas Guyot-Sionnest
    Thomas Guyot-Sionnest almost 3 years
    @MaXi32 that has nothing to do with WSL, this is normally a one-time notice because the host's IP changed, and would should probably not ignore it. This will also tell you when the host keys changed, which could be because the target server was rebuilt/replaced or someone might be hijacking this connection.
  • MaXi32
    MaXi32 almost 3 years
    @ThomasGuyot-Sionnest I did not say anything that this related to WSL. Even I knew his original question is not related to WSL. I just replied to his 1 year old question on the comment which he asked how to ignore the warning messages permanently.