wsl安装和使用

  1. 安装
wsl --install Ubuntu-22.04
  1. 设置
    安装完成创建用户
    自定义用户名和密码
>wsl --install Ubuntu-22.04
正在下载: Ubuntu 22.04 LTS
正在安装: Ubuntu 22.04 LTS
已成功安装分发。可以通过 “wsl.exe -d Ubuntu-22.04” 启动它
正在启动 Ubuntu-22.04...
Provisioning the new WSL instance Ubuntu-22.04
This might take a while...
Create a default Unix user account: root
adduser: The user `root' already exists.
Failed to create user 'root'. Please choose a different name.
Create a default Unix user account: liuym
New password:
Retype new password:
passwd: password updated successfully
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
  1. 使用
    如需要使用本机磁盘文件如C盘文件的目录是/mnt/c以此类推
cd /mnt/c
posted @ 2026-04-24 16:28  minseo  阅读(52)  评论(0)    收藏  举报