skip to Main Content

i got this type of error i need some help

wsl: Error: 0xffffffff
Error code: CreateInstance/CreateVm/ConfigureNetworking/HNS/0xffffffff
wsl: Failed to configure network (networkingMode Nat), falling back to no networking.
jefta@DESKTOP-JPSPBJP:~$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
curl: (6) Could not resolve host: raw.githubusercontent.com
jefta@DESKTOP-JPSPBJP:~$

i just install wsl and ubuntu in my windows, and when i want to install homebrew i got this error and i cannot install anything

I had to update i /etc/wsl.conf and restart my WSL instance

[network] generateResolvConf = true

i had try this:
netsh winsock reset

i also have try this:
sudo rm /etc/resolv.conf
sudo nano /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

2

Answers


  1. the same error occurred on my PC, but I found a simple solution:

    There is probably a process using your port 53, such as a DNS proxy. To kill this process, run the following commands in your PowerShell as admin:

    1. netstat -aon | findstr 53
    2. taskkill /f /pid [PID of processs listening on port 53]
    3. wsl --shutdown

    After that, reopen your Ubuntu.

    Login or Signup to reply.
  2. Hard to tell in your situation, at least without a lot more detail. You see this error if the Virtual Switch is simply missing, or WSL has been configured to use a virtual switch that is not present or bound to the wrong/missing physical adapter.

    WSL2 borrows bits from Hyper-V server, and installs a virtual switch adapter for the network interface.
    WSL connects to that adapter (usually called ‘Wsl’ or ‘Default’) if that is missing or has the wrong name you get that error or similar. It’s M$ speak for ‘device not found’ – why it can’t just say that…..

    The other place it can go wrong is in the Control Panel. (Which I believe M$ are going to remove soon, if not already) Without it it’s much more difficult to view/alter but I do have notes on that some place. In control panel (just as in Powershell) you can bind protocols to adapters. IIRC, but I am not able to check right now the ‘protocol’ that it needs is ‘Bridging’ as I think the virtual switch is really a bridge. I am not really using WSL as much these days as I’ve just about moved away from Windows.

    WSL2 does not install all the tools required to make any changes though you can make the changes using PowerShell and/or install Hyper-V Server Switch Manager (I may have the name wrong). That can be used to create/modify Hyper-V virtual switches. The PowerShell modules that has all this is called "Hyper-V" help vm should list lots. If not try import module hyper-v.

    Windows allows hiding of virtual adapters, and I have seen it that the virtual adapter is ‘missing’ but is not and is actually ‘hidden’, then you make a change and it fails because the hidden one exists, leaving WSL config in a mess. I’ve also seen just removing and replacing the switch fixes things. I have always assumed from that there are ways to misalign settings held in more than one place.

    There is a wsl.conf (or .wslconfig) setting vmSwitch=’name’ that can be used to change the name of the adapter to match the VirtualSwitch that is present. note you can’t change the ‘Default’ one. This setting allows you to have more than one adapter, e.g. for multiple WSL installs. If that is present and wrong this error and similar ones occur as it will point to the wrong adapter (or a typo).

    To create adapters take a look at the Hyper-V powershell commands. There are not preset by default, you have to install them using import-module and install-module use get-help about_modules. IIRC the command to create a new virtual switch is Add-VMSwitch.

    use find-module * you will see how many modules there are – it’s insane and many are out of date, break stuff or misnamed.

    I have many notes on setting all this up but won’t waste time writing that here if this is not the cause as 1: not sure where I saved them and 2: What commands to use depends on the cause, of which there are many. (Windows Firewall being another, also user permissions, domain restrictions, etc)

    Saying all that, as this is the most likely, you can check you have the adapters present with Powershell (as administrator). Using a command which I believe is universally available, if not try update-help to get more help file data then you can find the module it lives in followed by any install module and import module to enable it. set-netadapter is used to alter settings (e.g. the name).
    e.g.

    PS:> get-netadapter
    
    Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
    ----                      --------------------                    ------- ------       ----------             ---------
    HUB                       Realtek USB GbE Family Controller            21 Up           98-FD-B4-12-34-56         1 Gbps
    vEthernet (Default Switc… Hyper-V Virtual Ethernet Adapter             20 Up           00-15-5D-F2-9A-44        10 Gbps
    vEthernet (WSL)           Hyper-V Virtual Ethernet Adapter #2          93 Up           00-15-5D-E0-2B-CE        10 Gbps
    
    # More detail
    PS:> get-netadapter -IncludeHidden | format-list
    
    # Include -name 'Name Here' from the above list if you want to just one adapter.  Wildcards work too.
    
    

    Above you can see on this machine (and old laptop) it has two vEthernet adapters, these are what WSL is using, though I don’t have hyper-v on it so can’t say more than that.

    Use something like this to find some of the (other 1000’s of IMO overly complicated) powershell commands related to this.

    get-help -detailed NetAdapter
    get-help -detailed vm
    #(or just help)
    help -detailed switch
     
    

    Despite being by M$, help works rather well for mining information. Much better than Google, etc. Which I find just misleads.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search