Discussion:
Waiter, what's this plan9 doing in my process list?
(too old to reply)
DFS
2022-11-17 00:48:08 UTC
Permalink
I was looking at an article on process spawning, and the author used a
few examples. I tried them:

***@UbuntuWSL:~$ echo $$
11

***@UbuntuWSL:~$ ps fx
PID TTY STAT TIME COMMAND
11 pts/0 Ss 0:00 -bash
71 pts/0 R+ 0:00 \_ ps fx

***@UbuntuWSL:~$ ps fax
PID TTY STAT TIME COMMAND
1 ? Sl 0:00 /init
4 ? Sl 0:00 plan9 --control-socket 5 --log-level 4
--server-fd 6 --pipe-fd 8 --log-truncate
9 ? Ss 0:00 /init
10 ? S 0:00 \_ /init
11 pts/0 Ss 0:00 \_ -bash
72 pts/0 R+ 0:00 \_ ps fax


Was surprised by the last one, which looked like systemd-related
settings. But I hunted around and found 'plan9' is used because the
Microsoft WSL distros serve files using a variant of the Plan 9
filesystem protocol, and Windows is the client.

This is how you can read WSL Linux filesystems from Windows File
Explorer. But for some reason they don't show /bin and /lib directories.
vallor
2022-11-18 13:57:38 UTC
Permalink
Post by DFS
I was looking at an article on process spawning, and the author used a
11
PID TTY STAT TIME COMMAND
11 pts/0 Ss 0:00 -bash 71 pts/0 R+ 0:00 \_ ps fx
PID TTY STAT TIME COMMAND
1 ? Sl 0:00 /init 4 ? Sl 0:00 plan9
--control-socket 5 --log-level 4
--server-fd 6 --pipe-fd 8 --log-truncate
9 ? Ss 0:00 /init
10 ? S 0:00 \_ /init 11 pts/0 Ss 0:00 \_
-bash 72 pts/0 R+ 0:00 \_ ps fax
Was surprised by the last one, which looked like systemd-related
settings. But I hunted around and found 'plan9' is used because the
Microsoft WSL distros serve files using a variant of the Plan 9
filesystem protocol, and Windows is the client.
This is how you can read WSL Linux filesystems from Windows File
Explorer. But for some reason they don't show /bin and /lib
directories.
They couldn't use CIFS for that... and they dare not use NFS.
--
-v
DFS
2022-11-18 17:58:18 UTC
Permalink
Post by vallor
Post by DFS
I was looking at an article on process spawning, and the author used a
11
PID TTY STAT TIME COMMAND
11 pts/0 Ss 0:00 -bash 71 pts/0 R+ 0:00 \_ ps fx
PID TTY STAT TIME COMMAND
1 ? Sl 0:00 /init 4 ? Sl 0:00 plan9
--control-socket 5 --log-level 4
--server-fd 6 --pipe-fd 8 --log-truncate
9 ? Ss 0:00 /init
10 ? S 0:00 \_ /init 11 pts/0 Ss 0:00 \_
-bash 72 pts/0 R+ 0:00 \_ ps fax
Was surprised by the last one, which looked like systemd-related
settings. But I hunted around and found 'plan9' is used because the
Microsoft WSL distros serve files using a variant of the Plan 9
filesystem protocol, and Windows is the client.
This is how you can read WSL Linux filesystems from Windows File
Explorer. But for some reason they don't show /bin and /lib
directories.
They couldn't use CIFS for that... and they dare not use NFS.
Would CIFS and NFS be precluded for technical reasons?
Relf
2022-11-18 18:40:45 UTC
Permalink
Use NTFS exclusively, if possible.

Make WSL's file system (mostly) case insensitive, if possible.
DFS
2022-11-18 19:40:33 UTC
Permalink
Post by Relf
Use NTFS exclusively, if possible.
Tricky, but it seems possible.

https://www.theregister.com/2021/11/22/install_linux_on_ntfs/#:~:text=This%20has%20had%20a%20consequence,the%20same%20partition%20as%20Windows.


You - the user - have no choice over the filesystem used when installing
a WSL distro. The WSL distro maker decides that when building the
distro package, and so far all that I've checked are built with ext4.


Kali-Linux
┌──(dfs㉿Win11EE)-[/bin]
└─$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
none tmpfs 3.4G 4.0K 3.4G 1% /mnt/wsl
drivers 9p 236G 188G 48G 80% /usr/lib/wsl/drivers
none overlay 3.4G 0 3.4G 0% /usr/lib/wsl/lib
/dev/sdd ext4 1007G 41G 916G 5% /
none tmpfs 3.4G 292K 3.4G 1% /mnt/wslg
rootfs rootfs 3.4G 1.9M 3.4G 1% /init
none devtmpfs 3.4G 0 3.4G 0% /dev
none tmpfs 3.4G 0 3.4G 0% /run
none tmpfs 3.4G 0 3.4G 0% /run/lock
none tmpfs 3.4G 0 3.4G 0% /run/shm
none tmpfs 3.4G 0 3.4G 0% /run/user
tmpfs tmpfs 3.4G 0 3.4G 0% /sys/fs/cgroup
none overlay 3.4G 76K 3.4G 1% /mnt/wslg/versions.txt
none overlay 3.4G 76K 3.4G 1% /mnt/wslg/doc
drvfs 9p 236G 188G 48G 80% /mnt/c
drvfs 9p 1.9T 1.3T 626G 67% /mnt/d
drvfs 9p 1.9T 1.3T 543G 71% /mnt/e


(I don't know why the df command says the ext4 filesystem /dev/sdd has
more space available (916G) than the actual space available on the drive
/mnt/c (48G) )


On your system you can find the WSL distro entries at:
C:\Users\<user>\AppData\Local\Packages\

The 3 I have installed are:
- KaliLinux.54290C8133FEE_ey8k8hqnwqnmg
- CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc
- TheDebianProject.DebianGNULinux_76v4gfsz19hv4


The WSL .vhdx files are at:
C:\Users\<user>\AppData\Local\Packages\<WSL distro entry>\LocalState\



How WSL distros are packaged:
https://github.com/Microsoft/WSL-DistroLauncher
Post by Relf
Make WSL's file system (mostly) case insensitive, if possible.
Probably the WSL distro maker would have to use this feature before
bundling the WSL distro:

https://www.collabora.com/news-and-blog/blog/2020/08/27/using-the-linux-kernel-case-insensitive-feature-in-ext4/
Relf
2022-11-18 20:34:42 UTC
Permalink
Post by DFS
Post by Relf
Make WSL's file system (mostly) case insensitive, if possible.
https://www.collabora.com/news-and-blog/blog/2020/08/27/using-the-linux-kernel-case-insensitive-feature-in-ext4/
Googling "Case Insensitive Linux distros" doesn't show any distros.
Post by DFS
Post by Relf
Use NTFS exclusively, if possible.
You - the user - have no choice over the filesystem used when installing
a WSL distro. The WSL distro maker decides that when building the
distro package, and so far all that I've checked are built with ext4.
Not good.
rbowman
2022-11-18 22:54:08 UTC
Permalink
Post by Relf
Googling "Case Insensitive Linux distros" doesn't show any distros.
You're swimming upstream on that one. Besides Linux allows you to have
Makefile and makefile in the same directory for your amusement.
DFS
2022-11-18 22:56:39 UTC
Permalink
Post by rbowman
Post by Relf
Googling "Case Insensitive Linux distros" doesn't show any distros.
You're swimming upstream on that one. Besides Linux allows you to have
Makefile and makefile in the same directory for your amusement.
Plus:

Dick.doc (bowman's friend)
dick.doc (bowman's hobby)

Loading...