- Open Task Manager
- Performance Tab
- Select CPU
- Check for "Virtualization Enabled"
You will need to boot into your EFI/BIOS setup screen and enable it. This is different for every manufacturer.
wsl --install
This usually requires a reboot. When the PC reboots be looking for an Ubuntu window to automatically open.
Don't close it by accident!
Set a username and password for your Linux system. Remember this username and password!
- Press Control+, to get to the settings
- Change the default profile to Ubuntu
- Click Save
- Close the settings tab
sudo apt update
sudo apt install -y build-essential git python-is-python3 python3-venv zip unzip tree
Replace the bits in <>
with your own information
git config --global user.name "<firstname lastname>"
git config --global user.email "<youremail@yourdomain.com>"
sudo apt install -y zsh
chsh -s /bin/zsh
Close the terminal and reopen it to use ZSH
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~). This function can help you with a few settings that should
make your use of the shell easier.
You can:
(q) Quit and do nothing. The function will be run again next time.
(0) Exit, creating the file ~/.zshrc containing just a comment.
That will prevent this function being run again.
(1) Continue to the main menu.
(2) Populate your ~/.zshrc with the configuration recommended
by the system administrator and exit (you will need to edit
the file by hand, if so desired).
--- Type one of the keys in parentheses ---
At this prompt choose option 2.
# installs fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash
# download and install Node.js
fnm use --install-if-missing 20
# verifies the right Node.js version is in the environment
node -v # should print `v20.14.0`
# verifies the right NPM version is in the environment
npm -v # should print `10.7.0`
mkdir ~/projects
From now on you will put any new projects in this new folder.
- open VSCode
- Search for the extension: WSL by microsoft
- Install it.
- Install any other extensions you were previously using in WSL (Python extension etc)
- Close vscode
To test, create a sample project in your projects directory
# Change into yoru projects dir
cd ~/projects
# make a directory
mkdir test-project
# Change into it
cd test-projects
# create an empty python file
touch hello.py
# Open vscode
code .
Put some python code into the hello.py
file and verify you can run the code.
You can also test making a virtual environment. From now on you will use the same commands as the macOS user have been using.
python -m venv .venv
source .venv/bin/activate
Test pip installing something, perhaps rich
or you could also pip install django
or anything else really.
Once you've tested this you can remove this test-project folder.
There's two options for this, one is using the built in capabilities of zsh to configure a prompt
The other is to install starship, a customizable prompt program and replace the zsh prompt.
Only choose one of the following options:
You can do this or setup the starship prompt below
Edit your ~/.zshrc
file and add the following lines:
# Load the vcs_info module, which shows version control system info (like git branch, status, etc.)
autoload -Uz vcs_info
# Hook the vcs_info function into the "precmd" function, which runs right before the prompt is displayed.
# This ensures the version control information is updated before each new prompt.
precmd() { vcs_info }
# Enable vcs_info for git repositories. It tells vcs_info to gather information specifically for git.
zstyle ':vcs_info:*' enable git
# Customize the format of the vcs_info display.
# %F{cyan} sets the text color to cyan. %s shows the VCS (version control system) type.
# %b shows the branch name, and %f resets the text color. %u and %c show the staged and unstaged changes.
zstyle ':vcs_info:*' formats "%F{cyan}(%s) %b%f %u %c "
# Check for uncommitted changes in the working directory before each prompt.
zstyle ':vcs_info:*' check-for-changes true
# Customize the display for staged changes in green.
zstyle ':vcs_info:*' stagedstr '%F{green}(staged)%f'
# Customize the display for unstaged (modified) changes in red.
zstyle ':vcs_info:*' unstagedstr '%F{red}(modified)%f'
# Enable the prompt to be re-evaluated every time it is displayed. This allows dynamic content like vcs_info to be updated.
setopt prompt_subst
# Update the shell prompt (PS1) to include the vcs_info output.
# ${vcs_info_msg_0_} contains the vcs_info message (like git branch and status).
# %F{green}%/%f shows the current working directory in green.
# %F{yellow}%#%f shows the prompt symbol (# for root, % for normal users) in yellow.
PS1='${vcs_info_msg_0_}
%F{green}%/%f
%F{yellow}%#%f '
After restarting your terminal you should see a nicer more colorful prompt
curl -sS https://starship.rs/install.sh | sh
Open your ~/.zshrc file in vscode
code ~/.zshrc
Remove these lines from the top of your .zshrc file
autoload -Uz promptinit
promptinit
prompt adam1:w
And add the following line in it's place
eval "$(starship init zsh)"
Save the file, close vscode and your terminal, and open a new terminal to activate starship.
Check out this link from Microsoft https://learn.microsoft.com/en-us/windows/wsl/filesystems
This is easy, you can just clone them down again in your new projects folder.
cd ~/projects
git clone <git clone url here>
If you've been using SSH keys for git, you will need to go through the process of generating a new key.
ssh-keygen -t ed25519
You can set a passphrase or leave it empty, it's up to you.
Then grab the public key and put it on your clipboard
cat ~/.ssh/id_ed25519.pub
Then paste it into github or gitlab or whereever you need to use it.