WSL:登陆指定Linux子系统(在安装了多个Linux子系统的情况下)
创始人
2025-01-21 02:37:11
0

To login you need to run:

wsl -d  

Step 5: Setup user accounts

Notice in the above image that the logged in user is a root account. So let's setup a normal user account.

First, while logged in to the second instance of Ubuntu in WSL2 as root, run the below command, replace  with the username of your choice:

NEW_USER= 

Then, run the following command to create the user account and set the password:

useradd -m -G sudo -s /bin/bash "$NEW_USER" passwd "$NEW_USER" 

Step 6: Configure default user

Next, we need to configure Ubuntu to log in as your new user by default instead of root.

To do so, run the below command: paste the entire block of code below into your teminal and press enter.

tee /etc/wsl.conf <<_EOF [user] default=${NEW_USER} _EOF 

Step 7: Login as the new user

First, exit the WSL by running logout, then shutfown the second Ubuntu by running

wsl --terminate  

Finally, login to the second instance of Ubuntu again:

wsl -d  

Need Help? Open a discussion thread on GitHub.

How to install multiple instances of Ubuntu in WSL2

相关内容

热门资讯

透视了解!约局吧游戏挂,哈糖大... 透视了解!约局吧游戏挂,哈糖大菠萝万能挂,学习教程(有挂规律)-哔哩哔哩1、哈糖大菠萝万能挂ai辅助...
透视辅助!拱趴大菠萝辅助方法(... 透视辅助!拱趴大菠萝辅助方法(透视)果然有挂,黑科技教程(有挂最新版)-哔哩哔哩1、拱趴大菠萝辅助方...
第四分钟详情!wepoker安... 第四分钟详情!wepoker安装教程(透视)切实有挂,爆料教程(证实有挂)-哔哩哔哩1、不需要AI权...
透视脚本!wepoker免费脚... 透视脚本!wepoker免费脚本咨询,hhpoker辅助,举措教程(有挂技巧)-哔哩哔哩1、wepo...
透视苹果版!wepoker透视... 透视苹果版!wepoker透视有没有(透视)真是是有挂,解密教程(有挂插件)-哔哩哔哩暗藏猫腻,小编...
第二分钟详情!wepoker辅... 第二分钟详情!wepoker辅助器激活码(透视)竟然真的是有挂,扑克教程(有挂技巧)-哔哩哔哩亲,关...
透视神器!wepokerplu... 透视神器!wepokerplus透视脚本免费,wepoker轻量版透视系统,烘培教程(有挂透明挂)-...
透视黑科技!wepoker辅助... 透视黑科技!wepoker辅助器(透视)本来真的是有挂,必胜教程(有挂新版)-哔哩哔哩wepoker...
第九分钟解谜!wepoker辅... 第九分钟解谜!wepoker辅助器官方(透视)好像真的有挂,辅助教程(今日头条)-哔哩哔哩1、金币登...
透视神器!wepoker有机器... 透视神器!wepoker有机器人吗,wepoker手机插件,经验教程(有挂教学)-哔哩哔哩1、wep...