Most active commenters

    ←back to thread

    Ubuntu on Windows

    (blog.dustinkirkland.com)
    2049 points bpierre | 12 comments | | HN request time: 0.628s | source | bottom
    1. msoad ◴[] No.11390994[source]
    So what OS you're going to get when you run an application under this? So if I run this:

        node -e 'console.log(require("os").type())'
    
    What it's going to print?
    replies(7): >>11391034 #>>11391059 #>>11391325 #>>11391359 #>>11392940 #>>11393115 #>>11394355 #
    2. jokr004 ◴[] No.11391034[source]
    Would depend entirely on how you installed node, I would imagine.
    3. orf ◴[] No.11391059[source]
    Whatever it prints on Ubuntu I expect. Obviously it's not going to return "Windows", or "UbuntuInWindows" else anything that makes that call that would break.
    4. jdub ◴[] No.11391325[source]
    As WinLS is very much like branded Solaris Zones, here's what it looks like when you run `uname -a` in an (old, copypasta from the web) Linux branded zone:

        Linux centos 2.4.21 BrandZ fake linux i686 i686 i386 GNU/Linux
    5. pookeh ◴[] No.11391359[source]
    Depends if the node is a Windows executable or a Linux binary.
    replies(1): >>11392827 #
    6. jensvdh ◴[] No.11392827[source]
    So if I install Node as a Linux binary. Can I access it in Windows "environment" too?

    Does that mean I can do "apt-get install nginx" from their new "bash" terminal app? Does that then run under port 80 in Windows? Since no VM is involved.

    I'm still a bit confused.

    replies(1): >>11394170 #
    7. niutech ◴[] No.11392940[source]
    See this screenshot showing uname -a: https://1.bp.blogspot.com/-PTJrez4z0Jc/Vvr-VH5DQOI/AAAAAAAFH...
    replies(1): >>11393090 #
    8. drewg123 ◴[] No.11393090[source]
    Seems less honest than the Linux env on FreeBSD, which at least puts FreeBSD in there for uname -a. Eg:

    % uname -srm FreeBSD 10.3-RELEASE amd64 % /compat/linux/bin/bash bash-4.1$ /bin/uname -srm Linux 2.6.32 i686 bash-4.1$ /bin/uname -a Linux viserion 2.6.32 FreeBSD 10.3-RELEASE #0 4b75b72(releng/10.3): Fri Mar 25 19:14:5 i686 i686 i386 GNU/Linux bash-4.1$ cat /proc/cpuinfo | grep 'model name' | head -1 model name : Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz

    9. zxcvcxz ◴[] No.11393115[source]
    I just see this as a headache for developers.

    I don't want or need a Linux ABI, I just want to run a Linux container on Windows (if I have to use windows, which I would prefer not to do).

    If node running on windows needs access to a database running on the Linux layer then what happens when things aren't working? They can't possibly make all programs interact in a seamless way.

    I'm imagining frankenstein programs that are hacked together with code that only works on this frankenstein OS.

    replies(1): >>11393341 #
    10. xorblurb ◴[] No.11393341[source]
    If you want a Linux container on Windows (which they do not seem to propose right away, but it seems a logical step), you need a Linux ABI.
    11. anonymfus ◴[] No.11394170{3}[source]
    >Does that then run under port 80 in Windows?

    Yes, they demonstrated that localhost is the same localhost under both environments.

    12. davesque ◴[] No.11394355[source]
    Looks like, if a posix system is detected at compile time, it will return whatever it gets from the `uname` system call in `sys/utsname.h`:

    https://github.com/nodejs/node/blob/master/src/node_os.cc#L5...

    Microsoft probably hard-codes a response of "Linux" (or whatever would be normal for Ubuntu) for that call to prevent Ubuntu binaries from freaking out.