Skip to content

Instantly share code, notes, and snippets.

@mcgivrer
Last active September 2, 2022 12:33
Show Gist options
  • Save mcgivrer/9e263143d8dc0660c14298165b8fa6f8 to your computer and use it in GitHub Desktop.
Save mcgivrer/9e263143d8dc0660c14298165b8fa6f8 to your computer and use it in GitHub Desktop.
Installing and using WSL2+Ubuntu

Installing and using WSL2+Ubuntu

Installing

WSL 2

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Ubuntu

  1. Install Ubuntu
wsl --install -d Ubuntu
  1. update/upgrade it :
sudo apt update
sudo apt full-upgrade

image

Network issue on Windows 10 ?

Sometime, the network to internet stop working. To resolve this issue, just do the following things:

  1. sudo nano /etc/resolv.conf
  2. Remove line out the nameserver nameserver 17...
  3. add this new line nameserver 8.8.8.8
  4. ctrl + o and ctrl + x to write a quit
  5. sudo nano /etc/wsl.conf
  6. Paste the following in:
[network]
generateResolvConf = false
  1. ctrl + o and ctrl + x to write a quit
  2. close WSL and reopen, hopefully the issue is fixed :)

NOTE And if for a strange reason, the resolv.conf file is not accessible, try delete it a recreate it from scratch with only namesserver 8.8.8.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment