Skip to content

Commit

Permalink
Add WSL2 network speed fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslago committed Sep 26, 2020
1 parent fa745c5 commit bc1fa0c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
18 changes: 18 additions & 0 deletions Windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Slow network speed inside WSL2

1. Open Ubuntu (or your other distro)
1. Open Network Connections in your settings ("View network connections" in your windows search)
1. You should see
> vEthernet (WSL)
> Enabled
> Hyper-V Virtual Ethernet Adapter
1. Right-click and open Properties
1. In the Properties pane, click Configure...
1. In the Configure pane, go to the "Advanced" Tab
1. Click on "Large Send Offload Version 2" and update the value to "Disabled"
If you see two "Large Send Offload Version" options, disable both.

Additionally, it is recommended that you install any projects, packages, etc. to your Linux file system.

1. In your Ubuntu/other cli, navigate to your Linux file system with cd ~
1. Sanity-check you're in your Linux file system by using the command explorer.exe .. This should open File Explorer inside Network > wsl$ > Ubuntu (or other) > home > user
21 changes: 16 additions & 5 deletions ubuntu-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,27 @@ sudo apt install -y \
firefox \
neofetch


# Snap is not compatible with WSL2
if ! [ -d "/run/WSL" ]; then
if command snap > /dev/null 2>&1; then
sudo snap install authy --beta
sudo snap install code --classic
snap install spotify
fi

if [ -d "/run/WSL" ]; then
echo "Running WSL2 bootstrap script"
echo "==> running WSL2 bootstrap script"
sh ./wsl2-bootstrap.sh
fi

if ! command z > /dev/null 2>&1; then
echo "==> Installing z"
git clone https://github.com/rupa/z.git
sudo cp ./z/z.sh /usr/local/bin && rm -rf ./z
fi

if ! command docker -v > /dev/null; then
echo "Installing Docker"
echo "==> Installing Docker"
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
Expand All @@ -70,6 +77,7 @@ fi


if ! command google-chrome-stable --help > /dev/null; then
echo "Installing chrome"
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - \
&& sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' \
&& sudo apt update \
Expand All @@ -79,6 +87,7 @@ if ! command google-chrome-stable --help > /dev/null; then
fi

if ! command yarn --help > /dev/null; then
echo "Installing yarn"
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install -y yarn
Expand All @@ -87,20 +96,22 @@ fi

VIM_PLUG_FILE="${HOME}/.vim/autoload/plug.vim"
if [ ! -f "${VIM_PLUG_FILE}" ]; then
echo "==> Installing vim plug"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo " ==> Vim plugins will be installed on vim startup"
fi

NEOVIM_PLUG_FILE="${HOME}/.local/share/nvim/site/autoload/plug.vim"
if [ ! -f "${NEOVIM_PLUG_FILE}" ]; then
echo "==> Installing neovim plug"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
echo " ==> Neovim plugins will be installed on nvim startup"
echo "==> Neovim plugins will be installed on nvim startup"
fi

if [ ! -d "${HOME}/.oh-my-zsh" ]; then
echo " ==> Installing oh-my-zsh + zsh plugins"
echo "==> Installing oh-my-zsh + zsh plugins"
git clone https://github.com/ohmyzsh/ohmyzsh.git ${HOME}/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${HOME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
git clone https://github.com/zsh-users/zsh-autosuggestions "${HOME}/.oh-my-zsh/custom/plugins/zsh-autosuggestions"
Expand Down
2 changes: 2 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,5 @@ function change-mac() {
}

[ -s "/Users/$USER/.jabba/jabba.sh" ] && source "/Users/$USER/.jabba/jabba.sh"

. /usr/local/bin/z.sh

0 comments on commit bc1fa0c

Please sign in to comment.