トリプルストアのためにWSLを用意する

 先に述べたように AllegroGraphApache Jena FusekiVirtuoso Universal Server のいずれかを使えるようにするが,共通に使える環境としてWindows Subsystem for Linux (WSL) をここで用意しておく.AllegroGraph は64bit Linuxでしか動かない.FusekiとVirtuoso はそれに限られずに,64bit Linuxでも動く.だから極端なことを言えば,64bit Linux なら AllegroGraph,Fuseki,Virtuoso の三システムを同時に利用することも可能である.個人利用の Linux環境を仕立てるには,古いPCを Linux 専用にするのがベストであるが,それはちょっと難しいという方もおられよう.そういう方のためにWSLの利用を考える.必要条件は 64bit マシンであること,Windows10の最新版か Windows11であることぐらいである.64bit Linux環境が既にあるというかたはこのページの以下をスキップしてかまわない.Powershell またはコマンドプロンプトを管理者モードで開き,以下の様に wsl --install とタイプ入力する.

PowerShell 7.3.4
PS C:\Users\seiji> wsl --install
インストール中: 仮想マシン プラットフォーム
仮想マシン プラットフォーム はインストールされました。
インストール中: Linux 用 Windows サブシステム
Linux 用 Windows サブシステム  はインストールされました。
インストール中: Linux 用 Windows サブシステム
Linux 用 Windows サブシステム  はインストールされました。
インストール中: Ubuntu
Ubuntu はインストールされました。
要求された操作は正常に終了しました。変更を有効にするには、システムを再起動する必要があります。
PS C:\Users\seiji>

指示されたとおりにここでWindowsを再起動する.
少し時間はかかるが以下のようなウィンドウが表示されるまで待つ.

Ubuntu は既にインストールされています。
Ubuntu を起動しています...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username:

ここで既定としてインストールされるのは Ubuntu である.ユーザ名とパスワードをここで入力する.

Enter new UNIX username: seiji
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo ".
See "man sudo_root" for details.

Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage


This message is shown once a day. To disable it please create the
/home/seiji/.hushlogin file.
seiji@seijiBiGPC:~$

Ubuntuコンソール・ウィンドウをいったん閉じて,今度は(ウィンドウ・キーとRキーを同時に押すなどして)Windowsのプロンプト・コマンドとして Ubuntu と入力すれば,再びUbuntuが立ち上がる.

通常のようにいろいろな Ubuntu コマンドを試してみてほしい.

To run a command as administrator (user "root"), use "sudo ".
See "man sudo_root" for details.

seiji@seijiBiGPC:~$ pwd
/home/seiji
seiji@seijiBiGPC:~$ ls
seiji@seijiBiGPC:~$ df
Filesystem      1K-blocks     Used  Available Use% Mounted on
none              4055008        4    4055004   1% /mnt/wsl
none           1951876284 61424756 1890451528   4% /usr/lib/wsl/drivers
none              4055008        0    4055008   0% /usr/lib/wsl/lib
/dev/sdc       1055762868  1245272 1000814124   1% /
none              4055008       84    4054924   1% /mnt/wslg
rootfs            4051760     1936    4049824   1% /init
none              4055008      792    4054216   1% /run
none              4055008        0    4055008   0% /run/lock
none              4055008        0    4055008   0% /run/shm
none              4055008        0    4055008   0% /run/user
tmpfs                4096        0       4096   0% /sys/fs/cgroup
none              4055008       76    4054932   1% /mnt/wslg/versions.txt
none              4055008       76    4054932   1% /mnt/wslg/doc
drvfs          1951876284 61424756 1890451528   4% /mnt/c
drvfs            31264764    73608   31191156   1% /mnt/d
snapfuse              128      128          0 100% /snap/bare/5
snapfuse            74752    74752          0 100% /snap/core22/607
snapfuse            54528    54528          0 100% /snap/snapd/18933
snapfuse            93952    93952          0 100% /snap/gtk-common-themes/1535
snapfuse           153856   153856          0 100% /snap/ubuntu-desktop-installer/967
seiji@seijiBiGPC:~$ ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:10:d0:97 brd ff:ff:ff:ff:ff:ff
    inet ***.***.***.***/** brd 172.28.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 ****::***:****:****:****/** scope link
       valid_lft forever preferred_lft forever
seiji@seijiBiGPC:~$

 特に上記最後の ip a の結果である ip アドレスには注意してほしい.自分用の利用にはlocalhost(127.0.0.1) を使えばよいが,将来エンドポイントを外部に公開するには、いろいろ仕掛けをしてこの IPアドレスを外部からアクセス可能にする必要があるし,逆にセキュリティなどにも注意しなければならない.

 Ubuntuのような軟弱なLinuxなど使いたくないという方はこちらの情報を参考にして望みのLinuxをインストールすればよい.