WSL 设置默认账户问题解决

问题描述

  • 为了安装到非 C 盘,其他盘,我的 wsl 是去 GitHub 下载的 参考教程地址
  • 把下载的压缩包放到其他盘即可
  • 想更换每次启动的默认账户为普通账户

问题:

网上搜索的教程是,出现错误

C:\Users\25301>wsl -l
适用于 Linux 的 Windows 子系统分发版:
CentOS7 (默认)
C:\Users\25301>CentOS7 config --default-user jarvan
'CentOS7' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

他们有的说发行版本的问题,我试了没有用

命令的本质是程序,其实就是这个程序

在这里插入图片描述
进入该文件夹下,命令

CentOS7.exe config --default-user jarvan

成功

E:\VM\WSL\CentOS7>CentOS7.exe --help
ERROR:Invalid Argument.

Usage :
    <no args>
      - Open a new shell with your default settings.

    run <command line>
      - Run the given command line in that distro. Inherit current directory.

    runp <command line (includes windows path)>
      - Run the path translated command line in that distro.

    config [setting [value]]
      - `--default-user <user>`: Set the default user for this distro to <user>
      - `--default-uid <uid>`: Set the default user uid for this distro to <uid>
      - `--append-path <on|off>`: Switch of Append Windows PATH to $PATH
      - `--mount-drive <on|off>`: Switch of Mount drives
      - `--default-term <default|wt|flute>`: Set default terminal window

    get [setting]
      - `--default-uid`: Get the default user uid in this distro
      - `--append-path`: Get on/off status of Append Windows PATH to $PATH
      - `--mount-drive`: Get on/off status of Mount drives
      - `--wsl-version`: Get WSL Version 1/2 for this distro
      - `--default-term`: Get Default Terminal for this distro launcher
      - `--lxguid`: Get WSL GUID key for this distro

    backup [contents]
      - `--tgz`: Output backup.tar.gz to the current directory using tar command
      - `--reg`: Output settings registry file to the current directory

    clean
      - Uninstall the distro.

    help
      - Print this usage message.


E:\VM\WSL\CentOS7>CentOS7.exe config --default-user jarvan

E:\VM\WSL\CentOS7>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JarvanStack

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值