0 Prefacio
- En el desarrollo diario, a menudo es necesario tener en cuenta los entornos x86 y arm system. Este artículo proporciona las funciones de instalación del subsistema linux en el sistema win10 y configuración del subsistema arm en el sistema x86.
- Este artículo usa wsl para instalar el subsistema en el sistema win10 y usa qemu para configurar el entorno arm en el sistema x86
1. Instale el subsistema linux en el sistema win10
- Abra cmd, obtenga la lista de subsistemas que wsl puede instalar y seleccione una instalación, aquí está ubuntu22.04
- Una vez completada la instalación, reinicie la computadora y abra el subsistema
La primera vez que lo abre, debe configurar la contraseña de la cuenta (la cuenta tiene autoridad sudo y se puede cortar a la raíz)
-
Primero configure la fuente apt
- Enlace de referencia
(si crees que está bien escrito, por favor dame un me gusta, gracias ~)
- Enlace de referencia
-
actualizar apartamento
apt-get update apt-get upgrade
-
Configurar la red
apt-get install net-tools apt-get install openssh-server # 编辑网络配置文件 vi /etc/ssh/sshd_config # 找到下面两行取消注释并配置 PermitRootLogin yes PermitEmptyPasswords no
-
Configure ssh para que surta efecto y verifique, si está activo, significa éxito
systemctl start ssh systemctl status ssh
-
Una vez completada la configuración, puede intentar cambiar la contraseña para root primero y luego intentar iniciar sesión usted mismo
ssh root@localhost
-
Si puede iniciar sesión, salir y salir
-
-
Intenta copiar el archivo a local
-
primero crea un archivo
-
Abra cmd en la PC e intente copiar el archivo
-
2. Configure el entorno del brazo en el sistema x86
-
Primero descargue una imagen del brazo
wget https://cdimage.ubuntu.com/releases/22.04/release/ubuntu-22.04.2-live-server-arm64.iso
-
Obtener el sistema de archivos arm
mkdir myos mount ubuntu-22.04.2-live-server-arm64.iso myos/ cp myos/casper/ubuntu-server-minimal.squashfs . umount myos
-
Configurar la carpeta del sistema arm
unsquashfs ubuntu-server-minimal.squashfs apt-get install qemu-user-static cp /usr/bin/qemu-aarch64-static squashfs-root/usr/bin/
-
Configure la fuente apt y el proxy
# 参考上面的apt-get源配置,注意这个是arm的源 vi ./squashfs-root/etc/apt/sources.list # 配置两个代理 vi ./squashfs-root/etc/resolv.conf # 补在上面打开的文件的最后 nameserver 8.8.8.8 nameserver 114.114.114.114
-
Cambie al subsistema armado y configure
# 进入子系统 chroot squashfs-root/ # 测试是否能联网 curl www.baidu.com # 更新apt apt-get update apt-get upgrade # 安装网络相关软件 apt-get install net-tools openssh-server # 可以装一下常用软件 apt-get install -y g++ gfortran iproute2 iputils-ping libbz2-dev libsqlite3-dev \ libblas-dev libblas3 libopenblas-dev libssl-dev libxslt1-dev libffi-dev \ make net-tools openssh-server openssl pciutils sudo unzip vim wget \ xz-utils zlib1g zlib1g-dev cron cmake # 根据需要安装python wget www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz tar -zxf Python-3.9.2.tgz cd Python-3.9.2 ./configure --prefix=/usr/local/python3.9.2 --enable-shared make -j8 && make install -j8 cp /usr/local/python3.9.2/lib/libpython3.9.so.1.0 /usr/lib \ && ln -sf /usr/local/python3.9.2/bin/python3 /usr/bin/python \ && ln -sf /usr/local/python3.9.2/bin/python3 /usr/bin/python3 \ && ln -sf /usr/local/python3.9.2/bin/python3 /usr/bin/python3.9 \ && ln -sf /usr/local/python3.9.2/bin/python3 /usr/bin/python3.9.2 \ && ln -sf /usr/local/python3.9.2/bin/pip3 /usr/bin/pip3.9 \ && ln -sf /usr/local/python3.9.2/bin/pip3 /usr/bin/pip3.9.2
En este punto, el sistema se puede utilizar como un sistema de brazo.