How to change default user in WSL Ubuntu bash on Windows 10












12















I installed the WSL Bash on Windows 10 and set my user to e.g. 'abc' but now I want to change it to something else.



How can I change the user name of the user I'm logged in as?



When I open bash it automatically logs me in with my current user.










share|improve this question





























    12















    I installed the WSL Bash on Windows 10 and set my user to e.g. 'abc' but now I want to change it to something else.



    How can I change the user name of the user I'm logged in as?



    When I open bash it automatically logs me in with my current user.










    share|improve this question



























      12












      12








      12


      8






      I installed the WSL Bash on Windows 10 and set my user to e.g. 'abc' but now I want to change it to something else.



      How can I change the user name of the user I'm logged in as?



      When I open bash it automatically logs me in with my current user.










      share|improve this question
















      I installed the WSL Bash on Windows 10 and set my user to e.g. 'abc' but now I want to change it to something else.



      How can I change the user name of the user I'm logged in as?



      When I open bash it automatically logs me in with my current user.







      users windows-subsystem-for-linux






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 16 '16 at 23:47









      JohnDoea

      115102259




      115102259










      asked Aug 25 '16 at 13:32









      mlevitmlevit

      164113




      164113






















          5 Answers
          5






          active

          oldest

          votes


















          18














          Now that LxRun.exe is deprecated, if you install Ubuntu from the Windows store the command you will need is



          ubuntu config --default-user <username>


          Restart LxssManager service



          sc stop LxssManager
          sc start LxssManager





          share|improve this answer

































            13














            You can change the default user for bash by running the following command in a normal command prompt (cmd.exe):



            LxRun.exe /setdefaultuser <new_name>





            share|improve this answer































              1














              If you're running Ubuntu 18.04 from the Microsoft Store, the command (powershell or cmd) will be:



              ubuntu1804 config --default-user <username>






              share|improve this answer































                0














                All other answers were helpful, but can be other scenarios too, follow here as per yours. Mine was ubuntu 1604, so use following:-



                ubuntu1604 config --default-user <username>



                if you installed ubuntu 1804:-



                ubuntu1804 config --default-user <username>



                if you used default one, then:-



                ubuntu config --default-user <username>






                share|improve this answer








                New contributor




                kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




























                  -1














                  In CMD



                  See which distros you have installed
                  wslconfig /l



                  I have Ubuntu and I wanted to set the default user to root
                  ubuntu config --default-user root



                  Documentation:
                  https://docs.microsoft.com/en-us/windows/wsl/user-support






                  share|improve this answer










                  New contributor




                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





















                  • Why nominate to delete?

                    – spaceNeenja
                    yesterday











                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "89"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f816732%2fhow-to-change-default-user-in-wsl-ubuntu-bash-on-windows-10%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  5 Answers
                  5






                  active

                  oldest

                  votes








                  5 Answers
                  5






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  18














                  Now that LxRun.exe is deprecated, if you install Ubuntu from the Windows store the command you will need is



                  ubuntu config --default-user <username>


                  Restart LxssManager service



                  sc stop LxssManager
                  sc start LxssManager





                  share|improve this answer






























                    18














                    Now that LxRun.exe is deprecated, if you install Ubuntu from the Windows store the command you will need is



                    ubuntu config --default-user <username>


                    Restart LxssManager service



                    sc stop LxssManager
                    sc start LxssManager





                    share|improve this answer




























                      18












                      18








                      18







                      Now that LxRun.exe is deprecated, if you install Ubuntu from the Windows store the command you will need is



                      ubuntu config --default-user <username>


                      Restart LxssManager service



                      sc stop LxssManager
                      sc start LxssManager





                      share|improve this answer















                      Now that LxRun.exe is deprecated, if you install Ubuntu from the Windows store the command you will need is



                      ubuntu config --default-user <username>


                      Restart LxssManager service



                      sc stop LxssManager
                      sc start LxssManager






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Nov 5 '18 at 20:33









                      Community

                      1




                      1










                      answered Oct 20 '17 at 0:56









                      KDExKDEx

                      28124




                      28124

























                          13














                          You can change the default user for bash by running the following command in a normal command prompt (cmd.exe):



                          LxRun.exe /setdefaultuser <new_name>





                          share|improve this answer




























                            13














                            You can change the default user for bash by running the following command in a normal command prompt (cmd.exe):



                            LxRun.exe /setdefaultuser <new_name>





                            share|improve this answer


























                              13












                              13








                              13







                              You can change the default user for bash by running the following command in a normal command prompt (cmd.exe):



                              LxRun.exe /setdefaultuser <new_name>





                              share|improve this answer













                              You can change the default user for bash by running the following command in a normal command prompt (cmd.exe):



                              LxRun.exe /setdefaultuser <new_name>






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Aug 26 '16 at 11:13









                              William BowlingWilliam Bowling

                              1312




                              1312























                                  1














                                  If you're running Ubuntu 18.04 from the Microsoft Store, the command (powershell or cmd) will be:



                                  ubuntu1804 config --default-user <username>






                                  share|improve this answer




























                                    1














                                    If you're running Ubuntu 18.04 from the Microsoft Store, the command (powershell or cmd) will be:



                                    ubuntu1804 config --default-user <username>






                                    share|improve this answer


























                                      1












                                      1








                                      1







                                      If you're running Ubuntu 18.04 from the Microsoft Store, the command (powershell or cmd) will be:



                                      ubuntu1804 config --default-user <username>






                                      share|improve this answer













                                      If you're running Ubuntu 18.04 from the Microsoft Store, the command (powershell or cmd) will be:



                                      ubuntu1804 config --default-user <username>







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Sep 26 '18 at 15:39









                                      rainabbarainabba

                                      1113




                                      1113























                                          0














                                          All other answers were helpful, but can be other scenarios too, follow here as per yours. Mine was ubuntu 1604, so use following:-



                                          ubuntu1604 config --default-user <username>



                                          if you installed ubuntu 1804:-



                                          ubuntu1804 config --default-user <username>



                                          if you used default one, then:-



                                          ubuntu config --default-user <username>






                                          share|improve this answer








                                          New contributor




                                          kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                          Check out our Code of Conduct.

























                                            0














                                            All other answers were helpful, but can be other scenarios too, follow here as per yours. Mine was ubuntu 1604, so use following:-



                                            ubuntu1604 config --default-user <username>



                                            if you installed ubuntu 1804:-



                                            ubuntu1804 config --default-user <username>



                                            if you used default one, then:-



                                            ubuntu config --default-user <username>






                                            share|improve this answer








                                            New contributor




                                            kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                            Check out our Code of Conduct.























                                              0












                                              0








                                              0







                                              All other answers were helpful, but can be other scenarios too, follow here as per yours. Mine was ubuntu 1604, so use following:-



                                              ubuntu1604 config --default-user <username>



                                              if you installed ubuntu 1804:-



                                              ubuntu1804 config --default-user <username>



                                              if you used default one, then:-



                                              ubuntu config --default-user <username>






                                              share|improve this answer








                                              New contributor




                                              kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.










                                              All other answers were helpful, but can be other scenarios too, follow here as per yours. Mine was ubuntu 1604, so use following:-



                                              ubuntu1604 config --default-user <username>



                                              if you installed ubuntu 1804:-



                                              ubuntu1804 config --default-user <username>



                                              if you used default one, then:-



                                              ubuntu config --default-user <username>







                                              share|improve this answer








                                              New contributor




                                              kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              share|improve this answer



                                              share|improve this answer






                                              New contributor




                                              kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.









                                              answered Jan 19 at 3:57









                                              kakabalikakabali

                                              1012




                                              1012




                                              New contributor




                                              kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.





                                              New contributor





                                              kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






                                              kakabali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.























                                                  -1














                                                  In CMD



                                                  See which distros you have installed
                                                  wslconfig /l



                                                  I have Ubuntu and I wanted to set the default user to root
                                                  ubuntu config --default-user root



                                                  Documentation:
                                                  https://docs.microsoft.com/en-us/windows/wsl/user-support






                                                  share|improve this answer










                                                  New contributor




                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.





















                                                  • Why nominate to delete?

                                                    – spaceNeenja
                                                    yesterday
















                                                  -1














                                                  In CMD



                                                  See which distros you have installed
                                                  wslconfig /l



                                                  I have Ubuntu and I wanted to set the default user to root
                                                  ubuntu config --default-user root



                                                  Documentation:
                                                  https://docs.microsoft.com/en-us/windows/wsl/user-support






                                                  share|improve this answer










                                                  New contributor




                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.





















                                                  • Why nominate to delete?

                                                    – spaceNeenja
                                                    yesterday














                                                  -1












                                                  -1








                                                  -1







                                                  In CMD



                                                  See which distros you have installed
                                                  wslconfig /l



                                                  I have Ubuntu and I wanted to set the default user to root
                                                  ubuntu config --default-user root



                                                  Documentation:
                                                  https://docs.microsoft.com/en-us/windows/wsl/user-support






                                                  share|improve this answer










                                                  New contributor




                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.










                                                  In CMD



                                                  See which distros you have installed
                                                  wslconfig /l



                                                  I have Ubuntu and I wanted to set the default user to root
                                                  ubuntu config --default-user root



                                                  Documentation:
                                                  https://docs.microsoft.com/en-us/windows/wsl/user-support







                                                  share|improve this answer










                                                  New contributor




                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.









                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited yesterday





















                                                  New contributor




                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.









                                                  answered yesterday









                                                  spaceNeenjaspaceNeenja

                                                  73




                                                  73




                                                  New contributor




                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.





                                                  New contributor





                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.






                                                  spaceNeenja is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                  Check out our Code of Conduct.













                                                  • Why nominate to delete?

                                                    – spaceNeenja
                                                    yesterday



















                                                  • Why nominate to delete?

                                                    – spaceNeenja
                                                    yesterday

















                                                  Why nominate to delete?

                                                  – spaceNeenja
                                                  yesterday





                                                  Why nominate to delete?

                                                  – spaceNeenja
                                                  yesterday


















                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to Ask Ubuntu!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f816732%2fhow-to-change-default-user-in-wsl-ubuntu-bash-on-windows-10%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  How did Captain America manage to do this?

                                                  迪纳利

                                                  南乌拉尔铁路局