The state of Ubuntu on Windows


  • ♿ (Parody)

    @blakeyrat said in The state of Ubuntu on Windows:

    @PleegWat said in The state of Ubuntu on Windows:

    You call them consoles. Linux calls them TTY devices.

    But they aren't TTY devices.

    Well, Windows is software and nothing like the window in my wall.


  • ♿ (Parody)

    @blakeyrat said in The state of Ubuntu on Windows:

    I'm sure you aren't, but that doesn't make my point any less valid.

    But there's nothing to make your point valid in the first place, so that's OK.


  • kills Dumbledore

    @cartman82 said in The state of Ubuntu on Windows:

    However, nothing's stopping you from shipping a GUI app as part of your Windows service

    Windows makes this very difficult. I think it requires turning off an obscure setting, one that might even have been removed in recent versions



  • @Jaloopa said in The state of Ubuntu on Windows:

    Windows makes this very difficult. I think it requires turning off an obscure setting, one that might even have been removed in recent versions

    You mean a service can't just start up a gui app whenever it feels like? Tell that to fucking 100 updater services on my system.


  • FoxDev

    @cartman82 said in The state of Ubuntu on Windows:

    Tell that to fucking 100 updater services on my system.

    Those aren't services.

    To clarify: those aren't Windows Services; they're standard desktop programs that (mostly) run in the background.



  • @blakeyrat

    that would mean it's impossible to do centralized logging with a arbitrary Linux service, which sucks and makes it FAR inferior to the Windows implementation. (Even if the WIndows implementation requires all those "special" APIs! SO SPECIAL GUYZZZZZZ!!!!!)

    In linux, it's sufficient to write to stdout/stderr, and systemd/journald redirect that to a log. Which can be transferred over a network, centralized, aggregated all the way. The application does not need to even care how its output is logged (there are fuckwits who try to reinvent a wheel every so often), it'd better care to do its own thing properly.

    And, in "the linux world", it's good manners to not give a faintest fuck how an application is going to be used. It's of no author's business to limit the ways I can, and will, deploy and use it. You just write it so those things are possible, in other words, you don't try to be overly clever.

    And, yes, if Windows makes "apps" vs "services" so distinct that you're fucked if the author of your application didn't provide a way to run it as a service if you need it (and people resort to running it under their rdesktop sessions or whatnot) because he didn't think someone might actually need it, then really, fuck it all and let it burn.



  • @RaceProUK said in The state of Ubuntu on Windows:

    To clarify: those aren't Windows Services; they're standard desktop programs that (mostly) run in the background.

    It's the design decisions that postulate that there should be differences like this give me heebijeebies.

    Good thing they didn't let that person make the "Single-window/multi-window/MDI" into a compiler flag, but I think the crazy bloke managed to invent the application type flag in the PE format which tells whether it's a console or a GUI app (why not both?). That's mental.


  • FoxDev

    @wft said in The state of Ubuntu on Windows:

    flag in the PE format which tells whether it's a console or a GUI app (why not both?)

    That's not what the flag is for; the flag simply indicates whether to show a console window or not. There's nothing in Windows that stops a console app creating a GUI (or a GUI app showing a console window); I've written several myself.



  • @RaceProUK said in The state of Ubuntu on Windows:

    That's not what the flag is for; the flag simply indicates whether to show a console window or not. There's nothing in Windows that stops a console app creating a GUI (or a GUI app showing a console window); I've written several myself.

    You sure about that?

    I remember trying to make an app that responds to CLI commands or launches a GUI session, and hitting a wall. AFAIR you can either flag the app as "run it in CLI" or "launch a GUI". Not both. And not pick which mode to use dynamically.



  • @RaceProUK I remember vice versa was also possible. But anyway, this flag is a hack. The whole console on Windows is a hack.


  • kills Dumbledore

    @wft said in The state of Ubuntu on Windows:

    The whole console on Windows is a hack


  • FoxDev

    @cartman82 said in The state of Ubuntu on Windows:

    You sure about that?

    Yep. I've written console apps that display message boxes and use the Windows file chooser; it's a short step from that to a full-blown GUI.

    Of course, I did do that in .NET where it's super-fucking-easy to mix console and GUI; one attribute and a few lines of code is all it takes.



  • @Jaloopa said in The state of Ubuntu on Windows:

    @wft said in The state of Ubuntu on Windows:

    The whole console on Windows is a hack


  • BINNED

    The only thing some services I wrote have that a "regular" application doesn't is a compatibility layer library that makes it easy to support start / reload / stop commands regardless of OS (it's actually only used on Linux but this way I don't have to worry about specifics). Other than that, yeah, the only difference between a "service" and an "application" on Linux is what resources you can expect available depending on when you want to run it.

    To address systemd specifically, the main thing it makes easier to do, IMHO, is ensuring that all resources are available. For example, I can tell it that I expect a different service to be up, or that network drives are mounted or similar and just let systemd worry about the details of what can or cannot be started, and when.


  • ♿ (Parody)

    @RaceProUK said in The state of Ubuntu on Windows:

    Of course, I did do that in .NET where it's super-fucking-easy to mix console and GUI; one attribute and a few lines of code is all it takes.

    It's "easy" enough just using the regular Win32 API or whatever. I mean...you just use it. Also, getting a console where you can do normal console stuff from a non-console app is easy enough...you just call a particular function and Windows creates one for you.

    We had a giant conversation about this somewhere around here.



  • @RaceProUK said in The state of Ubuntu on Windows:

    Tell that to fucking 100 updater services on my system.

    Those aren't services.
    To clarify: those aren't Windows Services; they're standard desktop programs that (mostly) run in the background.

    I just tested this, and you're absolutely right. Windows will detect a service is trying to start a GUI app and prevent any windows from being shown. TIL.

    The only thing I didn't try is if it can create a one-off immediately executing scheduled task and work around the restriction that way.


  • FoxDev

    @cartman82 said in The state of Ubuntu on Windows:

    The only thing I didn't try is if it can create a one-off immediately executing scheduled task and work around the restriction that way.

    So long as the task is configured to run in a user session, that should work



  • @PleegWat said in The state of Ubuntu on Windows:

    And if you're saying that's absolutely impossible to do in windows for a determined-enough developer I won't believe you.

    It's not absolutely impossible, but Windows will catch the attempt and draw it on an alternative-desktop which then requires Admin permissions (IIRC) to see and interact with. They basically guarantee that it's awful enough the instant a service developer sees it, they'll fix it.

    @cartman82 said in The state of Ubuntu on Windows:

    However, nothing's stopping you from shipping a GUI app as part of your Windows service and having the service run the app every minute, if you wanted.

    Only if the service is running under a user account, which is a very weird and uncommon configuration. If it's running normally, no, it can't start a GUI app.

    @cartman82 said in The state of Ubuntu on Windows:

    On the other hand, you can also make a generic "app runner" service, that is just a wrapper around any other app (like a shell script), so you can do things the linux way.

    Pretty sure that's not possible unless the service is configured to run as a specific user, for the reason stated above.

    @cartman82 said in The state of Ubuntu on Windows:

    So either way, you can do the same things on both platforms

    ... except you can't.

    @cartman82 said in The state of Ubuntu on Windows:

    And this is a console.

    I was going to say "check the dictionary", but apparently the computer-related definition of "console" isn't in them. At least not the one Google uses. Huh.

    Either way, if you look up TTY in Google you see teletypes.

    @cartman82 said in The state of Ubuntu on Windows:

    You mean a service can't just start up a gui app whenever it feels like?

    No it can't. Where would the app go? What desktop would it display on?

    It can if the service is running under a user account (weird and rare). Other than that, no, it can't.

    @cartman82 said in The state of Ubuntu on Windows:

    Tell that to fucking 100 updater services on my system.

    Those aren't typically services; just applications that don't draw anything to the UI.

    @wft said in The state of Ubuntu on Windows:

    In linux, it's sufficient to write to stdout/stderr, and systemd/journald redirect that to a log. Which can be transferred over a network, centralized, aggregated all the way. The application does not need to even care how its output is logged (there are fuckwits who try to reinvent a wheel every so often), it'd better care to do its own thing properly.

    Yeah that's fucking awful.

    @wft said in The state of Ubuntu on Windows:

    And, in "the linux world", it's good manners to not give a faintest fuck how an application is going to be used. It's of no author's business to limit the ways I can, and will, deploy and use it. You just write it so those things are possible, in other words, you don't try to be overly clever.

    Windows isn't trying to be overly clever, it's trying to prevent nonsense/impossible situations from occurring.

    @wft said in The state of Ubuntu on Windows:

    And, yes, if Windows makes "apps" vs "services" so distinct that you're fucked if the author of your application didn't provide a way to run it as a service if you need it (and people resort to running it under their rdesktop sessions or whatnot) because he didn't think someone might actually need it, then really, fuck it all and let it burn.

    If he didn't separate the UI from the program logic in the first place (you know, like shitty incompetent Linux developers generally fail to do), then he's fucked-up long before this becomes an issue.



  • @wft said in The state of Ubuntu on Windows:

    It's the design decisions that postulate that there should be differences like this give me heebijeebies.

    Applications that don't draw anything to the GUI can't exist in Classic Mac OS. If that makes you feel any better. They at minimum have a menu bar.

    @wft said in The state of Ubuntu on Windows:

    The whole console on Windows is a hack.

    It was also deprecated between about 1995 and 2010 or so when Linux-y open source shit became "trendy".

    @cartman82 said in The state of Ubuntu on Windows:

    I just tested this, and you're absolutely right. Windows will detect a service is trying to start a GUI app and prevent any windows from being shown. TIL.

    How else could it work?

    Remember, in Windows, desktops (optionally) belong to users. The service account doesn't have one. Why would it have one? It's just running services.

    So when a service says "draw a window", the OS quite rightly responds with, "huh? Where? Like... how? There's... nothing to draw it on!"

    @cartman82 said in The state of Ubuntu on Windows:

    he only thing I didn't try is if it can create a one-off immediately executing scheduled task and work around the restriction that way.

    The problem isn't HOW you run the application, but what user account you run it under. If you create a scheduled task that runs it as "bob" and "bob" is logged-in, then yes, that should work. Similarly, if you simply execute the RunAs API to run it as "bob", that would also work.


  • Java Dev

    @blakeyrat said in The state of Ubuntu on Windows:

    So when a service says "draw a window", the OS quite rightly responds with, "huh? Where? Like... how? There's... nothing to draw it on!"

    That's actually the same in linux. A service is going to at least have some hoops to jump through to get a reference to an active GUI session, as it does get started without one.
    However there's no 1 user 1 desktop link, and I'm not sure to what degree access to desktops is restricted. It's not purely 'the logged in user' because starting GUI apps as root works.



  • @blakeyrat said in The state of Ubuntu on Windows:

    How else could it work?
    Remember, in Windows, desktops (optionally) belong to users. The service account doesn't have one. Why would it have one? It's just running services.
    So when a service says "draw a window", the OS quite rightly responds with, "huh? Where? Like... how? There's... nothing to draw it on!"

    The problem isn't HOW you run the application, but what user account you run it under. If you create a scheduled task that runs it as "bob" and "bob" is logged-in, then yes, that should work. Similarly, if you simply execute the RunAs API to run it as "bob", that would also work.

    I see. Very interesting.

    I always just assumed that popup apps like resident antiviruses and update notifiers were just background services that launch GUI windows when an event is triggered. I guess they are actually windowless applications that are started through other means (eg. autorun on boot).

    The only question is, what happens if you exit one of these applications, but leave the service running. The service might want to tell you something, but has no API to bring back GUI so it can do so.



  • @PleegWat said in The state of Ubuntu on Windows:

    That's actually the same in linux.

    I imagine it would be the same in any multi-user OS with a GUI and a permissions system.

    Another reason why the statement "Linux services are just the same as normal Linux apps!" is a lie.

    @PleegWat said in The state of Ubuntu on Windows:

    It's not purely 'the logged in user' because starting GUI apps as root works.

    As it does in Windows; but it's a weird hack to make this work, and it doesn't work very well. (For example, you can't drag & drop between an admin-permission app and a user-permission app even if you're looking at them side-by-side.)

    I saw an article on it once, but I'd never be able to track it down again.



  • @cartman82 said in The state of Ubuntu on Windows:

    I always just assumed that popup apps like resident antiviruses and update notifiers were just background services that launch GUI windows when an event is triggered.

    Yeah well I assumed you're an idiot who just "assumes" things instead of actually learning about them.

    My assumption turned out to be correct.

    @cartman82 said in The state of Ubuntu on Windows:

    The only question is, what happens if you exit one of these applications, but leave the service running.

    Generally-speaking, they don't have a service. I've seem some in the past who do, in those cases the service would be running under the user account. Also in those cases, the service would probably not even bother launching the GUI portion unless it actually had something to report. At least if it were written by a competent developer.

    Adobe has the Acrobat updater that runs as Local System, which is weird. I wonder what it actually does. Maybe it's a pre-downloader?



  • @blakeyrat said in The state of Ubuntu on Windows:

    Yeah well I assumed you're an idiot who just "assumes" things instead of actually learning about them.
    My assumption turned out to be correct.

    Wow, blakeyrat gets to tell someone to RTFM and stop spreading misinformation.

    This must be a rare treat for you. :-)




  • :belt_onion:

    @blakeyrat said in The state of Ubuntu on Windows:

    Another reason why the statement "Linux services are just the same as normal Linux apps!" is a lie.

    Nope. They are. They can be GUI apps, and they'll probably die if you try to do that, because no GUI is available. And if you make a GUI app a service and it dies... well, what were you expecting to happen? All that a "service" is in Linux is literally a single command...



  • @boomzilla said in The state of Ubuntu on Windows:

    @blakeyrat said in The state of Ubuntu on Windows:

    @PleegWat said in The state of Ubuntu on Windows:

    You call them consoles. Linux calls them TTY devices.

    But they aren't TTY devices.

    Well, Windows is software and nothing like the window in my wall.

    WINDOWS ARE HARDWARE.



  • Windows are hard, they are hard and no one understands.


  • BINNED

    @blakeyrat said in The state of Ubuntu on Windows:

    and "bob" is logged-in, then yes, that should work

    I thought it 'logged on' as Bob and ran the task. Similar to Bob logging on with RDP and running the task.



  • @Luhmann said in The state of Ubuntu on Windows:

    I thought it 'logged on' as Bob and ran the task.

    Well it will, but it might not appear on the screen is my point.

    The goal here is to show it on the screen, yes?


  • BINNED

    @blakeyrat
    No it won't even show through the Interactive Service Detection shizzle. But does it show anything if you run a scheduled task as Bob while Bob is logged on? I know we do this a lot and I never see these applications.



  • @Luhmann Why are you asking me? Test it your damn self.


  • BINNED

    @blakeyrat
    Because I thought you had knowledge . Won't make that mistake again. And testing sound likes too much work for Friday evening at beer o'clock.



  • @Luhmann I do have knowledge, but I'm not your slave.


  • BINNED

    @blakeyrat
    Damn shame ... now I have to fetch my beer myself



  • @blakeyrat Hey, hey, watch your unsolicited advice. Ruuuude.



  • do the Windows kernel have some special treatment for services?

    because Linux isn't an OS you know

    Android and Ubuntu work in very different ways on this service thing.


  • FoxDev

    @fbmac said in The state of Ubuntu on Windows:

    do the Windows kernel have some special treatment for services?

    From a kernel POV, services are programs like any other; where they differ is the session they run in (usually a machine account rather than a user account)


  • Discourse touched me in a no-no place

    @RaceProUK said in The state of Ubuntu on Windows:

    usually a machine account rather than a user account

    What's the difference between a machine account and a user account from a kernel perspective?


  • FoxDev

    @dkf AFAIK, nothing



  • @fbmac said in The state of Ubuntu on Windows:

    because Linux isn't an OS you know

    Er, yes, it is. Linux is the kernel, i.e. the piece of software responsible for the operation of the system. All the other things that you think are "the OS" are just programs running on the kernel.

    Android and Ubuntu work in very different ways on this service thing.

    Maybe from the user's perspective, but not from the computer's perspective. Android's services are still just programs running on the kernel. The difference is that a lot of Android's services are Java programs, while other Linux distributions don't typically have many system software written in Java.


  • Discourse touched me in a no-no place

    @fbmac said in The state of Ubuntu on Windows:

    because Linux isn't an OS you know

    Let's not start that again.



  • @loopback0 said in The state of Ubuntu on Windows:

    @fbmac said in The state of Ubuntu on Windows:

    because Linux isn't an OS you know

    Let's not start that again.

    Oops, sorry.


  • Java Dev

    @RaceProUK said in The state of Ubuntu on Windows:

    From a kernel POV, services are programs like any other; where they differ is the session they run in (usually a machine account rather than a user account)

    So how is a binary compiled to be an application or a service, if the kernel doesn't know the difference, and the kernel also doesn't know about the difference between types of user account? What is preventing you from starting an application from a service user, or vice versa?

    Because if it's "A service account doesn't have a GUI connected to it", then suddenly the linux and windows model are sounding very similar.



  • @dkf said in The state of Ubuntu on Windows:

    What's the difference between a machine account and a user account from a kernel perspective?

    From a kernel perspective? Probably nothing. From a OS-in-general perspective, machine accounts don't have a desktop, as we've discussed. I believe they also don't have any named folders, except maybe Temp.


  • FoxDev

    @PleegWat said in The state of Ubuntu on Windows:

    Because if it's "A service account doesn't have a GUI connected to it", then suddenly the linux and windows model are sounding very similar.

    I can only really speak for Windows, as that's what I have experience with, but the only real difference between a service and a standard app is the service has a few extra entry points the service manager can call; as far as the kernel is concerned, a service is just another PE executable.



  • @dkf A "machine account" is an account that cannot be logged into interactively. That usually means:

    • disabled login, so you cannot login
    • no password, so you cannot login
    • /bin/false or similar as their shell, so if you do login you get logged out immediately
    • their own group, so you only have access to world-readable and world-writeable files in addition to those you explicitly have access to

    The way it's supposed to work, you need to be actual root to listen to ports below 1024. Most services are launched as root, bind what they must, then drop privileges into one of those users ASAP with setuid.

    To keep in topic, those are the users that come into a Ubuntu on Linux system by default:

    root@localhost:/mnt/c/Users/badpa# cat /etc/passwd
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
    bin:x:2:2:bin:/bin:/usr/sbin/nologin
    sys:x:3:3:sys:/dev:/usr/sbin/nologin
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/usr/sbin/nologin
    man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
    lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
    mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
    news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
    uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
    proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
    www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
    backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
    list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
    irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
    nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
    libuuid:x:100:101::/var/lib/libuuid:
    syslog:x:101:104::/home/syslog:/bin/false
    messagebus:x:102:106::/var/run/dbus:/bin/false
    landscape:x:103:109::/var/lib/landscape:/bin/false
    sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin
    pollinate:x:105:1::/var/cache/pollinate:/bin/false
    

    That... is more than I expected. You could wait until after I install mailman, ircd or gnats (gnats?) before creating accounts for them...



  • @cartman82 said in The state of Ubuntu on Windows:

    The service might want to tell you something, but has no API to bring back GUI so it can do so.

    I think there can be some IPC in place so that the GUI, on startup, can ask the service if there is something it wishes to tell the user.

    @blakeyrat said in The state of Ubuntu on Windows:

    Applications that don't draw anything to the GUI can't exist in Classic Mac OS. If that makes you feel any better.

    And the relevance of this statement is...? Well I guess it's just as relevant as the real hardware TTYs which roamed the planet along with Mac Classic and dinosaurs.

    @cartman82 said in The state of Ubuntu on Windows:

    Tell that to fucking 100 updater services on my system.

    I actually had a peek several weeks ago, when I needed to see something else on my system, and found that apart of a few exceptions (Java?), the fucking 100 update services were actually implemented as Scheduled Tasks. Which is probably the second best smart thing to do, given that there's no such thing as a package repository with centralized package manager on Windows. At least they are not eating the CPU cycles most of the time.

    @blakeyrat said in The state of Ubuntu on Windows:

    If he didn't separate the UI from the program logic in the first place (you know, like shitty incompetent Linux developers generally fail to do), then he's fucked-up long before this becomes an issue.

    I think you're either misinformed or trying to lie in my face.


  • FoxDev

    @wft said in The state of Ubuntu on Windows:

    given that there's no such thing as a package repository with centralized package manager on Windows

    You sure about that? :P

    fucking iframely/youtube thing spoiling the easter egg i was going to leave…


  • Discourse touched me in a no-no place

    @blakeyrat said in The state of Ubuntu on Windows:

    But they aren't TTY devices.

    That's some seriously dickweedy :pendant:ry.


Log in to reply