This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next 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/09/06 14:45] jypeter [Base installation] |
||
---|---|---|---|
Line 174: | Line 174: | ||
* If you have an older Windows version (at least //Version 1903, Build 18362//), follow the [[https://docs.microsoft.com/en-us/windows/wsl/install-manual|Manual installation steps for older versions of WSL]] | * If you have an older Windows version (at least //Version 1903, Build 18362//), follow the [[https://docs.microsoft.com/en-us/windows/wsl/install-manual|Manual installation steps for older versions of WSL]] | ||
- | * Open a ''Powershell'' in //administrator// mode | + | * Open a ''PowerShell'' in //administrator// mode |
* ''Start''=>''W''=>''Windows PowerShell'' then right-click on ''Windows PowerShell'' and select //Run as Administrator// | * ''Start''=>''W''=>''Windows PowerShell'' then right-click on ''Windows PowerShell'' and select //Run as Administrator// | ||
* Use a [[https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:win10apps#windows_terminal|Windows Terminal]], if you have already installed it. Use ''CTRL''+<left click> on ''Windows Powershell'' in the pull-down menu to get a ''Powershell'' in //administrator// mode | * Use a [[https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:win10apps#windows_terminal|Windows Terminal]], if you have already installed it. Use ''CTRL''+<left click> on ''Windows Powershell'' in the pull-down menu to get a ''Powershell'' in //administrator// mode | ||
Line 206: | Line 206: | ||
* Reboot the computer and be patient | * Reboot the computer and be patient | ||
* This step will take some time (make sure you have 15-30 mn available). Windows will install and configure what it needs for running //WSL+Ubuntu//, reboot, and install some more //stuff// | * This step will take some time (make sure you have 15-30 mn available). Windows will install and configure what it needs for running //WSL+Ubuntu//, reboot, and install some more //stuff// | ||
- | * The final installation step will take place when you open your Windows session. A terminal opens, displaying the final installation of Ubuntu, and asking you for a username and password, and giving you access to a ''bash'' prompt | + | * The final installation step will take place when you open your Windows session. A terminal opens, displaying the final installation of Ubuntu, and asking you for a username and password, and giving you access to a ''bash'' prompt\\ <wrap hi>Do not use an existing password!</wrap> The security of the Linux running in WSL is weak by design, and somebody could easily extract your password information from a backup of your distribution |
* <code>Installing, this may take a few minutes... | * <code>Installing, this may take a few minutes... | ||
Please create a default UNIX user account. The username does not need to match your Windows username. | Please create a default UNIX user account. The username does not need to match your Windows username. | ||
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 | ||
Line 1179: | Line 1198: | ||
* [[https://docs.microsoft.com/en-us/windows/wsl/release-notes|Release Notes for Windows Subsystem for Linux]] | * [[https://docs.microsoft.com/en-us/windows/wsl/release-notes|Release Notes for Windows Subsystem for Linux]] | ||
+ | * [[https://craigloewen-msft.github.io/WSLTipsAndTricks/|WSL Tips and Tricks]] | ||
* [[https://docs.microsoft.com/en-us/windows/wsl/faq|Frequently Asked Questions]] | * [[https://docs.microsoft.com/en-us/windows/wsl/faq|Frequently Asked Questions]] | ||
* [[https://docs.microsoft.com/en-us/windows/wsl/troubleshooting|Troubleshooting]] | * [[https://docs.microsoft.com/en-us/windows/wsl/troubleshooting|Troubleshooting]] |