From 5e0cba0534c20f24acf495cd752ebd647a0936eb Mon Sep 17 00:00:00 2001 From: CLannadZSY Date: Tue, 26 Nov 2024 14:59:23 +0000 Subject: [PATCH] =?UTF-8?q?Wsl2=20Linux=20=E5=AD=90=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=85=A5=E4=B8=8E=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\270\216\345\257\274\345\207\272\033[F.md" | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 "content/blog/2024-11-26/Wsl2 Linux \345\255\220\347\263\273\347\273\237\347\232\204\345\257\274\345\205\245\344\270\216\345\257\274\345\207\272\033[F.md" diff --git "a/content/blog/2024-11-26/Wsl2 Linux \345\255\220\347\263\273\347\273\237\347\232\204\345\257\274\345\205\245\344\270\216\345\257\274\345\207\272\033[F.md" "b/content/blog/2024-11-26/Wsl2 Linux \345\255\220\347\263\273\347\273\237\347\232\204\345\257\274\345\205\245\344\270\216\345\257\274\345\207\272\033[F.md" new file mode 100644 index 0000000..c531608 --- /dev/null +++ "b/content/blog/2024-11-26/Wsl2 Linux \345\255\220\347\263\273\347\273\237\347\232\204\345\257\274\345\205\245\344\270\216\345\257\274\345\207\272\033[F.md" @@ -0,0 +1,52 @@ +--- +title: "Wsl2 Linux 子系统的导入与导出" +description: "" +lead: "" +date: 2024-11-26T14:58:22Z +lastmod: 2024-11-26T14:58:22Z +draft: false +weight: 50 +contributors: [clannadzsy] +url: "/blog/3262080571/" +--- + + +1. 关闭 wsl + + ```bash + wsl --shutdown + ``` + +2. 查看 wsl 信息 + + ```bash + wsl -l -v + NAME STATE VERSION + * Debian Running 2 + ``` + +3. 导出 + + ```bash + wsl --export Debian D:\Debian.tar + ``` + +4. 注销 + + ```bash + wsl --unregister Debian + ``` + +5. 导入 + + ```bash + wsl --import Debian D:\Debian D:\Debian.tar + ``` + +6. 设置默认登录用户, 否则默认为 `root` 用户登录 + + ```bash + Debian config --default-user <用户名> + ``` + + \ No newline at end of file