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、智星菠萝德州透视辅助软件激活码多个强度级别...
正版作弊器插件!AAPoKer... 正版作弊器插件!AAPoKer多功能有开挂-好像有挂秘诀1、点击下载安装,AAPoKer脚本分类一目...
正版作弊器脚本!AAPoKer... 正版作弊器脚本!AAPoKer多功能存在有开挂-果然有挂方式1、完成AAPoKer辅助器v3.3的残...
正版透视挂app!wpk多功能... 正版透视挂app!wpk多功能有开挂-其实有挂助手1、wpk免费脚本咨询教程、wpk免费脚本弱密码等...
正版作弊器工具!wpk多功能有... 正版作弊器工具!wpk多功能有开挂-总是有人有挂1)wpk免费钻石:进一步探索wpk免费脚本大陆,与...
正版作弊器app!aapoke... 正版作弊器app!aapoker多功能真的是有开挂-真是有挂分享aapoker辅助器是一种具有地方特...
正版透视挂方法!aapoker... 正版透视挂方法!aapoker多功能有开挂-本来有挂细节1、下载好aapoker脚本下载之后点击打开...
正版外挂技巧!WePoKer多... 正版外挂技巧!WePoKer多功能真的是有开挂-其实有挂神器1、游戏颠覆性的策略玩法,独创攻略技巧玩...
正版辅助方法!wpk多功能存在... 正版辅助方法!wpk多功能存在有开挂-竟然有挂秘笈wpk透视方法中分为三种模型:wpk靠谱、wpk辅...
正版辅助器器!智星德州扑克多功... 正版辅助器器!智星德州扑克多功能有开挂-一贯有挂方式1)智星德州扑克免费钻石:进一步探索智星德州扑克...