Bash on Ubuntu on WindowsにArchLinuxをセットアップする
Bash on Ubuntu on Windows(Windows Subsystem for Linux)上に、ArchLinuxをセットアップしました。
- Japanese -> これ
- English -> Running Archlinux in Bash on Windows - くんすとの備忘録
手順
1. 必要なパッケージのインストール
Bash on Ubuntu on Windows(以降はBoWと記載)上で、作業に必要なソフトウェアを先にインストールしておきます。
※BoW上での作業はすべてrootユーザで行います。
apt-get install -y squashfs-tools p7zip-full
2. ArchLinuxのISOを取得
好きなミラーサイトからArchLinuxのISOを取得します。
wget http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/iso/2016.08.01/archlinux-2016.08.01-dual.iso
3. ArchLinuxのISOからairootfs.sfsを抽出
isoを展開してairootfs.sfsを取り出します。
7z x archlinux-*-dual.iso cp arch/x86_64/airootfs.sfs .
4. airootfs.sfsを展開
unsquashfsコマンドを使用してairootfs.sfsを展開します。
unsquashfs airootfs.sfs
一部展開に失敗するファイルがありますが、気にせず続けます。
5. 「4.」で作成されたsquashfs-rootをrootfs化
BoWのウィンドウを全て閉じます。
WindowsのExplorerで、「4.」で作成されたsquashfs-rootをBoW環境のルートへ移動させます。
- BoW環境のルート - %USERPROFILE%\AppData\Local\lxss\
- squashfs-rootの場所 - %USERPROFILE%\AppData\Local\lxss\root\squashfs-root
6. rootfsフォルダを退避し、squashfs-rootフォルダをrootfsフォルダにすり替え
7. BoWを起動
ArchLinuxになっている!!
8. pacmanの初期設定と動作確認
pacman-key --init pacman-key --populate archlinux pacman -Syy pacman -S git
pacman -Sでエラーは出ていますが(chrootかな?)、gitコマンドは使えるようになったので、一応インストールはできている模様。