Hacker News new | ask | show | jobs
by jazzyjackson 698 days ago
For the uninitiated, Plan 9 lives on as the filesystem network interface that allows Windows and Windows Subsystem for Linux cross-platform access to your C drive. Via "https://nelsonslog.wordpress.com/2019/06/01/wsl-access-to-li...":

    Plan 9’s filesystem is a very simple network filesystem protocol to share files between systems. They are specifically using 9P2000.L.
    They considered using Samba and SMB instead but can’t rely on Samba being installed and usable in the Linux guest OS and didn’t want to ship it because Samba is GPL licensed.
    They picked Plan 9 because it’s much simpler to implement. Also Microsoft already had Plan 9 server code for some other Linux container project they’d done.
    The \\wsl$\ path is handled in the Windows system by the MUP, an existing hook for network-like filesystems. They added a new one for Plan 9.
    The $ is in the name so that it can’t be confused with a computer whose hostname is wsl.
    The Plan 9 server in Linux communicates with the Windows Plan 9 client via a Unix socket. (Windows supports Unix sockets; who knew?)
    Windows can access your Linux files even if no Linux is instance is running. There’s a new Windows service called LXSManagerUser that mediates user identity and permissions.
2 comments

> (Windows supports Unix sockets; who knew?)

Only since Windows 10 build 17063 (December 2017 pre-release) [0] [1], which was released as Windows 10 April 2018 Update. So for the first 25+ years of Windows' existence, it didn't.

And although it does implement the basic functionality, it is missing features found on mainstream Unix-like platforms, e.g. file descriptor passing (SCM_RIGHTS)

[0] https://devblogs.microsoft.com/commandline/af_unix-comes-to-...

[1] https://betawiki.net/wiki/Windows_10_build_17063

> Plan 9 lives on as the filesystem network interface that allows Windows and Windows Subsystem for Linux cross-platform access to your C drive.

Same with other hypervisors, virtualbox etc do the same. If you have docker installed on macOS it also uses 9p to share data with the host.

But IMO 9p is a terrible choice for this, particularly because it doesn’t support hard links. It breaks a lot of software like sccache etc which rely on hardlinks to work.

The reply from the plan9 devs on why this is the case hits staggering levels of arrogance:

> If you look at what a hard link is, you'll realize why they are not in Plan 9.

https://groups.google.com/g/comp.os.plan9/c/24mMVoy6wXA/m/JW...

I didn't take it as arrogance. And avoiding hard links and dirmove makes it more portable. Which is why it's used everywhere.

I'd even suggest it reflects humility not arrogance.

The arrogance comes from the fact that it came without any explanation whatsoever, but instead just acted as if it is the only possible position one could have. The quoted sentence didn’t have any elaboration as follow up, it was just the end of the discussion.

It’s phrased as if to say “if you gave it a moments thought, you’d see I’m right”, which is the epitome of arrogance to me.

I get this impression from Rob Pike as well… I’m sure it comes from decades of being tired of arguing with people, but he comes off as utterly dismissive, as if to say “you either agree with me or you’re an idiot”. It doesn’t help that he continually throws shade on Linux (which is approximately infinity times more successful than Plan9) as you can see from other comments in the same thread. I don’t come away with a good impression of him or any of the other plan9/9front devs. Their whole attitude seems to be “everyone in the OS/systems world is dumber than us, and even too dumb to see why they’re dumber than us. We have a perfect system beyond any reproach and you’re an idiot if you disagree.”

Its sort of annoying that he merely mentions the principle, and not precisely how it applies to hard links, but I think that's appropriate in the context of a single post / email.

>On Plan 9, the rule tends to be: if feature(X) can't be implemented in a way that works for everything, don't do it.

TBH I don't think hard links would be missed in Linux either, symlinks are good enough.

> symlinks are good enough

They really aren’t though. Anyone reading from a symlink needs access to the path it points to. If I have a network share with hard links pointing to common storage that’s outside the share’s root, clients are none the wiser and see them as normal files. With symlinks they would see links to paths they can’t see. It’s not really the same thing.

I can accept that someone considers a hard link a sort of insanity or deliberate corruption, or at best an undesirable feature, but I think they should just say that rather than go to the next level and act like this is the only possible position.
rminnich is a lot of things (including a 9front developer) but not a plan9 developer.

He is right however, you are also right: it's because Windows and Docker publish 9p server in a stupid way. It shouldn't be just the guest fs, you should be able to make any file server you like so hard links would be useless (as they are in plan9) because you would decide what filesystem organization layout you need.

You could make do with FUSE inside the virtualized OSes I guess.