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/24 13:29] jypeter [Disk space] Started updating |
other:win10wsl [2022/08/25 15:05] jypeter [The basics before starting] |
||
---|---|---|---|
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:win10apps#windows_terminal|Windows terminal]], because it will be one of the ways to open ''Ubuntu'' terminals, once ''Ubuntu'' is installed | ||
+ | * It will be useful to be able to [[other:win10config#displaying_hidden_folders_and_files_and_the_files_extension|see hidden folders and files]] | ||
+ | * Have at least some basic knowledge of Linux... | ||
+ | * Get some [[other:newppl:starting#useful_documentation_for_beginners|basic Linux documentation]] if required | ||
+ | ==== Computer CPU and memory ==== | ||
+ | |||
+ | 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 | ||
+ | * 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... :-) | ||
+ | |||
+ | |||
+ | ==== Disk usage ==== | ||
+ | |||
+ | === Overview === | ||
+ | |||
+ | * ''WSL'' is part of the Windows operating system and will be installed (and updated) on ''C:\'' | ||
+ | * The Linux installation(s) will be installed (and updated) on ''C:\'' | ||
+ | * They can only be relocated to other partitions afterwards | ||
+ | |||
+ | * => We should **start with at least 10 Gb of free space on ''C:\''** (but more space is always better and safer) | ||
+ | * The initial installation will not use much space (2-3 Gb), but we always need space on ''C:\'' for other applications and Windows maintenance (temporary files, updates, ...) | ||
+ | |||
+ | === How does it work? === | ||
+ | WSL+Linux seems to use a combination of actual Windows files/folders and ''ext4'' Linux partitions stored in ''.vhdx'' ([[https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-vhdx/83f6b700-6216-40f0-aa99-9fcb421206e2|Dynamic Virtual Hard Disk]]) files. The Linux disk (of type ''ext4'') is stored in a single ''some_name.vhdx'' Windows file that will automatically grow until it reaches a predefined maximum size of 256 Gb (if there is enough space on the Windows disk...) | ||
- | ==== Disk space ==== | + | * Check [[https://docs.microsoft.com/en-us/windows/wsl/vhd-size|Expand the size of your WSL 2 Virtual Hard Disk]] if you need more than 256 Gb |
+ | * Check the following threads if you want to reduce the size of the ''vhdx'' file: | ||
+ | * [[https://superuser.com/questions/1606213/how-do-i-get-back-unused-disk-space-from-ubuntu-on-wsl2|How do I get back unused disk space from ubuntu on wsl2?]] | ||
+ | * [[https://github.com/microsoft/WSL/issues/4699#issuecomment-1136319012|WSL 2 should automatically release disk space back to the host OS]] | ||
+ | * [[https://docs.microsoft.com/en-us/powershell/module/hyper-v/optimize-vhd?view=windowsserver2019-ps|Optimize-VHD]] | ||
<code>stdu@sadira034:~$ ls -lh /mnt/c/Users/jypeter/AppData/Local/Temp/swap.vhdx | <code>stdu@sadira034:~$ ls -lh /mnt/c/Users/jypeter/AppData/Local/Temp/swap.vhdx | ||
Line 61: | Line 92: | ||
-rwxrwxrwx 1 root root 2.6G Aug 24 15:24 /mnt/c/Users/jypeter/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/ext4.vhdx | -rwxrwxrwx 1 root root 2.6G Aug 24 15:24 /mnt/c/Users/jypeter/AppData/Local/Packages/CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/LocalState/ext4.vhdx | ||
</code> | </code> | ||
+ | |||
+ | <code>stdu@sadira034:/usr/lib/wsl/drivers$ df -h | grep drivers | ||
+ | drivers 472G 116G 356G 25% /usr/lib/wsl/drivers | ||
+ | |||
+ | stdu@sadira034:/usr/lib/wsl/drivers$ du -sh /usr/lib/wsl/drivers | ||
+ | 9.1G /usr/lib/wsl/drivers | ||
+ | |||
+ | stdu@sadira034:/usr/lib/wsl/drivers$ du -sh /mnt/c/Windows/System32/DriverStore/ | ||
+ | 9.1G /mnt/c/Windows/System32/DriverStore/</code> | ||
FIXME | FIXME | ||
Line 192: | Line 232: | ||
-rwxrwxrwx 1 root root 63M Aug 24 14:52 /mnt/c/Users/jypeter/AppData/Local/Temp/swap.vhdx</code> | -rwxrwxrwx 1 root root 63M Aug 24 14:52 /mnt/c/Users/jypeter/AppData/Local/Temp/swap.vhdx</code> | ||
- | * Update your Ubuntu Linux with: | + | * Update //Ubuntu// with: ''sudo apt update && sudo apt upgrade'' |
- | * ''sudo apt update && sudo apt upgrade'' | + | * <code>stdu@sadira034:~$ lsb_release -a |
- | * Use the Left arrow to select ''<Yes>''+''Enter'' when some services have to be restarted | + | No LSB modules are available. |
- | * [[other:win10wsl#updating_wsl_and_ubuntu|More details about updating WSL and/or Ubuntu]] (you can safely skip this for now) | + | Distributor ID: Ubuntu |
+ | Description: Ubuntu 20.04 LTS | ||
+ | Release: 20.04 | ||
+ | Codename: focal | ||
+ | |||
+ | stdu@sadira034:~$ sudo apt update && sudo apt upgrade | ||
+ | [sudo] password for stdu: | ||
+ | Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] | ||
+ | Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB] | ||
+ | [...] | ||
+ | 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:~$ lsb_release -a | ||
+ | No LSB modules are available. | ||
+ | Distributor ID: Ubuntu | ||
+ | Description: Ubuntu 20.04.4 LTS | ||
+ | Release: 20.04 | ||
+ | Codename: focal</code> | ||
+ | * [[other:win10wsl#updating_wsl_and_ubuntu|More details about updating WSL and/or Ubuntu]] (you can safely skip this for now) | ||
+ | |||
+ | * Update the //Linux kernel// used by WSL, after stopping the running WSL instances | ||
+ | * <code>PS C:\> wsl --status | ||
+ | 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/08/2022 | ||
+ | Les mises à jour WSL automatiques sont activées. | ||
+ | |||
+ | Version du noyau : 5.10.16 | ||
+ | |||
+ | PS C:\> wsl -l -v | ||
+ | NAME STATE VERSION | ||
+ | * Ubuntu Running 2 | ||
+ | |||
+ | PS C:\> wsl --terminate Ubuntu | ||
+ | |||
+ | PS C:\> wsl -l -v | ||
+ | NAME STATE VERSION | ||
+ | * Ubuntu Stopped 2 | ||
+ | |||
+ | 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, exécutez « wsl --shutdown ». | ||
+ | Version du noyau : 5.10.102.1 | ||
+ | |||
+ | PS C:\> wsl --status | ||
+ | [...] | ||
+ | Version du noyau : 5.10.102.1 | ||
+ | PS C:\> wsl cat /proc/version | ||
+ | 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</code> | ||
===== After the base installation ===== | ===== After the base installation ===== | ||