About β’ Windows 11 β’ Chocolatey β’ Ubuntu β’ Todo
Personal dotfiles for setting up a development environment on Windows 11 using WSL2 with Ubuntu. Primary development tools:
- VSCode
- Windows Terminal
Download Sophia Script:
iwr script.sophia.team -useb | iex
Run customized preset (as Administrator):
Set-ExecutionPolicy Bypass -Scope Process -Force; (New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/aubique/871ad87ef7a801d17942ca3974cd9909/raw/e7d2d14297f6b098972dae0213f0072716b6a186/Sophie.ps1') | Out-File .\Sophie.ps1; .\Sophie.ps1
2. WSL2
After restart, install Ubuntu:
wsl --install -d Ubuntu
Download and unpack dotfiles:
git clone --separate-git-dir=$HOME/.dotfiles https://github.com/aubique/dotfiles-wsl.git /tmp/tmpdotfiles \
&& rsync -vah --exclude '.git' /tmp/tmpdotfiles/ $HOME/ \
&& sudo rsync -vah $HOME/pub/etc/ /etc/
Run, configure and clean dotfiles:
for s in source "/etc/profile" "$HOME/.profile"; do source $s; done \
&& dotfiles config status.showUntrackedFiles no \
&& rm -r /tmp/tmpdotfiles \
&& cd $HOME \
&& dotfiles submodule update --init
Relocate default Windows shell folders (Documents, Downloads, etc.) to a dedicated partition while adopting Linux FHS structure:
bash $RUNSCRIPTS_PATH/relocate_user_shell_folders.sh
Features:
- Moves user folders to new partition/drive ποΈ
- Symlinks WSL
$HOME
directories to Windows shell folders π - Updates Windows PATH with new locations for cross-system access βοΈ
- Maintains Linux-style directory hierarchy (
/etc
,/usr/local
, etc.) π§
Install Chocolatey:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Install Windows apps and tools:
Get-Content \\wsl$\Ubuntu\home\*\pub\pkglist_choco.txt | Select-String -NotMatch '^#.*' | ForEach {iex "choco install -y $_"}
π οΈ Post-Install Tweaks
Remove VLC Media Player Context Entries (as Administrator):
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Remove-Item HKCR:\Directory\shell\AddToPlaylistVLC\, HKCR:\Directory\shell\PlayWithVLC\ -Recurse
To simplify 7-Zip Context Menu open 7-Zip GUI (as Administrator):
Tools
β Options
β 7-Zip
β [Uncheck Integrate to shell context menu
]
Install required Ubuntu apt-packages:
sudo apt update && grep -vE '^#' ~/pub/pkglist_apt.txt | xargs sudo apt install -y
Basic Git configuration:
git config --global push.default current
git config --global core.pager /usr/bin/less
Set username and email:
git config --global user.email "{{EMAIL}}"
git config --global user.name "{{USERNAME}}"
Generate SSH key:
ssh-keygen -t ed25519 -C "$(hostname | sed 's/^DESKTOP-//; s/.*/\L&/'):$(date -I)" -f ~/.ssh/id_ed25519_serv-user
Copy SSH key to clipboard and add it:
xclip -sel c < ~/.ssh/id_ed25519_gl-user.pub
Remove any previous Docker installations:
sudo apt remove docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc
Add Docker's official GPG key:
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.asc
Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install Docker packages:
sudo apt update && sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Run Docker without sudo
:
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
Verify installation:
docker run hello-world
Install Volta, Node version manager:
mkdir -p $VOLTA_HOME
curl https://get.volta.sh | bash -s -- --skip-setup
Then install package managers and Angular:
volta install node npm @angular/cli
Install SDKMan, Java version manager:
curl -sSL "https://get.sdkman.io?rcupdate=false" | bash
Then install JDK 21 of Eclipse Temurin (formerly AdoptOpenJDK):
sdk install java 21.0.5-tem
If you have GPG keys for signing commits or password manager, backup to restore them on the new machine:
gpg --list-secret-keys gpg --export-secret-keys {{KEY_ID}} > /tmp/private.key
Verify permissions for gnupg
:
gpg --card-status
If you have "Permission Denied" problem, type:
mkdir -pv ~/.config/gnupg
find $GNUPGHOME -type d -exec sudo chown $USER:$USER {} \; -exec chmod 700 {} \;
find $GNUPGHOME -type f -exec sudo chown $USER:$USER {} \; -exec chmod 600 {} \;
Import GPG keys for signing:
gpg --import /tmp/private.key
If you have problem with clipboard, for example when typing echo foobar | wl-copy
, then you need to run:
sudo chmod +rx /mnt/wslg/runtime-dir
ln -s /mnt/wslg/runtime-dir/wayland-0* /run/user/1000/
- Upgrade Windows Tweaks
- Decouple
relocate_user_shell_folders.sh
from gist