Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error The attempted operation is not supported for the type of object referenced when using virtual network adapter on wsl2 #5351

Closed
menesesleonardo opened this issue Jun 6, 2020 · 44 comments
Labels

Comments

@menesesleonardo
Copy link

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.264]
Distribution version: Ubuntu 20.04 LTS
WSL 2

Steps to reproduce

  • installing WSL2
  • ubuntu 20.04 from the store
  • setting or not the distribution user.
  • Installing VPN software with virtual network adapter (i.e. Astrill) (prior or after previous steps)
  • Running distribution [tried distro's console, microsoft terminal, terminal on vs code]

Expected behavior

Usable distro
Annotation 2020-06-06 142933

Actual behavior

If a vpn software with virtual network adapter is installed, renders impossible to use the distro on the new WSL2 with error The attempted operation is not supported for the type of object referenced
Annotation 2020-06-06 142348

disabling or uninstalling the virtual network adapter doesn't change the behaviour. The only way to go back to normal is uninstalling the whole vpn software.

Opening the distro in microsoft terminal shows an additional error code 4294967295
Annotation 2020-06-06 144623

The kind of network adapter is SSL VPN Adapter

Annotation 2020-06-06 142714

@mouridis
Copy link

Confirmed. Same issue.

@MrTomasz
Copy link

Try this

wsl --shutdown
netsh winsock reset

and retry.

@mfazam
Copy link

mfazam commented Jun 30, 2020

I am facing same issue with Open TEXT Socks Client.
trying "netsh winsock reset" fixes the WSL issue but it breaks my VPN connectivity.
Any other solution would be helpful

Thanks!

@saulotdr
Copy link

same problem here @mfazam

@smezger
Copy link

smezger commented Aug 24, 2020

I can confirm it as well!

@Bloodmallet
Copy link

Try this

wsl --shutdown
netsh winsock reset

and retry.

Fixed it only for one day for me.

@therealkenc
Copy link
Collaborator

Please collect WSL logs and post the backlink to the feedback item here. Also please identify any third-party networking software that has been installed on Windows.

@Mezzenine
Copy link

@therealkenc
I don't have the feedback hub installed on my company computer. Is this the only way to collect the WSL logs?

@smezger
Copy link

smezger commented Sep 9, 2020

@therealkenc Same for me with the company PC. I was able to install the feedback hub, however as sending diag data is disabled by group policy, I can not collect logs.

@therealkenc
Copy link
Collaborator

Not being able to send logs is actually not a bad data point, funny enough. Correlation (if not causation) "Can't send logs" and "Can't use WSL2".

Logs from the OP (aka "Astrill VPN" scenario) are mostly what is needed in this tracker. But if we never get logs, and the reason is because not a single person landing here on "attempted operation is not supported" can send them, that might point to a problem with the machines being locked down.

@patriceangot
Copy link

Same issue on my side :

image

image

Then :

image

image

So fixed until the next reboot of my Windows 10 machine.

@zantiu
Copy link

zantiu commented Sep 28, 2020

I had the same issue on a fresh install with Astrill VPN.

Then

wsl --shutdown
netsh winsock reset

fixed it.
Also no more issue after a reboot.

If it does come back then I should be able to get the logs since my machine is not locked down.

@franmgal
Copy link

franmgal commented Oct 27, 2020

Same here. With open text socks installed the wsl2 ubuntu shows the "Error The attempted operation is not supported for the type of object referenced ...." . If I try

wsl --shutdown
netsh winsock reset

The wsl2 starts working but the open text socks don't. I had to downgrade the ubuntu console to wsl1 to make both work.
They are mutually exclusive, no matter if I try rebooting.

@perjoe
Copy link

perjoe commented Nov 5, 2020

I have the same problem, and can confirm that Open text socks, does not work with WSL2, even tried uninstalling Open text socks , and install again, but still same problems , now i have reverted back to WSL1 , and everything is working nice again.

@i-curve
Copy link

i-curve commented Nov 7, 2020

Same issue in 20H2 (19042.610).
Must type the command to recover.

netsh winsock reset

@dohq
Copy link

dohq commented Nov 17, 2020

https://aka.ms/AAackm6
https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs
I have tried to get the logs according to the instructions provided.
If there is any missing information, I would be happy to direct you to it.

@sstorholm
Copy link

I have the same issue when installing Ubuntu from the Microsoft Store, I get "The attempted operation is not supported for the type of object referenced." as soon as the WSL2 instance "boots". Downgrading to WSL1 fixes the issue. Same issue with Debian from the Microsoft Store.

@iamaer4fa
Copy link

Try this

wsl --shutdown
netsh winsock reset

and retry.

This works for me.

@rscalize
Copy link

Open TE

same here

@Uxorious
Copy link

Uxorious commented Dec 8, 2020

No progress on a fix for this!??!?

@bsobhani
Copy link

bsobhani commented Dec 9, 2020

After typing "netsh winsock reset", don't listen when it says "You must restart the computer in order to complete the reset."

For me, it only works if I do not restart, and after I restart the problem comes back.

@hicksca
Copy link

hicksca commented Dec 10, 2020

While I do have a VPN client installed. It existed before I enabled wsl and updated to wsl2 and I could use the wsl default distro, I installed (openSUSE-Leap-15.2), along with rebooting with no issue. The issue started for me once I installed docker-desktop but the behavior is exactly the same. It only occurs when using an account that isn't in the admin group. (My user is in the Docker-Users , Hyper-V Administrators, and Network Configuration Operators)

When I reboot my machine and try to open a wsl distro or docker engine starts I get an error:

The attempted operation is not supported for the type of object referenced.

For me resetting the winsock stack is not a long term viable solution for me. This is on a work machine and for policy reasons I do not have admin access and my machine has to reboot every other day per group policy.
(running netsh winsock reset requires admin access)

Windows Version: Windows 10 Enterprise (v1909 build 18363.1198)
Docker Desktop: 2.5.0.1(49550) Stable

As a side note VPN version:
Palo Alto's GlobalProtect v 5.0.10-3

@s0nders
Copy link

s0nders commented Jan 18, 2021

How is this still an issue... I was finally ready to make the switch to windows full time......... please release a patch/solution for this soon. Having to reset the winsock manually and kill my vpn's is ridiculous.

@RichardDavies
Copy link

Try the NoLsp.exe solution found at #4177 (comment) It magically resolved this issue for me.

@markheath
Copy link

Every developer machine at my work has this problem, and the nolsp solution works reliably for us. (Apart from our virus checker won't let us run nolsp.exe so we wrote a LINQPad script that does the same thing - it's just a call to WSCSetApplicationCategory)

@soenkefn
Copy link

Every developer machine at my work has this problem, and the nolsp solution works reliably for us. (Apart from our virus checker won't let us run nolsp.exe so we wrote a LINQPad script that does the same thing - it's just a call to WSCSetApplicationCategory)

@markheath
I'm facing the same problem: security policy doesn't allow me to do this either.
Do you remember the input parameters you passed to WSCSetApplicationCategory exactly?
My call does not return, no error - nothing.
I'm somehow too stupid or inexperienced - or both.

@markheath
Copy link

Try this (needs to run as Administrator)

void Main()
{
    try
    {
        var p = "C:\\windows\\system32\\wsl.exe";
        UInt32 d = 0;
        var x = WSCSetApplicationCategory(p, (UInt32)p.Length, "", 0, 0x80000000, 0x0, ref d);
        // should return 0,0
        Console.WriteLine($"{x},{d}");
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.ToString());
    }
}

[DllImport("C:\\Windows\\System32\\ws2_32.dll")]
public static extern UInt32 WSCSetApplicationCategory(
		[MarshalAs(UnmanagedType.LPWStr)] string path,
		UInt32 len,
		[MarshalAs(UnmanagedType.LPWStr)] string param,
		UInt32 len2,
		UInt32 settings,
		UInt32 settings2,
		ref UInt32 settings3);

@soenkefn
Copy link

@markheath
Your script runs fine (thanks for that!!), unfortunately Docker does not (yet). so will have to keep working on it ...

@markheath
Copy link

I should mention that you probably also need to unregister and reinstall your wsl2 distro

@soenkefn
Copy link

soenkefn commented Feb 5, 2021

@markheath
May I ask you which Socks client you are using?
Do you think the solution should also work for OpenText?

@ijortengab
Copy link

I'm using SSH Dynamic Proxy inside WSL, then using proxifier in host to redirect traffic Chrome using proxy server.
Then, I am facing same issue.
However

Try this

wsl --shutdown
netsh winsock reset

and retry.

This works for me too.

@ghost
Copy link

ghost commented Apr 15, 2021

Try this

wsl --shutdown
netsh winsock reset

and retry.

solved my problem.

@eschweighofer
Copy link

Try the NoLsp.exe solution found at #4177 (comment) It magically resolved this issue for me.

Works prefectly

@hkatory
Copy link

hkatory commented Aug 9, 2021

Is there any planned fix for this issue? I have a continues conflict between WSL2 and OpenText SOCKS client, whenever the client is enabled, I can't run WSL, and when I run the command "netsh winsock reset" command to fix WSL OpenText SOCKS client stops working and I must reinstall it to get to work, which would cause the issue with WSL2 again!!

@ffainelli
Copy link

Same here, I have been desperately waiting to get a fix for this issue, this is seen with the GlobalProtect VPN client. The "fix" of doing "netsh winsock reset" upon every boot works, but boy, would not it be better if it worked out of the box on every boot?

@RichardDavies
Copy link

@ffainelli @hkatory Did you try this fix? #5351 (comment)

@ffainelli
Copy link

@RichardDavies for other reasons I cannot download the Lsp.exe application, do you know how to create a valid AppId_Catalog folder for wsl.exe?

@hilmarf
Copy link

hilmarf commented Sep 29, 2021

for me this solved all my trouble with WSL2 - MicrosoftDocs/WSL#547 (comment) - thanks a lot @esunilkumare

@ffainelli
Copy link

@hilmarf yes this does work great for me as well.

@marufbelete
Copy link

I had the same issue on a fresh install with Astrill VPN.

Then

wsl --shutdown
netsh winsock reset

fixed it. Also no more issue after a reboot.

If it does come back then I should be able to get the logs since my machine is not locked down.

this works form mew

@jan-hudec
Copy link

Duplicate of MicrosoftDocs/WSL#547?

@farshadb
Copy link

Same issue on my side :

image

image

Then :

image

image

So fixed until the next reboot of my Windows 10 machine.

Hey I always had to use VPN software, is there another way to fix this problem in wsl2 without uninstalling VPN software

@jan-hudec
Copy link

@F4r5h4d, the issue I linked in previous comment, MicrosoftDocs/WSL#547, says to create or update a registry entry, so you may try that. I have two different VPN softwares on that computer and after setting that registry entry, it works for me across reboots OK.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests