# linux_subsystem **Repository Path**: Janode/linux_subsystem ## Basic Information - **Project Name**: linux_subsystem - **Description**: 深入理解linux子系统 - **Primary Language**: Unknown - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 5 - **Created**: 2024-08-18 - **Last Updated**: 2025-04-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # linux_subsystem ## 1 介绍 深入理解linux子系统统一研究平台 源码阅读:https://elixir.bootlin.com/linux/v6.10-rc2/source ## 2 软件架构 软件架构说明 ## 3 安装教程 ### 3.1 wsl安装 安装windows的linux子系统wsl,选用ubuntu20或以上版本 基本步骤: Step1:在“启动或关闭Windows功能”设置项中选择“适用于Linux的Windows子系统”和“虚拟机平台” Step2:在应用商城中,选择ubuntu20/22,进行安装 Step3:导航栏中输入wsl启动或者mobaxterm中自动回出现ubuntu的对应的选项卡,点击进入 ### 3.2 docker安装 Step1: 更新 apt 包索引 `sudo apt-get update` Step2: 安装 apt 依赖包,用于通过HTTPS来获取仓库 `sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common` Step3: 添加 Docker 的官方 GPG 密钥 `curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -` Step4: 使用以下指令设置稳定版仓库 `sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ $(lsb_release -cs) stable"` Step5: 安装最新版本的Docker Engine-Community 和 containerd `sudo apt-get install docker-ce docker-ce-cli containerd.io` Step6:验证 `sudo docker run hello-world` ### 3.3 docker镜像导入 Step1: 下载docker镜像 `坚果云:https://drive.cvte.com/p/DSpcIh4Q3YEEGOyxKCAA` Step2: 将docker放至ubuntu wsl子系统目录:/home/xxx(用户名)下,并解压: `xz -d elg_qemu.tar.xz` Step3: 加载docker镜像 `cat elg_qemu.tar | sudo docker import - ubuntu22.04:elg_qemu` ### 3.4 启动docker镜像 `sudo docker run -t -i -v :/linux_subsystem ubuntu22.04:elg_qemu /bin/bash` 注意:是host中linux_sybsystem仓库的目录。启动后,可以看到和host共享的位于根目录的linux_subsystem ### 3.5 编译qemu 这里只编译arm和arm64两种虚拟机: `./configure --target-list=aarch64-softmmu,arm-softmmu` `make` ### 3.6 配置和编译linux系统 参照:`https://gitee.com/Janode/elegant_linux_design/blob/master/README.md` 的2.2~2.4进行。 ### 3.7 启动qemu虚拟机 进入目录:linux_subsystem/qemu 执行:`./setup arm` or `./setup arm64` 后续使用在进入docker环境之后启动qemu虚拟机即可。