编译更新 WSL2 内核至4.19.57,增加 Squashfs 支持
前言
WSL是WIN10中内置的Linux子系统,WSL2是WSL技术的第二版。今天在WSL2环境中测试Singularity时遇到问题,无法启动sif格式镜像。经分析,原因是内核中没有squashfs文件系统所致。
当前内核版本:
root@DESKTOP-ASI6ES4:~# uname -r
4.19.43-microsoft-standard
错误表现:
root@DESKTOP-ASI6ES4:/opt/singularity# singularity shell busybox_latest.sif
FATAL: container creation failed: mount /proc/self/fd/3/usr/local/var/singularity/mnt/session/rootfs error: can’t mount image /proc/self/fd/3: failed to mount squashfs filesystem: no such device
准备编译环境
微软商店获取 Ubuntu(我使用的是16.04), 并运行
wsl.exe --list -v
NAME STATE VERSION
Ubuntu-16.04 Running 2
获取WSL2 Kernel最新代码
微软已经在GITHUB上开源了内核代码,GITHUB