other:win10wsl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
other:win10wsl [2022/08/31 15:08] – [Creating a backup] jypeter | other:win10wsl [2022/09/07 16:55] – [Uninstalling WSL] Added main installation removal jypeter | ||
---|---|---|---|
Line 174: | Line 174: | ||
* If you have an older Windows version (at least //Version 1903, Build 18362//), follow the [[https:// | * If you have an older Windows version (at least //Version 1903, Build 18362//), follow the [[https:// | ||
- | * Open a '' | + | * Open a '' |
* '' | * '' | ||
* Use a [[https:// | * Use a [[https:// | ||
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 // | * This step will take some time (make sure you have 15-30 mn available). Windows will install and configure what it needs for running // | ||
- | * 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 '' | + | * 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 '' |
* < | * < | ||
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 363: | Line 363: | ||
PS C:\> wsl cat / | PS C:\> wsl cat / | ||
Linux version 5.10.102.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Mar 2 00:30:59 UTC 2022</ | Linux version 5.10.102.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Mar 2 00:30:59 UTC 2022</ | ||
+ | |||
+ | * Create a [[other: | ||
+ | * This will allow you to easily [[other: | ||
===== After the base installation ===== | ===== After the base installation ===== | ||
Line 985: | Line 988: | ||
===== Advanced usage ===== | ===== Advanced usage ===== | ||
+ | ==== WSL security WARNING! ==== | ||
+ | <WRAP center round important 60%> | ||
+ | A regular Linux installation (on a Linux-only computer) is fairly secure,\\ but a Linux installation on WSL is not secure at all, **by design** | ||
+ | </ | ||
+ | |||
+ | WSL+Linux is designed to allow you to easily use Linux on Windows, including **very easily using the Linux root account without knowing any password** of the Linux installation! | ||
+ | |||
+ | < | ||
+ | wsl_default_user@your_machine:/ | ||
+ | wsl_default_user | ||
+ | |||
+ | PS C: | ||
+ | root@your_machine:/ | ||
+ | root</ | ||
+ | |||
+ | This is **a feature and not a security issue**, because your installation is protected by your Windows account security | ||
+ | |||
+ | You should be aware (and act accordingly) that: | ||
+ | * Somebody gaining access to your Windows account will also have full access to the Linux installation | ||
+ | * <wrap hi>Do not use an existing password for the WSL Linux account</ | ||
+ | * Storing data in the Linux part of your computer does not add any extra security | ||
+ | * Always **make sure that only you can access your Windows account** | ||
+ | * Your LSCE Windows laptop (not your desktop) is encrypted with [[https:// | ||
+ | |||
+ | * Somebody gaining access to a backup of your Linux installation will easily have access to the Linux installation itself | ||
+ | * You can store your Linux installation backup to [[https:// | ||
==== Creating a backup ==== | ==== Creating a backup ==== | ||
Line 1011: | Line 1040: | ||
* If you are not going to use the backup tar file right away, you can optionally compress it in order to save some space | * If you are not going to use the backup tar file right away, you can optionally compress it in order to save some space | ||
- | * < | + | * < |
+ | 1.4G Aug 29 17:49 / | ||
+ | |||
+ | $ gzip / | ||
+ | |||
+ | $ ls -lh / | ||
+ | 549M Aug 29 17:49 / | ||
=== Backup of specific directories === | === Backup of specific directories === | ||
Line 1039: | Line 1074: | ||
==== Restoring or relocating a Linux installation ==== | ==== Restoring or relocating a Linux installation ==== | ||
- | When we have a backup | + | When we have the '' |
+ | Note: | ||
+ | * This is currently the only way of **moving (// | ||
+ | * // | ||
+ | * You need [[other: | ||
+ | * Creating a backup and restoring it is an indirect way of **reclaiming the unused space of a Linux installation | ||
- | 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:// | + | Detailed |
- | FIXME Check if [[https://wslhub.com/|WSL Manager]] is maintained | + | * We assume that we have an exported installation '' |
+ | * In this example, we use the compressed backup file created in [[other: | ||
+ | * '' | ||
+ | * Create the directory where the Linux installation (mostly its '' | ||
+ | * Hint: choose an explicit directory path and name, using the name of the distribution that will be restored, because the name of the restored file itself will always be the same ('' | ||
+ | * Import the distribution, | ||
+ | * < | ||
+ | NAME STATE | ||
+ | * Ubuntu | ||
- | This assumes that you have followed the steps above to create a full backup of your Linux distribution in a '' | + | > wsl --import |
- | * '' | + | |
- | * Note: found a page mentioning that you should be in a terminal with admin rights when using '' | + | |
- | * Can we use the same ''< | + | |
- | * If we use a new distribution name, it will probably not appear anymore in the Microsoft Store and will not be updated. Is this a problem? | + | |
- | * It seems we can use ''< | + | |
- | * Can we install out of the current user's Windows folder? | + | |
- | * Can we install out of '' | + | |
- | * Can we restore (//clone//) a backed up Linux distribution on another Windows 10 computer for another user? | + | |
- | * if the default user (and its password) has to be changed, you probably have to follow the steps to [[https:// | + | |
+ | > wsl -l -v | ||
+ | NAME | ||
+ | * Ubuntu | ||
+ | Ubuntu_custom | ||
+ | * After importing, there should be a new '' | ||
+ | * Start the imported '' | ||
+ | * Select '' | ||
+ | * Or specify '' | ||
+ | * WARNING: even if the imported distribution had an existing default user ('' | ||
+ | * It is possible to explicitly specify the requested user each time we start a terminal, but it will be more convenient to specify a new default user\\ '' | ||
+ | * You can easily open a '' | ||
+ | * Select a new (non '' | ||
+ | * < | ||
+ | cat: / | ||
+ | |||
+ | # echo -e " | ||
+ | |||
+ | # cat / | ||
+ | [user] | ||
+ | default=stdu</ | ||
+ | * Restart the Linux installation to take the new settings into account | ||
+ | * '' | ||
+ | * If you need the '' | ||
+ | * < | ||
+ | stdu | ||
+ | stdu@sadira034: | ||
+ | [sudo] password for stdu: | ||
+ | root@sadira034: | ||
+ | root</ | ||
- | ==== Uninstalling WSL ==== | + | Questions FIXME |
+ | * Is it possible to restore to the default location (on '' | ||
+ | ==== Uninstalling WSL or a distribution | ||
- | Before | + | Before |
=== Removing a specific Linux installation === | === Removing a specific Linux installation === | ||
Line 1087: | Line 1157: | ||
* Ubuntu | * Ubuntu | ||
+ | |||
+ | === Removing the main Linux installation === | ||
+ | |||
+ | If you remove the main installation (on '' | ||
+ | * Another // | ||
+ | * < | ||
+ | NAME | ||
+ | Ubuntu_custom | ||
+ | * Ubuntu | ||
+ | |||
+ | PS C: | ||
+ | Désinscription... | ||
+ | |||
+ | PS C: | ||
+ | NAME | ||
+ | * Ubuntu_custom | ||
+ | |||
+ | * The initial installation directory will still be present on '' | ||
+ | * '' | ||
+ | * ...with a very low disk usage (the big '' | ||
+ | |||
+ | * '' | ||
+ | * If you end up with an installation error message and a new //orphan// '' | ||
+ | |||
+ | * '' | ||
=== Removing WSL === | === Removing WSL === | ||
Line 1145: | Line 1240: | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// |
other/win10wsl.txt · Last modified: 2023/12/06 14:24 by jypeter