←back to thread

Ubuntu on Windows

(blog.dustinkirkland.com)
2049 points bpierre | 1 comments | | HN request time: 0.001s | source
Show context
captainmuon ◴[] No.11391214[source]
A few random thoughts:

- Wow, hell is really freezing over!

- The hardest part of running bash and other posix things under windows is filesystem access. Windows uses drive letters and backslashes, unix has a root filesystem with forward slashes. It seems they are taking the same route as cygwin by "mounting" windows drives in /mnt/c (or /cygdrive/c).

- If you just wanted bash and some posix tools, the harder but nicer way would be to patch them to understand windows paths. It is not clear to me that it is even possible, for example many tools assume a path that does not start with a slash is a relative path - while "C:\" is absolute. You would also want to make more windows apps understand forward slashes like "C:/Windows". To make things even more complicated, there are NT native paths "\Device\HarddiskVolume4\Users\Bill", UNC paths "\\Server\share", and the crazy syntax "\\?\C:\MyReallyLongPath\File.txt".

- I am really surprised this works in an appx container. From my little dabbling with modern apps in Visual Studio, I've found that they are incredibly sandboxed - no filesystem access unless you go through a file picker, no network connections to localhost (!?), no control of top-level windows, no loading of external DLLs. You can get around most restrictions for sideloaded apps, but not for windows store apps. That they can now package such a complex application as a modern app (with maybe only the linux subsystem DLLs delivered externally) means that they are slowly moving the modern/universal apps and traditional Win32 apps together with regards to their powers.

- Running a Linux kernel in windows, and then ELF executables on top (without virtualization) is nothing new, see CoLinux or andLinux. If I understand correctly, this new work uses a new Linux NT subsystem. It remains to be seen if this is better (more performant) or worse (if the Linux kernel is just another process, and it crashes, it doesn't take down the system).

- If they actually wrote a NT subsystem for Linux, this opens a whole can of GPL licensing worms, as you'll need to include internal NT headers. However, they say it is closed source, so I wonder how they did it.

- This really stands and falls with how well it is integrated in the rest of the system. I want to install tools in "Ubuntu" via apt and use them from cmd.exe, and vice versa. And long term, a X11/Wayland bridge would be nice too.

replies(7): >>11391240 #>>11391243 #>>11391895 #>>11391990 #>>11392163 #>>11392791 #>>11395063 #
mmebane ◴[] No.11391243[source]
> It seems they are taking the same route as cygwin by "mounting" windows drives in /mnt/c (or /cygdrive/c).

I wonder if this Unix filesystem layer will be able to break the Windows legacy path length limit. If so, the Linux version of Node.js will suddenly become much more useful than the Windows version.

> It remains to be seen if this is better (more performant) or worse

Sounds like performance, at least, will be better. TFA says "it's totally shit hot! The sysbench utility is showing nearly equivalent cpu, memory, and io performance." I'll reserve judgment until I see the fork() benchmarks. :)

replies(3): >>11391381 #>>11391508 #>>11392092 #
SNvD7vEJ ◴[] No.11392092[source]
So, max path length in Linux user space will be about 215 chars? (for it to be accessible from Windows user space)

MAX_PATH in Windows = 260

Path to Linux file system root from Windows user space:

"C:\Users\<user>\AppData\Local\Lxss\rootfs\" - about 45 chars

Max depth reachable from Windows user space = 260 - 45 = 215

replies(3): >>11392204 #>>11394446 #>>11395665 #
to3m ◴[] No.11392204[source]
The NTFS limit is 32768 wchars, though the standard Win32 API doesn't really expose it very well... fingers crossed they used it!
replies(2): >>11392441 #>>11392648 #
NateDad ◴[] No.11392648[source]
I'm pretty sure I saw something in one of the articles that mentions they explicitly use the extended \\?\ form of paths, which gets around the 255 character path limit.
replies(1): >>11397576 #
1. NateDad ◴[] No.11397576{3}[source]
Just to verify, watched a video that explicitly said that it does get around the path limit (though if you then go look at those files in explorer, explorer "has problems" whatever that means).... but that's just because explorer still uses the legacy APIs that do have a path limit.