Skip to content

Commit 16c97e5

Browse files
committed
re-add archlinux
1 parent 341d2d2 commit 16c97e5

File tree

4 files changed

+67
-34
lines changed

4 files changed

+67
-34
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,41 @@ Settings -> Display -> Create new custom resolution
1818
2560x1440
1919
Timing Standard: CVT - Reduced Blanking
2020
```
21+
13. Download Arch Linux https://github.com/gjpin/windows-11/releases/download/archlinux-2025.02.01/arch_bootstrap.tar.gz
22+
14. Install Arch Linux in WSL
23+
```powershell
24+
# Install ArchLinux WSL
25+
New-Item -Path $env:USERPROFILE\WSL\ArchLinux -ItemType directory
26+
wsl --import ArchLinux $env:USERPROFILE\WSL\ArchLinux $env:USERPROFILE\Downloads\arch_bootstrap.tar.gz
27+
```
28+
15. Make sure WSL runs ArchLinux with the new user
29+
- Windows Terminal -> Settings -> ArchLinux -> Command line: C:\Windows\system32\wsl.exe -d ArchLinux -u wsl
30+
16. Run in Powershell `wsl -d ArchLinux`
31+
16. Configure Arch Linux (see wsl-arch-linux.sh)
32+
17. Copy SSH key to /home/wsl/.ssh and set correct permissions. example:
33+
```bash
34+
chmod 600 /home/wsl/.ssh/id_ecdsa
35+
chmod 644 /home/wsl/.ssh/id_ecdsa.pub
36+
```
37+
18. Add SSH private key to ssh-agent: ```ssh-add ~/.ssh/id_ecdsa```
2138

2239
## Debug
2340
- If winget is failing:
2441
```powershell
2542
Add-AppxPackage -Path https://cdn.winget.microsoft.com/cache/source.msix
2643
```
2744

45+
## Generate newer Arch Linux images
46+
```bash
47+
curl -LO https://archive.archlinux.org/iso/2025.02.01/archlinux-bootstrap-x86_64.tar.zst
48+
sudo apt install -y zstd
49+
sudo su
50+
zstd -d archlinux-bootstrap-x86_64.tar.zst
51+
tar -xvf archlinux-bootstrap-x86_64.tar
52+
tar -zcvf arch_bootstrap.tar.gz -C root.x86_64 .
53+
# Move arch_bootstrap.tar.gz to $env:USERPROFILE\Downloads
54+
```
55+
2856
## Firewall
2957
- Firewall can only be configured through Group Policy due to:
3058
- Disallowed globally open ports user preference merge

scripts/toggle-hdr.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Add-Type -TypeDefinition @"
2+
using System;
3+
using System.Runtime.InteropServices;
4+
public class Keyboard {
5+
[DllImport("user32.dll", SetLastError = true)]
6+
public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
7+
public static void PressKeys() {
8+
keybd_event(0x12, 0, 0, 0); // Alt Down
9+
keybd_event(0x5B, 0, 0, 0); // Left Win Down
10+
keybd_event(0x42, 0, 0, 0); // B Down
11+
12+
keybd_event(0x42, 0, 2, 0); // B Up
13+
keybd_event(0x5B, 0, 2, 0); // Left Win Up
14+
keybd_event(0x12, 0, 2, 0); // Alt Up
15+
}
16+
}
17+
"@ -PassThru | ForEach-Object { $_.GetMethod("PressKeys").Invoke($null, $null) }

setup.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ wsl --install --no-distribution
2626
# Install AlmaLinux 9 WSL2 distro
2727
winget install 9P5RWLM70SN9 --accept-source-agreements --accept-package-agreements
2828

29+
# # Install Ubuntu 24.04 WSL2 distro
30+
# winget install -e --source winget --id Canonical.Ubuntu.2404
31+
2932
################################################
3033
##### Powershell
3134
################################################
@@ -430,6 +433,11 @@ Invoke-WebRequest `
430433

431434
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\apps\resolution-manager", "Machine")
432435

436+
# Helper to toggle HDR
437+
# Invoke-WebRequest `
438+
# -Uri "https://raw.githubusercontent.com/gjpin/windows-11/main/scripts/toggle-hdr.ps1" `
439+
# -OutFile "$env:USERPROFILE\scripts\toggle-hdr.ps1"
440+
433441
# Install Sunshine and ViGEmBus
434442
winget install -e --source winget --id LizardByte.Sunshine
435443

wsl-arch-linux.sh

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,19 @@
1-
# 10. Download Arch Linux
2-
# ```bash
3-
# # Download from https://github.com/gjpin/windows-11/releases/download/archlinux-2024.09.01/arch_bootstrap.tar.gz
4-
# # or prepare new root filesystem in a linux env:
5-
# curl -LO https://archive.archlinux.org/iso/2024.09.01/archlinux-bootstrap-x86_64.tar.zst
6-
# sudo apt install -y zstd
7-
# sudo su
8-
# zstd -d archlinux-bootstrap-x86_64.tar.zst
9-
# tar -xvf archlinux-bootstrap-x86_64.tar
10-
# tar -zcvf arch_bootstrap.tar.gz -C root.x86_64 .
11-
# # Move arch_bootstrap.tar.gz to $env:USERPROFILE\Downloads
12-
# ```
13-
# 11. Install Arch Linux in WSL
14-
# ```powershell
15-
# # Install ArchLinux WSL
16-
# New-Item -Path $env:USERPROFILE\WSL\ArchLinux -ItemType directory
17-
# wsl --import ArchLinux $env:USERPROFILE\WSL\ArchLinux $env:USERPROFILE\Downloads\arch_bootstrap.tar.gz
18-
# ```
19-
# 12. Make sure WSL runs ArchLinux with the new user
20-
# - Windows Terminal -> Settings -> ArchLinux -> Command line: C:\Windows\system32\wsl.exe -d ArchLinux -u wsl
21-
# 13. Configure Arch Linux (see wsl-arch-linux.sh)
22-
# 14. Add SSH private key to ssh-agent: ```ssh-add ~/.ssh/id_ecdsa```
23-
24-
# wsl -d ArchLinux
25-
26-
# Init and populate keyring
27-
pacman-key --init
28-
pacman-key --populate
29-
301
# Configure mirrorlist
312
tee /etc/pacman.d/mirrorlist << 'EOF'
32-
Server = https://europe.mirror.pkgbuild.com/$repo/os/$arch
333
Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch
344
Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch
355
EOF
366

7+
# Init and populate keyring
8+
pacman-key --init
9+
pacman-key --populate
10+
11+
# Configure Pacman
12+
sed -i "s|^#Color|Color|g" /etc/pacman.conf
13+
sed -i "s|^#VerbosePkgLists|VerbosePkgLists|g" /etc/pacman.conf
14+
sed -i "s|^#ParallelDownloads.*|ParallelDownloads = 5|g" /etc/pacman.conf
15+
sed -i "/ParallelDownloads = 5/a ILoveCandy" /etc/pacman.conf
16+
3717
# Update packages
3818
pacman -Syu --noconfirm
3919

@@ -114,8 +94,8 @@ systemd=true
11494
[user]
11595
default=wsl
11696
117-
[automount]
118-
enabled=false
97+
# [automount]
98+
# enabled=false
11999
EOF
120100

121101
# Create SSH directory and config file
@@ -138,7 +118,7 @@ curl https://raw.githubusercontent.com/gjpin/arch-linux/main/configs/zsh/.zshrc
138118
curl https://raw.githubusercontent.com/gjpin/arch-linux/main/configs/zsh/.p10k.zsh -o /home/wsl/.p10k.zsh
139119

140120
# Install cloud related packages
141-
pacman -S --noconfirm kubectl cilium-cli talosctl k9s opentofu
121+
pacman -S --noconfirm kubectl krew helm k9s kubectx cilium-cli talosctl opentofu
142122

143123
# Set git configurations
144124
git config --global init.defaultBranch main
@@ -159,7 +139,7 @@ export PATH=$HOME/.devtools/npm-global/bin:$PATH
159139
EOF
160140

161141
# Install Python uv
162-
pacman -S --noconfirm --needed uv
142+
pacman -S --noconfirm uv
163143

164144
tee /home/wsl/.zshrc.d/python << 'EOF'
165145
# uv shell autocompletion

0 commit comments

Comments
 (0)