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:29] – [Restoring or relocating a Linux installation] Started improving jypeter | other:win10wsl [2022/09/07 13:59] – [WSL security WARNING] Improved 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 1042: | Line 1077: | ||
Note: | Note: | ||
- | * This is currently the only way of moving (relocating) a Linux installation to another disk than the default '' | + | * This is currently the only way of **moving (//relocating//) a Linux installation** to another disk than the default '' |
- | * Importing will mostly put the '' | + | * //Importing// will mostly put the '' |
* You need [[other: | * You need [[other: | ||
- | * This is an indirect way of reclaiming the unused space of a Linux installation, i.e the size of the '' | + | * Creating a backup and restoring it is an indirect way of **reclaiming the unused space of a Linux installation**: the size of the '' |
+ | Detailed [[https:// | ||
+ | |||
+ | * We assume that we have an exported installation tar file available | ||
+ | * In this example, we use the compressed backup file created in [[other: | ||
+ | * '' | ||
+ | * Create the directory where the Linux installation (mostly its '' | ||
+ | * Hint: use 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 | ||
+ | |||
+ | > wsl --import Ubuntu_custom D: | ||
+ | |||
+ | > wsl -l -v | ||
+ | NAME | ||
+ | * Ubuntu | ||
+ | Ubuntu_custom | ||
+ | * After importing, there should be a new '' | ||
+ | * Start the imported '' | ||
+ | * Directly from the Windows Terminal pull-down menu | ||
+ | * Or from a PowerShell, using '' | ||
+ | * WARNING: even if the distribution we imported had an existing default '' | ||
+ | * 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\\ '' | ||
+ | * You can easily open a '' | ||
+ | * Specify a default user (note: [[https:// | ||
+ | * < | ||
+ | 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</ | ||
FIXME Read [[https:// | FIXME Read [[https:// | ||
Line 1151: | Line 1229: | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// |
other/win10wsl.txt · Last modified: 2023/12/06 14:24 by jypeter