1
1
# WSL2-setup
2
- Get ready with Windows WSL2 for python development. The setup prepares you for local development with Docker and working in AWS.
2
+ Get ready with Windows WSL2 for python development. The setup prepares you for local development with containers (podman) and working in AWS.
3
3
We mainly work with JetBrains PyCharm Professional, but you can also use this setup if you want to work with VS Code
4
4
5
5
The following setup is tested with
6
6
- Windows 11 Pro ( Version 22H2 )
7
7
- WSL2 feature enabled
8
- - VS Code 1.77
9
- - PyCharm Professional 2023.1
10
- - Docker Desktop 4.18.0
8
+ - VS Code 1.80
9
+ - PyCharm Professional 2023.2
11
10
12
11
If you have other versions than the ones mentioned above, you might encounter different outcomes or run into issues.
13
12
In case of any questions or suggestions, please open up an issue here.
@@ -17,8 +16,7 @@ Task that we will accomplish during this setup
17
16
- install software packages required for modern python development: [ pyenv] ( https://github.com/pyenv/pyenv )
18
17
and [ poetry] ( https://python-poetry.org/docs )
19
18
- configure ssh agent to load your certificates automatically
20
- - ensure AWS client is configured and authentication with saml2aws works
21
- - set up a second WSL2 instance with the latest Ubuntu 23.04
19
+ - ensure AWS client is installed
22
20
- remove a WSL2 instance
23
21
24
22
If not stated otherwise, all commands will run inside the WSL instance in Linux bash.
@@ -104,13 +102,6 @@ wsl -l -v
104
102
wsl -d $WSL2_INSTANCE
105
103
```
106
104
107
- ## Configure AWS CLI and saml2aws
108
- tbd.
109
-
110
- In the meantime, please help yourself with
111
- the [ AWS CLI] ( https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html ) and
112
- [ saml2aws] ( https://github.com/Versent/saml2aws ) documentation.
113
-
114
105
## Global git config
115
106
If you have set up a new WSL2 instance, you should create a global git config. The minimum you have to do is set your
116
107
username and email address. Please set the placeholders ` <your-name> ` and ` <your-email-address> ` in the script with your
@@ -156,47 +147,6 @@ It's required to keep your WSL instance up to date. form time to time you can ac
156
147
``` shell
157
148
sudo -- sh -c ' apt-get update; apt-get upgrade -y; apt-get full-upgrade -y;'
158
149
```
159
-
160
- ## Set up a second distro
161
- inspired by https://cloudbytes.dev/snippets/how-to-install-multiple-instances-of-ubuntu-in-wsl2
162
- and updated to the latest Version of Ubuntu. Run the following commands in a
163
- ___ PowerShell terminal___
164
-
165
- ```
166
- Remove-Item alias:curl
167
- mkdir $HOME\wsl2
168
- cd $HOME\Downloads
169
- curl "https://cloud-images.ubuntu.com/wsl/lunar/current/ubuntu-lunar-wsl-amd64-wsl.rootfs.tar.gz" --output ubuntu-23.04-wsl-rootfs.tar.gz
170
- $WSL2_INSTANCE="ubuntu-2304-dev1"
171
- wsl --import $WSL2_INSTANCE $HOME\wsl2\$WSL2_INSTANCE .\ubuntu-23.04-wsl-rootfs.tar.gz
172
- wsl -d $WSL2_INSTANCE
173
- ```
174
-
175
- The last command started your second WSL2 instance. Now you can create your user, set the password and ensure that
176
- you are automatically logged in.
177
-
178
- Please replace ` <USERNAME> ` with your own username.
179
-
180
- ``` shell
181
- NEW_USER=< USERNAME>
182
- ```
183
- ``` shell
184
- useradd -m -G sudo -s /bin/bash " $NEW_USER "
185
- passwd " $NEW_USER "
186
- ```
187
- To ensure your user is login in by default instead of roo, execute the following command in the WSL instance:
188
- ``` shell
189
- tee /etc/wsl.conf -a << _EOF
190
- [user]
191
- default=${NEW_USER}
192
- _EOF
193
- ```
194
-
195
- You need to restart your WSL instance to activate the change.
196
- Once you are successfully logged in, you can proceed with
197
- - Install required linux packages
198
- - SSH config for git
199
- - Configure AWS CLI and saml2aws
200
150
201
151
## Remove a WSL instance
202
152
Removal of a WSL2 instance is straight forward.
0 commit comments