Last active
May 10, 2024 04:03
-
-
Save jcefoli/5593ddc330a5e1d6cbf9ffd0eeb3e53b to your computer and use it in GitHub Desktop.
Set WSL Version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check WSL Version | |
wsl -l -v | |
# Set WSL Version to 2 | |
wsl --set-version Ubuntu-22.04 2 | |
# Fix WSL2 Networking (per https://stackoverflow.com/a/65325532) | |
rm /etc/resolv.conf || true | |
rm /etc/wsl.conf || true | |
cat <<EOF > /etc/wsl.conf | |
[network] | |
generateResolvConf = false | |
[automount] | |
enabled = true | |
options = "metadata" | |
mountFsTab = false | |
EOF | |
cat <<EOF > /etc/resolv.conf | |
nameserver 8.8.8.8 | |
nameserver 8.8.4.4 | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment