Windows Powershell (admin New Session)
winget install -e --id Git.Git --source winget
winget install -e --id Microsoft.PowerShell --source winget
winget install -e --id Microsoft.WindowsTerminal.Preview --source winget
pwsh (admin New Session)
cd $env:USERPROFILE
git clone https://github.com/kuni3933/WindowsTerminalSettings --recursive
Gitがインストールされたフォルダを、システム環境変数:GIT_INSTALL_ROOT として登録
-
まずは以下のコマンドを実行してgit.exeの位置を確認.
pwsh (admin New Session)
cmd /c where git
-
出力された位置の2階層上に位置するGitフォルダを環境変数GIT_INSTALL_ROOTとして登録する.
C:\Program Files\Git\cmd\git.exe
と出力されたら以下の設定
システム環境変数名:GIT_INSTALL_ROOT
システム環境変数値:C:\Program Files\Git
pwsh (admin New Session)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
cd $env:USERPROFILE/WindowsTerminalSettings
windows/install.ps1
ディレクトリ | 概要 |
---|---|
1.PSGallery | PSGalleryでインストールするもの |
2.winget | wingetでインストールするもの |
3.scoop | scoopでインストールするもの |
4.Chocolatey | chocolateyでインストールするもの |
5.volta/npm | volta/npmでインストールするもの |
6.go | goでインストールするもの |
7.cargo | rust/cargoでインストールするもの |
初インストールの場合は、install.ps1を実行後
- Keypirinha
- VScode
- pwsh
pwsh (admin New Session)
cd $env:USERPROFILE/WindowsTerminalSettings
sudo windows/provision.bat
本家Tadashi Aikawa氏の資料を要参照
WSL2でつくる快適なUbuntu環境を実行していく
-
以下のコマンドでWSLを有効にする
pwsh (admin New Session)
sudo dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
-
VMを有効にする
pwsh (admin New Session)
sudo dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
-
x64 マシン用 WSL2 Linux カーネル更新プログラム パッケージから更新プログラムをダウンロードして実行
参考 - 手順 4 - Linux カーネル更新プログラム パッケージをダウンロードする -
pwsh (admin New Session)
sudo wsl --set-default-version 2
-
Setupo DistroD & Install Any Distribution
nullpo-head/wsl-distrod -
Setup root password
pwsh (admin New Session)
sudo su - passwd
-
User Add wheel group
pwsh
gpasswd -a {username} wheel
※{username} = UserName※
-
鍵の初期化
pwsh
pacman-key --init
-
鍵の更新
pwsh
pacman-key --populate archlinux pacman -Syy archlinux-keyring
-
パッケージの更新・必要なPackageのインストール
pwsh
sudo pacman -Syyu --needed aria2 autoconf automake base base-devel curl git gnupg make neovim ntp openssh sudo vi vim wget
-
/etc/sudoersを編集してwheel ユーザグループに sudo 権限を付与する。
pwsh
nano /etc/sudoers
キーバインド:M = meta key = Alt
以下の行を探してアンコメント
%wheel ALL=(ALL) ALL
-
close nano
以下のコマンドでnanoを閉じて保存終了
ctrl + x
y
ENTER
exit
-
mirrorlstの確認と設定
pwsh
vim /etc/pacman.d/mirrorlist
-
Setup wsl.conf with powershell
pwsh (admin New Session)
cd $env:USERPROFILE/WindowsTerminalSettings/windows/Distrod .\Distrod_provision.ps1
-
setup
WindowsTerminaからArch実行
bash (Distrod)
git clone [email protected]:kuni3933/WindowsTerminalSettings.git --recursive cd ~/WindowsTerminalSettings/mnt/linux/Arch ./setup.sh
-
setup .bashrc
必要な部分はマージしつつ起動直後の内容等は削除して$HOMEの.bashrcには
. ~/.bashrc.org
export PATH=$PATH:'/mnt/c/Users/{Windows_username}/AppData/Local/Programs/Microsoft VS Code/bin'
のみが記述されている状態にする
({Windows_username} = Windows UserName)