Cygwin

When you need a consistent scripting platform in a heterogeneous data center, Cygwin delivers.
Cygwin

If you've never heard of Cygwin, you're in for a treat. I've used it for years to homogenize my environments into one where I can write scripts once and deliver them everywhere for consistent automation solutions. It's a pain to write bash scripts that work on Linux, on Macs, and on commercial Unices, and then have to jump headlong into PowerShell and batch files to attempt to match the level of automation that I can achieve with some Bash scripting.

5 Installing Cygwin and Starting the SSH Daemon. This chapter explains how to install Cygwin and start the SSH daemon on Microsoft Windows hosts. This chapter is applicable only when you want to install a Management Agent on a Microsoft Windows host, using the Add Host Targets Wizard or EM CLI. Jan 02, 2019 Note: Cygwin uses a magic cookie to identify symlinks. To have Cygwin create symlinks that can be followed from WSL, create an environment variable CYGWIN and set the value to winsymlinks:native. Cygwin's MinGW-w64 compiler is a cross-compiler, because it's hosted on Cygwin but targeting MinGW-w64. You just need to tell configure about it using the -target option, like so: -target=x8664-w64-mingw32. That way, make will be invoking the appropriate tools.

  1. Cygwin Setup will start downloading the necessary files for the installation. There are a lot of files in the base Cygwin install, so it may take awhile to finish. Select if you would like to create icons on the Desktop and/or Start Menu, then click the Finish button.
  2. B.3.1.4 Using gawk In The Cygwin Environment. Gawk can be built and used “out of the box” under MS-Windows if you are using the Cygwin environment. This environment provides an excellent simulation of GNU/Linux, using Bash, GCC, GNU Make, and other GNU programs. Compilation and installation for Cygwin is the same as for a Unix system.

Cygwin Commands

According to the website, Cygwin is:

  • A large collection of GNU and Open Source tools that provide functionality similar to a Linux distribution on Windows.
  • A DLL (cygwin1.dll) which provides substantial POSIX API functionality.

And it is not:

Cygwin Ssh

Cygwin
  • A way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
  • A way to magically make native Windows apps aware of UNIX® functionality like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.

Note: Cygwin works equally well on Windows desktops and on server systems.

Why Cygwin?

Cygwin is still relevant if you wish to have native *nix commands available to you on the Windows platform. Yes, I know about Windows Subsystem for Linux (WSL), but Cygwin and WSL aren't the same. Cygwin gives you the power of *nix commands in your native Windows environment. There's no emulation, no virtual machine, and no extra layers between the operating system and this collection of utilities. They are, in fact, authentic open source commands compiled for the Windows platform.

Linux Containers

Installing Cygwin

Generally, you can accept the default option for each prompt. I provide guidance when there are choices to be made. You can select your own, but I've found that these selections work best in my environments and for the way I work.

Open a browser on your Windows system and point it to the Cygwin web site. Select the Install Cygwin by running setup-x86_64.exelink to download the setup executable file. Run the executable file to begin the installation and click Next on the Cygwin Setup screen.

Cygwin Mirror

On the Choose Installation Type screen, select the type of installation you want. For myself, I always select the default, which is Install from Internet.