62 comments

[ 3.3 ms ] story [ 116 ms ] thread
What's the appeal of using a Windows host?
Maybe you ship a software product to windows, and wish to test it.
Lots of video game tools/middleware work only on Windows, and only recently other platforms have been considered like OSX, Linux, and others.

AFAIK for OSX the only legal option is colocation - e.g. you provide an actual OSX machine, and it's installed for you somewhere for your use or your team (I'm actually not completely sure there).

I'm talking about OSX, since lots of these tools above are released for Windows and OSX, but not for Linux (yet).

.net developers find appeal in it.
I've posted about video game tools, but one important non-video games related tooling is the visual studio compiler, linker and the whole plethora of tools there.

So if you are Mozilla and want your browser to get recompiled for Windows you might use such a service (I don't actually know whether Mozilla is doing this, just giving an idea)

It's not #1 on HN because no one cares.
(comment deleted)
I can use my my laptop's GPU properly, for starters.
Nicely integrated infrastructure? AD integration etc?

Lack of choice to. Which sounds bad but can be good. For example Linux you have lots of webservers Apache. Nginx, tomcat all with different config methods.

Windows? Add the web server role, use iis and be done with it.

> Lack of choice to[o].

You can run Apache and Tomcat on windows if you so choose. You can even run nginx (albeit on top of Cygwin) [0].

You also don't need IIS to run HTTP endpoints. That said, IIS7+ is a pretty nice web server (I speak from experience as a shared web hoster ops and dev person). It's got a plethora of knobs and dials for tuning and is extensible (via native or managed code modules and handlers). But as always, horses for courses and all that.

[0]: http://kevinworthington.com/nginx-for-windows/

I'm not saying you can't run it. It's just that IIS is the default.
(comment deleted)
Why the fuck do you need AD in a container that is supposed to be only running a single process? Consider your code quality is shit and overly complex.
Outside of SV, a significant portion of the world, including most enterprises, run Windows in at least some capacity.
So there are windowsservercore containers. Are they real windows? Can I run them also from Linux?
Containers are not VMs despite often being used as such.

Windows will not run Linux-containers and Windows-containers will not run on Linux, just like the same restriction applies the other way around.

A container typically runs with the same kernel as the host, and therefore is restricted to be the same type of operating-system.

Thanks! I'm really curious what a Windows container is capable of. Many Windows programs are dependent on GUIs. I can imagine that Windows containers are a great testing platform. Let's see what else is possible.
They're for headless services...
Almost the entirety of ASP.NET and Windows Web Programming can be run headlessly.

StackOverflow is entirely built on top of Windows and .NET. Its not necessarily an inefficient platform, despite Window's reputation.

Isn't it supposed to work with Docker ? I thought Docker was *nix only ?
Docker isn't *nix only, MS and Docker have ported it to Windows 10 and Server 2016. You're able to use the same API between the various Docker hosts, but the binary compatibility is much the same as that between Linux and OS X versions of Docker.
What the hell do people not understand about containers?! They are not virtualization. They're just regular damn processes running on the kernel. So no, of course not.
> So there are windowsservercore containers. Are they real windows?

"Server Core is a minimal server installation option for computers running on the Windows Server 2008 R2 operating system. Server Core provides a low-maintenance environment capable of providing core server roles"

Basically server core is stripped down version of windows without a GUI[1] that will run most server roles, Powershell etc.

1. Well it kind of has a GUI, but one that is only capable of running cmd.exe and little else.

Yes, let's just download this massive powershell script over http. Great idea.
Don't understand the downvotes, it really should have been https
Arnt these things signed? Powershell has signing capability to verfiy the author is ms.
What if an exploit is found in the signed copy? Someone else can host the old version which is still signed and supply it to the user. Are they going to revoke the certificate used to sign it entirely?! Not using HTTPS is a sloppy security practice on their side.
Linux packages are signed and commonly served over HTTP by various mirrors. How is this any different?
They are versioned, of course. You will have to explicitly agree to a downgrade.
Ideally, you'd want them to use HTTPS to deliver the packages as well. However, I cut free software distribution some slack, because of massive distributed mirroring and delivery by a number of third parties. For Microsoft, it would be easy: why _not_ use HTTPS and get another line of defense?

(update: revelation's comment is insightful; just saw it. I forgot about versioning.)

The host actually responds with a 301 that redirects you to:

https://raw.githubusercontent.com/Microsoft/Virtualization-D...

If you're worried just enter the above instead, fully HTTPS-ed. Invoke-WebRequest (aliased to wget in this example) follows 301 links unless told not to, so you're actually downloading the script over HTTPS all the time, but someone could still MITM the link shortening service.

As you note, the redirect breaks all benefits of HTTPS. That can just be trivially stripped.

Powershell, in any case, allows for scripts to be signed. Since the script in question is semi-auto-generated in any case, they should just include that as a step in the build. But serving unsigned scripts over HTTP is just beyond the pale.

    catch 
    {
        Write-Error $_
    }
Powershell is fairly new... I'm surprised Microsoft is using `$_` instead of the common (in UNIX) `$?` to represent the current value in the pipe. It's almost like they go out of their way to not conform to anything other OS' have already done.
Conforms to Perl as "default argument".
Hmm, I didn't realize that (not a Perl guy obviously). Even so, Perl isn't a shell, it's a runtime/language. Whereas powershell is, a shell. I would have expected it to be more UNIX-like in that regard.
Powershell is a shell and a fully-fledged language. In that way it is considerably more advanced than bash/sh/csh/ksh/etc.
Are you saying that /bin/sh isn't turing complete?
Not at all. What I'm saying is that /bin/sh has idiosyncratic, incomplete language syntax and semantics (mostly for historical reasons). For example, variable comparison is not built in but rather is dependent upon the external [ (or test). It would be hard to call a language 'complete' when it doesn't even support variable equality testing.

Whatever you think of Windows/MS/etc, Powershell is a decently-well-designed, complete language with a number of useful, convenient constructs. For example, here is a native Powershell hashmap (that can be looped over, etc.):

  $states = @{"Washington" = "Olympia"; "Oregon" = "Salem"; California = "Sacramento"}
Nice, no?
Powershell has lots of cool features, startup-time not being one of it. It's very important for some of these scripts to start in a matter of milliseconds.
Powershell starts pretty immediately for me. Older versions chugged, but testing on my desktop and laptop opened pretty much instantaneously.
Then I need to try it out again. After months of working only with Linux, OSX - I miss a bit the good ole NT :) - Far Manager, System Internal tools, WinDBG, etc.
> Whereas powershell is, a shell. I would have expected it to be more UNIX-like in that regard.

Well they don't adhere to Unix because they're trying to be better.

Pipes pass _objects_ around in Powershell, and the entirety of .NET libraries is available for use in Powershell... including plugins and everything.

http://www.tomsitpro.com/articles/powershell-piping-filterin...

New Microsoft features are available too, like V-Server integration, Package Management through Chocolatey and so forth.

I am not exactly a Powershell guru, but its definitely evolving in a way superior to BASH scripting. I mean seriously, BASH is so backwards that I can't imagine why ANYONE would seriously recommend taking cues from it.

http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.htm...

Bash isn't the end-all of Unix shells.
No, but it seems people nowadays (young users that equate GNU/Linux == UNIX) only know bash.
I have played with ksh and others.

But when it comes down to writing something that others use, you can almost always rely on BASH being installed on their machine.

The other shells... not so much. I hear zsh is pretty good though.

I was more referring to the likes of es, rc and Inferno sh. The rest are all just variants of Bourne or C shell in some way, and even then Bourne and C don't have much in the way of compelling differences.
Again, it's not an exit code or return value, it's an _argument_ to the catch block.
>Whereas powershell is, a shell

Hmmm.....I think PowerShell blurs the line between shell and full blown programming environment (as in I can build complete WinForms apps in PowerShell).

Which UNIX-like?

sh, bash, zsh, korn shell,....

PS has $? (it's a boolean though) but I don't follow your comment. $? in Bash isn't comparable to $_ in PS at all, is it?
I understand what you're referring to about Powershell ($_ being the current value in the pipe), but what are you referring to by:

> instead of the common (in UNIX) `$?` to represent the current value in the pipe.

Is that common in UNIX? Can you give an example?

docker images

  REPOSITORY         TAG          IMAGE ID      CREATED       VIRTUAL SIZE
  windowsservercore  latest       9eca9231f4d4  30 hours ago  9.613 GB
  windowsservercore  10.0.10254.0 9eca9231f4d4  30 hours ago  9.613 GB
vs

  REPOSITORY         TAG          IMAGE ID      CREATED       VIRTUAL SIZE
  alpine             latest       31f630c65071  9 weeks ago   5.254 MB

Aren't containers supposed to be small(er)?
Don’t worry. This is an early build and you’ll see things get smaller in future updates :).

*I work for Microsoft on these specifically.

Is this going to be through use of nano server for the container images I guess? Or something you cannot yet share.
No, they aren't supposed to be anything.

Docker added this concept of a "graphdriver" where things are stored as their delta on disk as they assume you'll use many of them. Obviously your first windows container is gonna use up more blocks in that type of storage than a linux container built specifically to be small[0]

[0]: http://gliderlabs.viewdocs.io/docker-alpine/