-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ba7e6f
commit 5e0cba0
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <用户名> | ||
``` | ||
|
||
|