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/24 15:29] – [Disk space] Started updating jypeter | other:win10wsl [2022/08/29 11:44] – [Upgrading WSL 1 to WSL 2] jypeter | ||
---|---|---|---|
Line 31: | Line 31: | ||
- | ==== Computer memory | + | ==== The basics before starting |
- | FIXME | + | Once you have verified that your Windows is recent enough, you should also: |
+ | * Install the [[other: | ||
+ | * Know how to use copy-paste in a Powershell FIXME | ||
+ | * It will be useful to be able to [[other: | ||
+ | * Have at least some basic knowledge of Linux... | ||
+ | * Get some [[other: | ||
+ | ==== Computer CPU and memory ==== | ||
- | ==== Disk space ==== | + | Contrary to other virtual machines, WSL is well integrated with the Windows operating system and the hardware drivers and has a **low default CPU and memory footprint**! |
- | < | + | * You should be able to //play// with WSL even with 8 Gb of RAM, but 16 Gb is recommended |
- | -rwxrwxrwx 1 root root 63M Aug 24 14:52 / | + | * Of course, depending on what you need to do on your computer, a better processor will always help |
+ | * WSL+Ubuntu will use more CPU and RAM if you use it for running CPU and/or memory intensive processes! As would be the case with any Windows application... :-) | ||
- | stdu@sadira034: | ||
- | -rwxrwxrwx 1 root root 1.2G Aug 24 15:20 / | ||
- | stdu@sadira034: | + | ==== Disk usage ==== |
- | [sudo] password for stdu: | + | |
- | Get:1 http:// | + | |
- | Get:2 http:// | + | |
- | [...] | + | |
- | 278 upgraded, 32 newly installed, 0 to remove and 0 not upgraded. | + | |
- | Need to get 174 MB of archives. | + | |
- | After this operation, 305 MB of additional disk space will be used. | + | |
- | Do you want to continue? [Y/n] Y | + | |
- | [...] | + | |
- | stdu@sadira034: | + | === Overview === |
- | -rwxrwxrwx 1 root root 63M Aug 24 14:52 / | + | |
- | stdu@sadira034:~$ ls -lh / | + | * '' |
- | -rwxrwxrwx 1 root root 2.6G Aug 24 15:24 / | + | * The Linux installation(s) will be installed (and updated) on '' |
- | </ | + | * They can only be relocated to other partitions afterwards |
- | FIXME | + | * => We should **start with at least 10 Gb of free space on '' |
+ | * The initial installation will not use much space (2-3 Gb), but we always need space on '' | ||
+ | |||
+ | <WRAP center round alert 60%> | ||
+ | FIXME The rather technical //Disk usage// sections below should be moved somewhere else! | ||
+ | </ | ||
+ | |||
+ | |||
+ | === How does it work? === | ||
+ | |||
+ | WSL+Linux seems to use a combination of actual Windows files/ | ||
+ | |||
+ | * Check [[https:// | ||
+ | * Check the following threads if you want to reduce the size of the '' | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | === Disks seen from Linux === | ||
+ | |||
+ | The disks and partitions usage, as seen from Linux, can be displayed with '' | ||
+ | |||
+ | < | ||
+ | Filesystem | ||
+ | / | ||
+ | tmpfs | ||
+ | tools | ||
+ | none 6.2G | ||
+ | none 6.2G 8.0K 6.2G 1% /run | ||
+ | none 6.2G | ||
+ | none 6.2G | ||
+ | none 6.2G | ||
+ | tmpfs | ||
+ | drivers | ||
+ | lib | ||
+ | C:\ | ||
+ | D:\ | ||
+ | |||
+ | * The '' | ||
+ | * The ''/ | ||
+ | * Some // | ||
+ | * < | ||
+ | 9.1G / | ||
+ | |||
+ | stdu@sadira034:/ | ||
+ | 9.1G / | ||
+ | |||
+ | |||
+ | === Some important disk locations === | ||
+ | |||
+ | * Accessing **Windows files from Linux**: ''/ | ||
+ | |||
+ | * Accessing **Linux files from the Windows Explorer**: '' | ||
+ | |||
+ | * WSL+Ubuntu installation: | ||
+ | * Main directory: '' | ||
+ | * //vhdx// file: '' | ||
+ | * < | ||
+ | -rwxrwxrwx 1 root root 1.2G Aug 24 15:20 / | ||
+ | |||
+ | * Linux //swap// (virtual memory) file: | ||
+ | * < | ||
+ | -rwxrwxrwx 1 root root 63M Aug 24 14:52 / | ||
+ | |||
+ | |||
+ | === Sample disk usage === | ||
+ | |||
+ | * Disk size after the initial installation of //Ubuntu 20.04 LTS//\\ '' | ||
+ | |||
+ | * Disk size after upgrading to //Ubuntu 20.04.4 LTS// with '' | ||
+ | |||
+ | ==== Hyper-V requirements ==== | ||
+ | |||
+ | WSL 2 needs the //Virtual Machine Platform// to be enabled on your computer. If you have never used WSL before, you can probably go directly to the [[other: | ||
+ | |||
+ | If you have problems, or if you are updating WSL 1 to WSL 2, use '' | ||
- | * //Enough// space on '' | + | If you get a '' |
- | * Exporting a //simple// Ubuntu configuration (after doing everything from //Base installation// | + | |
- | * The Linux ''/'' | + | |
- | * the Windows partitions will be available and accessible in '' | + | |
- | * The files will be installed in **hidden partitions of the current user's directory on '' | + | |
- | * Checking the properties of '' | + | |
- | * Be sure to monitor the remaining free space on '' | + | |
- | * Note: it seems that [[other: | + | |
- | * Check [[https:// | + | |
===== Base installation ===== | ===== Base installation ===== | ||
Line 192: | Line 254: | ||
-rwxrwxrwx 1 root root 63M Aug 24 14:52 / | -rwxrwxrwx 1 root root 63M Aug 24 14:52 / | ||
- | * Update | + | * Update |
- | * '' | + | * <code>stdu@sadira034: |
- | * Use the Left arrow to select '' | + | No LSB modules are available. |
- | * [[other: | + | Distributor ID: Ubuntu |
+ | Description: | ||
+ | Release: | ||
+ | Codename: | ||
+ | |||
+ | stdu@sadira034: | ||
+ | [sudo] password for stdu: | ||
+ | Get:1 http:// | ||
+ | Get:2 http:// | ||
+ | [...] | ||
+ | 278 upgraded, 32 newly installed, 0 to remove and 0 not upgraded. | ||
+ | Need to get 174 MB of archives. | ||
+ | After this operation, 305 MB of additional disk space will be used. | ||
+ | Do you want to continue? [Y/n] Y | ||
+ | [...] | ||
+ | |||
+ | stdu@sadira034: | ||
+ | No LSB modules are available. | ||
+ | Distributor ID: Ubuntu | ||
+ | Description: | ||
+ | Release: | ||
+ | Codename: | ||
+ | |||
+ | stdu@sadira034:/ | ||
+ | DISTRIB_ID=Ubuntu | ||
+ | DISTRIB_RELEASE=20.04 | ||
+ | DISTRIB_CODENAME=focal | ||
+ | DISTRIB_DESCRIPTION=" | ||
+ | NAME=" | ||
+ | VERSION=" | ||
+ | ID=ubuntu | ||
+ | ID_LIKE=debian | ||
+ | PRETTY_NAME=" | ||
+ | VERSION_ID=" | ||
+ | HOME_URL=" | ||
+ | SUPPORT_URL=" | ||
+ | BUG_REPORT_URL=" | ||
+ | PRIVACY_POLICY_URL=" | ||
+ | VERSION_CODENAME=focal | ||
+ | UBUNTU_CODENAME=focal</ | ||
+ | | ||
+ | |||
+ | * Update the //Linux kernel// used by WSL, after stopping the running WSL instances | ||
+ | * < | ||
+ | Distribution par défaut : Ubuntu | ||
+ | Version par défaut : 2 | ||
+ | |||
+ | La dernière mise à jour effectuée du Sous-système Windows pour Linux date du 23/ | ||
+ | Les mises à jour WSL automatiques sont activées. | ||
+ | |||
+ | Version du noyau : 5.10.16 | ||
+ | |||
+ | PS C:\> wsl -l -v | ||
+ | NAME STATE | ||
+ | * Ubuntu | ||
+ | |||
+ | PS C:\> wsl --terminate Ubuntu | ||
+ | |||
+ | PS C:\> wsl -l -v | ||
+ | NAME STATE | ||
+ | * Ubuntu | ||
+ | |||
+ | PS C:\> wsl --update | ||
+ | Recherche de mises à jour en cours... Veuillez patienter | ||
+ | Téléchargement de mises à jour en cours... Veuillez patienter. | ||
+ | Installation en cours des mises à jour... Veuillez patienter | ||
+ | Cette modification sera effective au prochain redémarrage complet de WSL. Pour forcer un redémarrage, | ||
+ | Version du noyau : 5.10.102.1 | ||
+ | |||
+ | PS C:\> wsl --status | ||
+ | [...] | ||
+ | Version du noyau : 5.10.102.1 | ||
+ | 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</ | ||
===== After the base installation ===== | ===== After the base installation ===== | ||
Line 900: | Line 1035: | ||
===== Miscellaneous ===== | ===== Miscellaneous ===== | ||
+ | |||
+ | ==== Upgrading WSL 1 to WSL 2 ==== | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | You will be able to run existing WSL 1 installations with WSL 2, so upgrading should not be a problem! | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Determining which version of WSL is installed ? === | ||
+ | |||
+ | If you have never used WSL on a computer, WSL 2 will be installed directly when you follow the [[other: | ||
+ | |||
+ | You can determine if your installed Linux distributions are running on WSL 1 or WSL 2 by typing '' | ||
+ | |||
+ | * '' | ||
+ | * < | ||
+ | Recherche de mises à jour en cours... Veuillez patienter | ||
+ | Aucune mise à jour n’est disponible. | ||
+ | Version du noyau : 5.10.102.1</ | ||
+ | |||
+ | * '' | ||
+ | * < | ||
+ | Distribution par défaut : Ubuntu | ||
+ | Version par défaut : 2 | ||
+ | Activez la fonctionnalité Windows de plateforme de machine virtuelle et assurez-vous que la virtualisation est activée dans le BIOS. | ||
+ | Pour plus d’informations, | ||
+ | |||
+ | |||
+ | === Prerequisites === | ||
+ | |||
+ | * If WSL 1 is already running, you should have no problem with the [[other: | ||
+ | * For WSL 2, you also need to meet the [[other: | ||
+ | |||
+ | === Updating! === | ||
+ | |||
+ | |||
+ | [[https:// | ||
+ | |||
+ | After rebooting, go back to the [[other: | ||
+ | |||
+ | ==== Potentially useful stuff ==== | ||
* Determining from **inside** the running Linux if you are using WSL (or another type of virtual machine)\\ < | * Determining from **inside** the running Linux if you are using WSL (or another type of virtual machine)\\ < |
other/win10wsl.txt · Last modified: 2023/12/06 14:24 by jypeter