This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
other:win10wsl [2022/08/31 14:58] jypeter [Restoring or relocating a Linux installation] Improved |
other:win10wsl [2022/08/31 15:57] jypeter [Restoring or relocating a Linux installation] Improved |
||
---|---|---|---|
Line 1075: | Line 1075: | ||
* Or from a PowerShell, using ''wsl --distribution Ubuntu_custom'' | * Or from a PowerShell, using ''wsl --distribution Ubuntu_custom'' | ||
* WARNING: even if the distribution we imported had an existing default ''stdu'' user, the //new// default user will be ''root'' ! | * WARNING: even if the distribution we imported had an existing default ''stdu'' user, the //new// default user will be ''root'' ! | ||
+ | * It is possible to explicitly specify the requested user each time we start a terminal, but it will be more convenient to specify a default user\\ wsl --distribution Ubuntu_custom --user stdu | ||
+ | * Specify a default user (note: [[https://docs.microsoft.com/en-us/windows/wsl/use-custom-distro#add-wsl-specific-components-like-a-default-user|Add WSL a default user]] also shows how to //create a new user//). We just have to use the root account to add a default user (user ''stdu'' here) to the [[https://docs.microsoft.com/en-us/windows/wsl/wsl-config#user-settings|/etc/wsl.conf]] file | ||
+ | * <code># cat /etc/wsl.conf | ||
+ | cat: /etc/wsl.conf: No such file or directory | ||
+ | |||
+ | # echo -e "[user]\ndefault=stdu" >> /etc/wsl.conf | ||
+ | |||
+ | # cat /etc/wsl.conf | ||
+ | [user] | ||
+ | default=stdu</code> | ||
+ | * Restart the Linux installation to take the new settings into account | ||
+ | * ''%%wsl --terminate Ubuntu_custom%%'' | ||
+ | * If you need the ''root'' account later, you will need to use the ''sudo'' command from the new default account | ||
+ | * <code>$ whoami | ||
+ | stdu | ||
+ | stdu@sadira034:~$ sudo su - | ||
+ | [sudo] password for stdu: | ||
+ | root@sadira034:~# whoami | ||
+ | root</code> | ||
FIXME Read [[https://www.howtogeek.com/426562/how-to-export-and-import-your-linux-systems-on-windows-10/|How to Export and Import Your Linux Systems on Windows 10]] and [[https://winaero.com/blog/export-import-wsl-linux-distro-windows-10/|Export and Import WSL Linux Distro in Windows 10]] and similar threads | FIXME Read [[https://www.howtogeek.com/426562/how-to-export-and-import-your-linux-systems-on-windows-10/|How to Export and Import Your Linux Systems on Windows 10]] and [[https://winaero.com/blog/export-import-wsl-linux-distro-windows-10/|Export and Import WSL Linux Distro in Windows 10]] and similar threads |