くんすとの備忘録

IT系技術メモ

移転しました。

15秒後に自動的にリダイレクトします。

Bash on Ubuntu on WindowsにArchLinuxをセットアップする

Bash on Ubuntu on Windows(Windows Subsystem for Linux)上に、ArchLinuxをセットアップしました。

手順

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

一部展開に失敗するファイルがありますが、気にせず続けます。 f:id:kunst1080:20160825234414p:plain

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

f:id:kunst1080:20160825234425p:plain

6. rootfsフォルダを退避し、squashfs-rootフォルダをrootfsフォルダにすり替え

f:id:kunst1080:20160825234434p:plain

7. BoWを起動

ArchLinuxになっている!! f:id:kunst1080:20160825234445p:plain

8. pacmanの初期設定と動作確認

pacman-key --init
pacman-key --populate archlinux
pacman -Syy
pacman -S git

f:id:kunst1080:20160825234453p:plain f:id:kunst1080:20160825234504p:plain pacman -Sでエラーは出ていますが(chrootかな?)、gitコマンドは使えるようになったので、一応インストールはできている模様。

以上!!

参考URL