This needs to be done once per user.
- Go to https://github.com/romkatv/dotfiles-public and click Fork.
- Replace "romkatv" and "roman.perepelitsa@gmail.com" in
.gitconfigof the newly created fork with your own data. You can do it thrugh the GitHub web UI.
- Go to https://github.com/new and create an empty
dotfiles-privaterepo. Make it private.
- Generate a pair of ssh keys --
rsa_idandrsa_id.pub-- and addrsa_id.pubto github.com. See https://help.github.com/en/articles/connecting-to-github-with-ssh for details. Use a strong passphrase. - Backup
rsa_idin a secure persistent storage system. For example, in your password manager.
# 1.new generate SSH key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# 2.start ssh-agent in background
eval "$(ssh-agent -s)"
# 3.add SSH key to ssh-agent
ssh-add ~/.ssh/id_rsa
# 4.add SSH public key to GitHub account
https://docs.github.com/zh/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-accountThis needs to be done once per Windows installation. You don't need to repeat these steps when reinstalling Ubuntu.
- Download these four ttf files:
- Double-click on each file and click "Install". This will make
MesloLGS NFfont available to all applications on your system. - Open PowerShell as Administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux- Reboot if prompted.
- Install chocolatey from https://chocolatey.org/install.
- Open PowerShell as Administrator and run:
choco.exe install -y microsoft-windows-terminal vcxsrv
## Or use winget in Windows 11 (24h2)
winget install vcxsrv- Run Start > XLaunch.
- Click Next.
- Click Next.
- Uncheck Primary Selection. Click Next.
- Click Save Configuration and save
config.xlaunchin yourStartupfolder at%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup. - Click Finish.
Optional: if disk D: does not exist, make it an alias for C:. If you don't know why you might want this, then you don't need it.
- Open PowerShell as Administrator and run:
if (!(Test-Path -Path "D:\")) {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices" -Name "D:" -PropertyType String -Value \DosDevices\C:\ -Force
}- Reboot.
Follow these steps to remove your Linux distro with all files (applications, settings, home directory, etc.). You can recreate it by following WSL Installation guide below.
- Find out the name of your default distro by running the following command from PowerShell:
wsl.exe --list- Delete a distro:
wsl.exe --terminate DISTRO
wsl.exe --unregister DISTROThese steps allow you to recreate the whole WSL environment. Before proceeding, delete the current distro if you have it. See WSL Removal.
- Download
id_rsainto the WindowsDownloadsfolder. It's OK if it's downloaded asid_rsa.txt. - Run these commands from PowerShell:
wsl.exe --set-default-version 1 wsl.exe --install -d Ubuntu-22.04
- When prompted, create a new user. and check if github connect work
curl -I https://github.com
curl -v https://github.com- check if ssh connect work
ssh -T git@github.com, if not, add this to your ~/.ssh/config
Host github.com
Hostname ssh.github.com
Port 443
User git
IdentityFile ~/.ssh/id_rsa- Type this (change the value of
GITHUB_USERNAMEif it's not the same as your WSL username):
GITHUB_USERNAME=$USER bash -c \
"$(curl -fsSL 'https://raw.githubusercontent.com/auspbro/dotfiles-public/master/bin/bootstrap-machine.sh')"- Say
Yeswhen prompted to terminate WSL. - Run Start > Windows Terminal.
- Press Ctrl+,
- Change Profiles > Ubuntu-22.04 > Appearance > Text Formatting > Intense text style to "Bold font"
- Run Start > Windows Terminal.
- Press Ctrl+Shift+,.
- Replace the content of
settings.jsonwith this. Change "romkatv" to your WSL username.
- Run Start > Windows Security.
- Click Virus & threat protection.
- Click Manage settings under Virus & threat protection settings.
- Click Add or remove exclusions under Exclusions.
- Click Add an exclusion > Folder.
- Select
%USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc.
Run this command occasionally.
sync-dotfiles && bash ~/bin/setup-machine.sh && z4h update #maintenancePro tip: Copy-paste this whole command including the comment. Next time when you decide to run maintenance tasks, press Ctrl+R and type #maintenance. This is how you can "tag" commands and easily find them later. You can apply more than one "tag". Technically, everything after # is a comment.