From 8c100935c8c493f5ddf6689bfbc35d480f1c5ad7 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 15 Dec 2024 00:02:33 +0000 Subject: [PATCH] Tidying instructions - online edit of handbook/computing/wsllaptop.html [PosixPath('/home/philip/expo/expoweb/handbook/computing/wsllaptop.html')] --- handbook/computing/wsllaptop.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/handbook/computing/wsllaptop.html b/handbook/computing/wsllaptop.html index 3d2c385f2..3435340e9 100644 --- a/handbook/computing/wsllaptop.html +++ b/handbook/computing/wsllaptop.html @@ -79,7 +79,7 @@ Now finally you can use all the usual command line tools at your wsl command lin

Python on WSL

WSL installs python by default, but it may be a rather old python (depending on the history of your laptop, phase of moon etc.) and if you want development speed you want python3.13. [NB check what version of python is running on the server. It was 3.11.2 in December 2024.]. -

We used to have lengthy instructions fo installing python using "deadsnakes" but since December 2024 we just use the uv utility for everything. +

We used to have lengthy instructions fo installing python using "deadsnakes" but since December 2024 we just use the uv utility for everything, see ⚒ troggle development machine -

WSL1 Historic problems

+

WSL1 Historic problems

-WSL2 is now noticeably even slower for NTFS files mounted as /mnt/c or /mnt/d, so now it is only really useable if you move all the troggle code into your Linux filespace on \\wsl.localhost\Ubuntu-22.04\home which means that those files will only be accesible from Linux. Buggeration. +

Do not use WSL1. And with WSL2, put all your development files into the ext4 filesystem on \\wsl.localhost\Ubuntu\home\username\expo\. In 2024 the hassles of working with NTFS files under WSL are not worth it. If your Windows laptop can't install WSL2, install a Xubuntu dual-boot system on a separate disc partition or SD card. + +

+WSL2 is now noticeably even slower for NTFS files mounted as /mnt/c or /mnt/d, so now it is only really useable if you move all the troggle code into your Linux filespace on \\wsl.localhost\Ubuntu\home which means that those files will only be accesible from Linux.

WSL1 and WSL2

WSL now installs as WSL2 by default, but older machines (mostly laptops) may not have the Hyper-V Virtualization hardware and may have to run WSL1. This may be fine: the behaviour is nearly identical so far as an expo laptop is concerned, where you just want to use rsync and scp. An old 2011-era PC had been doing troggle development happily using WSL1. However time is clearly running out for WSL1, and the file handling is now very noticably slower. If your laptop won't run WSL2 then you are advised to get rid of Windows completely and install Xubuntu as a dual boot system. -

For some laptops though, WSL1 does not install properly and you have to use WSL2. The symptom is two error messages when you run dmesg in -the Linux bash terminal window. However, if all you want to use it for is rsync, this may still be fine.

WSL2 - things to watch for

On some Windows 10 laptops WSL1 fails to install properly and you have to use WSL2.

You should check that the configuration files do what you want.

When running a full troggle development laptop (see separate troggle documentation) -you will want to use python venv. This barfs untidily if you have the code on NTFS, e.g. if mounted on /mnt/c/. You almost +you will want to use a virtual environment (python venv or uv). This barfs untidily if you have the code on NTFS, e.g. if mounted on /mnt/c/. You almost certainly have to move all your code to the internal network share e.g. \\wsl$\Ubuntu\home\expo\troggle\ which is how it looks when you are browing from Windows. (No, don't try to be cute and keep it on /mnt/c/ and just put a soft link in /home/expo/. That doesn't work either.) This means that the code is actually living on a Linux ext4 filesystem hidden away on your disc where you can only see it using the -'network' method \\wsl$\Ubuntu-20.04\home\expo\troggle\. This means that file access is noticably faster too. You will need to make sure that your backup/archive methods access this filesystem though. +'network' method \\wsl$\Ubuntu\home\expo\troggle\. This means that file access is noticably faster too. You will need to make sure that your backup/archive methods access this filesystem though.

NB rsync doesn't work with NTFS partitions the way that WSL1 does. @@ -135,8 +136,8 @@ in the \\wsl$\ ext4 filesystem (WSL2 only, not WSL1).

Permissions, permissions..

-

Having happily used WSL1 in this manner for a couple of years, it was a rude awakening to try this with a new laptop with a small -hard-drive, so all the expo code was re-mounted on a plugged-in SD card. The problem of permissions that seemed to be a WSL2 issue reappeared with +

Having happily used WSL1 for a couple of years since 2020, it was a rude awakening to try this with a new laptop with a small +hard-drive, so all the expo code was re-mounted on a plugged-in SD card. The problem of permissions that seemed to be purely a WSL2 issue reappeared with a vengence on WSL1.

The recommended WSL procedure (Jan.2021) said to mount the drive using a new 'metadata' setting: