Skip to content

Commit d06a06c

Browse files
authored
Merge pull request #49 from piouson/update-wsl-vpnkit
Update wsl-vpnkit setup to use systemd
2 parents 314bc95 + 534ed62 commit d06a06c

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

README.md

+27-20
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ A Unix-based environment running docker (Docker Engine or Docker Desktop).
107107

108108
<details>
109109
<summary>macOS users</summary>
110+
<br>
110111

111112
```sh
112113
# 1. install xcode tools
@@ -119,7 +120,8 @@ brew install --cask docker
119120
</details>
120121

121122
<details>
122-
<summary>Windows users</summary>
123+
<summary>Windows users</summary>
124+
<br>
123125

124126
```sh
125127
# powershell as administrator
@@ -135,11 +137,18 @@ winget install Docker.DockerDesktop
135137
After device restart:
136138

137139
1. Complete Ubuntu user setup - Ubuntu terminal should auto-open
138-
2. [Enable `systemd`](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/) - run `sudo nano /etc/wsl.conf` and update file to:
140+
2. [Enable `systemd`](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/):
139141
```sh
142+
sudo nano /etc/wsl.conf
143+
```
144+
```sh
145+
# /etc/wsl.conf
140146
[boot]
141147
systemd=true
142148
```
149+
```sh
150+
wsl.exe --terminate Ubuntu
151+
```
143152
3. [Enable Docker Desktop integration with WSL2 Ubuntu](https://docs.microsoft.com/en-us/windows/wsl/media/docker-dashboard.png)
144153
4. [Open Terminal and switch to Ubuntu](https://user-images.githubusercontent.com/17856665/192830999-f8f9c5af-8b4e-41c4-8f5e-c9c159fcf9ca.png)
145154
5. [Make Ubuntu your default Terminal profile](https://user-images.githubusercontent.com/17856665/192833271-5a3170a0-caf6-45bf-b378-ac6eb1f2dfbc.png)
@@ -150,41 +159,39 @@ After device restart:
150159
> 💡 If connection fails with `Could not resolve host`, and you have a VPN program installed, see _WSL2 VPN fix_ below
151160
152161
<details>
153-
<summary>WSL2 VPN fix</summary>
162+
<summary>WSL2 VPN fix</summary>
163+
<br>
154164

155-
```sh
165+
See [wsl-vpnkit documentation](https://github.com/sakai135/wsl-vpnkit/#wsl-vpnkit) for more details.
166+
```powershell
156167
# powershell as administrator
157-
# 1. download vpnkit
158168
wget -o wsl-vpnkit.tar.gz https://github.com/sakai135/wsl-vpnkit/releases/latest/download/wsl-vpnkit.tar.gz
159-
# 2. add vpnkit as linux distro
160169
wsl --import wsl-vpnkit $env:USERPROFILE\wsl-vpnkit wsl-vpnkit.tar.gz --version 2
161-
wsl -d wsl-vpnkit
162-
# 3. switch to wsl2 ubuntu terminal
163-
wsl
164-
# 4. create an alias `vpnkit`
165-
printf '# vpnkit - fix vpn network issues\nalias vpnkit="wsl.exe -d wsl-vpnkit service wsl-vpnkit"' >> ~/.bashrc
166-
# 5. load the new alias
167-
exec bash
168-
# 6. start the vpnkit
169-
vpnkit start
170-
# 7. test internet connection again
170+
```
171+
```sh
172+
# wsl2 ubuntu
173+
wsl.exe -d wsl-vpnkit --cd /app cat /app/wsl-vpnkit.service | sudo tee /etc/systemd/system/wsl-vpnkit.service
174+
sudo systemctl enable wsl-vpnkit
175+
sudo systemctl start wsl-vpnkit
176+
systemctl status wsl-vpnkit # should be Active
177+
# test internet connection again
171178
curl google.com
172-
# note that you can stop the fix with `vpnkit stop`, see https://github.com/sakai135/wsl-vpnkit
173179
```
174180
175181
</details>
176182
177183
</details>
178184
179185
<details>
180-
<summary>Debian users</summary>
186+
<summary>Debian users (and Windows without Docker Desktop)</summary>
181187
<br />
182188
183-
Install Docker Engine on any Debian-based OS like Ubuntu or Raspberry Pi. This is also an alternative for Windows users running WSL2.
189+
See [Install Docker Engine documentation](https://docs.docker.com/engine/install) for more details and other distro steps. \
190+
This is also an alternative for Windows users running WSL2.
184191
185192
> 💡 If using WSL2, be sure to:
186193
> 1. Enable `systemd` - see the _Windows users_ section
187-
> 2. [Disable Docker Desktop integration with WSL2](https://docs.microsoft.com/en-us/windows/wsl/media/docker-dashboard.png)
194+
> 2. If installed, [disable Docker Desktop integration with WSL2](https://docs.microsoft.com/en-us/windows/wsl/media/docker-dashboard.png)
188195
189196
```sh
190197
# 1. uninstall old docker versions

0 commit comments

Comments
 (0)