Swan: Better Linux On Windows

If you are a Linux user that has to use Windows — or even a Windows user that needs some Linux support — Cygwin has long been a great tool for getting things done. It provides a nearly complete Linux toolset. It also provides almost the entire Linux API, so that anything it doesn’t supply can probably be built from source. You can even write code on Windows, compile and test it and (usually) port it over to Linux painlessly.

However, Cygwin’s package management is a little clunky and setting up the GUI environment has always been tricky, especially for new users. A project called Swan aims to make a full-featured X11 Linux environment easy to install on Windows.

The project uses Cygwin along with Xfce for its desktop. Cygwin provides pretty good Windows integration, but Swan also includes extra features. For example, you can make your default browser the Windows browser with a single click. It also includes spm — a package manager for Cygwin that is somewhat easier to use, although it still launches the default package manager to do the work (this isn’t a new idea, by the way).

Here’s a screenshot of Windows 10 (you can see Word running native in the background) with top running in a Bash shell and Thunar (the default file manager for Swan). Notice the panel at the top with the swan icon. You can add things there and there are numerous settings you can access from the swan icon.

Swan is fairly new, so it still has some rough edges, but we like where it is going. The install process is in two parts which doesn’t make sense for something trying to be easier. Admittedly, it is already easier than doing an X11 install with normal Cygwin. However, on at least one test install, the virus scanner erroneously tripped on the wget executable and that caused the install to fail.

The project is hosted on GitHub if you want to examine the source or contribute. Of course, Windows has its own support for Linux now (sort of). Swan isn’t quite a finished product and, like Cygwin, it isn’t a total replacement for Linux. But it is still worth a look on any machine that you use that boots Windows.

81 thoughts on “Swan: Better Linux On Windows

  1. I’d just like to interject for moment. What you’re refering to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

    Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

    There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!

        1. It’s not fake. You are discrediting GNU by using term Linux when referring to the GNU/Linux operating system. Unless you only speak about kernel term Linux is fine, but if you talk about GNU operating system you should use GNU/Linux or GNU plus Linux when referring to the OS. Also it is wrong to say that for example Cygwin provides Linux toolset, it provides GNU toolset as clearly stated on homepage of the project: “…a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.”. People should give more credit to the GNU project.

          1. “Am I discrediting the GNU team when I talk about Linux on my phone (Android)?”
            Read my post one more time, pay close attention to the “Unless you only speak about kernel term Linux is fine, but if you talk about GNU operating system you should use GNU/Linux or GNU plus Linux when referring to the OS.”. Notice the “…if you talk about GNU operating system…”. Nowhere did I state that every operating system containing Linux kernel should have GNU part appended to it, only when you refer to the GNU/Linux operating system, which Al clearly had in mind when writing this article.

          2. I can play the Captain Pedantic game, too.
            “Nowhere did I state that every operating system containing Linux kernel should have GNU part appended to it” should read “…Linux kernel should have GNU part PREpended to it”


        2. It may be copypasta. But it’s still true. The article is terribly inexact. To call a cygwin installation on windows a ‘linux’ is just plain wrong. The main part missing from cygwin compared to a ‘linux’ install is… well… linux itself (i.e. the kernel). Would you call the android runtime running on windows ‘linux’ as well? Of course not!

          Terminology matters for hackers. Get it straight!

    1. IMO, it’s kind of like Lotus insisting MS-DOS was called LOTUS-MS-DOS back in the day, because the system disk DOS files were only a couple of hundred kilobytes and Lotus 123 and utilities filled several more disks.

      1. android is linux, it doesn’t look much like what people usually refer to as “linux”
        cygwin is not linux, it does it’s best so look like what people usually refer to as “linux”

        1. Yah, once again, mistake by HaD author all has us screaming over nothing, because the cygwin tools are Gnu-ier than a Gnu steak sandwich on slices of meatloaf made of ground Gnu.

          Android is linux that has had all Gnu parts replaced by google.

          Should have said something like the Gnu tools commonly found in Gnu/Linux distributions. It’s the distros that need to credit high Gnu content, but the OS is linux.

          1. I think the mistake is that they let people post all this rediculous bullshit. What mistake dit he author make exactly? Not calling something what you want it called but that a lot of people say? You really think all of Cygwin is GNU? What about MIT? What about BSD? What about Trolltech? Can anyone honnestly say: I read this and I was confused? I didn’t know what they meant? English isn’t even my first langauge and I understood what was meant. It strieks me that a lot of the coments are some kind of shill with some kidn of ax to grind. People call something with the linux api that runs tools you common find on linux, linux. If it offends you so maybe you shoudl try writing some kind of imformative content instead of posting stupid comments and detracting from the real conversation here. I would like to know more about this vs cygwin vs microsoft vs MSYS2 vs whatever else is out there. And what about a VM in virtual box? But no, instead half the comments are all boo hoo. Hackaday didn’t do what I want again.

          2. Technically speaking, the os is the distro as it is the whole system. For example, Ubuntu, Linux Mint, Mac, IOS, Android, Windows. You don’t call Windows Windows NT despite it being a distribution of Windows NT, just looked you don’t call Android Android Linux despite it being a distribution of that. The operating system is all of the parts combined to make human usable calls to the hardware and load applications, thus to operate the system.

            Sorry you will never hear me say GNU Linux. Instead if asked what operating system I’m running, I’ll state Arch Linux or Ubuntu or whatever flavor is on my computer operating it at the moment.

    2. Get off my lawn, RMS!

      Although.. you have a valid point, since Cygwin is just the user-space tools using the Windows kernel. In fact, it’s probably more precise to call it GNU by itself than to even call it GNU/Linux, much less just Linux. Al refers to Cygwin as the Linux toolset, API, and environment, and never mentions the kernel itself. While the Linux API (libc et al.), toolset and environment (GNU Bash et al.) are very much GNU, people are used to calling anything with a Bash prompt Linux, not GNU/Linux, and it’s too late to change that momentum.

      It’s the same gripe over the public’s misuse of the term ‘hacker’ when they mean ‘cracker.’ Or the government’s penchant for using cyber as a prefix for anything internet-related, much to the true techie’s chagrin. Trying to correct these evolving language terms is viewed as pedantry by the people that use them, and is ultimately hopeless. If tilting at windmills is your thing, have at it. The fact remains that Al’s prose above, while perhaps not historically accurate to the use of those technical terms, is the commonly used current vernacular, and readers understand his intent.

      1. As Richard Stallman said to me a few years ago:

        “Hey! What are you doing in my bedroom? I’m gonna call the cops!”

        Sorry… I stole that from Randall Munroe.

        Making a copy isn’t the same as making a Xerox. All soda is not “coke” (except in the South, where it is). I’ve heard people making the rant about Linux vs GNU vs… but the fact is, people use the word Linux to mean collection of software that looks like Unix and adheres to the Linux API/ABI to at least some degree. I don’t call my Raspberry Pi, and “Arm-Raspberry Pi” either.

          1. Then you don’t really live in the South. The conversation usually goes something like this:
            “Gimme a Coke.”
            “What kind?”
            “How about a Sprite.”

        1. Not every band-aid is a Band-Aid, not every kleenex is a Kleenex, not every q-tip is a Q-Tip. English has a number of brand names which have become the general term for the item. I have no problem with Linux becoming the next one.

      2. When you say windmills don’t you mean wind turbine generators? Or do you mean wind powered milling machines? I mean you should probably say wind plus a mill if you are referring to the latter and wind add generator if referring to the former.

    3. Even in a basic install of a Linux desktop or server there are all kinds of tools that are neither part of the Linux kernel or part of GNU. For example… I don’t remember X being part of GNU! What makes GNU so special that it just has to get listed as part of the name? Every project being used deserves mention but we can’t have a pages long name!

      Linux (the kernel) technically IS the operating system. The shell tools, startup scripts and all that other stuff while vitally important to making the whole thing useful are not the operating system. They are applications. So.. Linux as a name is just fine. If you just have to have a hyphenated name for the collection of unrelated projects that is a “Linux” distribution then we can call it Humongous Pile of OpenSource Stuff/Linux.

      OTOH Is there even any Linux kernel code in Cygwin? Or just GNU (AND THOUSANDS OF NON GNU) tools packaged up with some libraries to run on Windows?

      Meanwhile I am still eagerly awaiting a fully functional Herd so I can actually try taking GNU for a spin!

      1. Linux (the kernel) is not an operating system. Otherwise I could go to kernel.org, download the latest tarball and boot it. But that won’t happen. The reason why GNU is special and deserves a mention that they were the one who first created fully free operating system. It’s more about the philosophy and software freedom, sadly something that no one seems to care about these days. But of of course software freedom means inconveniences for corporations, how could they spy on you if software you use is free? That’s the reason term Open Source was invented, it promised benefits of collaborative development and software quality, but discarded views of Free software, making it more tolerable for corporations to use.

        Listen to RMS to explain it to you why this is important: https://www.youtube.com/watch?v=Ag1AKIl_2GM

        You can take GNU for a spin right now. Just install GNU/Linux and there you have it. GNU/Hurd won’t be any different to GNU/Linux, you will just be running different kernel, everything else will stay the same.

        1. See my other comment below these comments……

          Linux “can” become an OS in it’s own right (if bodged/hacked-up),
          Though it would likely still need a bootloader.
          However even that could be solved by making the kernel self-booting by having a bootloader+Kernel mash-up copy itself to RAM and jmp into_it; or however you wish to bodge it!

          1. Yah, the light and tight low hardware unbloated versions with busybox etc are fairly gnu free…. back in the day we used Syslinux LILO or loadlin instead of grub anyway.

            Since linux gets faster with lower system requirements the more Gnu you take out of it, it’s getting even more absurd that the bloatware provider is insisting on naming privs.

        2. “Linux (the kernel) is not an operating system”.
          Well what a silly statement. Then what is it?! In what universe do you not call the driver framework, resource management, and application lifetime controller an operating system. It operates the system does it not?
          op·er·at·ing sys·tem
          ˈäpəˌrādiNG ˌsistəm/
          noun: operating system; plural noun: operating systems
          the software that supports a computer’s basic functions, such as scheduling tasks, executing applications, and controlling peripherals.

          “Otherwise I could go to kernel.org, download the latest tarball and boot it.”
          You can, you just need a boot loader. It boots right up. With EFI I guess the boot loader is built right in.
          So I take it Windows is not an operating system? Solaris? So Grub and UEFI Systems are the only operating systems?

          “The reason why GNU is special and deserves a mention that they were the one who first created fully free operating system.”
          They aren’t special, it wasn’t first, and most importantly it is not an operating system.

          “You can take GNU for a spin right now. Just install GNU/Linux and there you have it. GNU/Hurd won’t be any different to GNU/Linux, you will just be running different kernel, everything else will stay the same.”
          Then you will be using GNU applications on the Linux or Hurd operating systems.

          I hope this is troll, if so great job as I am currently looking for ways off this planet in no small part thanks to the incomprehensible ignorance of things just like this. All it takes is a simple google search to show how wrong you are.

          1. “The kernel is a program that constitutes the central core of a computer operating system. It has complete control over everything that occurs in the system.”

            “The kernel is the first part of the operating system to load into memory during booting… ” (you see it says the first part of the operating system, not the system itself) http://www.linfo.org/kernel.html

            “So I take it Windows is not an operating system? Solaris? So Grub and UEFI Systems are the only operating systems?”
            And your point here is? Windows is an operating system, so is Solaris. GRUB is a bootloader and Unified Extensible Firmware Interface is a replacement for BIOS that happens to include the booting capabilities.

            “They aren’t special, it wasn’t first, and most importantly it is not an operating system.”
            From gnu.org:
            “GNU is a Unix-like operating system. That means it is a collection of many programs: applications, libraries, developer tools, even games.”

            “All it takes is a simple google search to show how wrong you are.”
            Indeed it does.

          2. Find me any definition from a reputable source that says an operating system isn’t the base part as mentioned. Everything else is simply an application running on said operating system.

            Why is Windows an operating system and Linux not? Or even more to the point Solaris. Solaris is nearly identical to Linux in every way right down to the name of the programs to manage it’s use.

            None of them can boot themselves without a boot loader. Nor can GNU because it is just a collection of programs. I am mystified why you even used this as some requirement of an operating system.

            Any consortium or group can write what ever ridiculous thing on their website and that doesn’t make it true. GNU is a collection of apps commonly used on the Linux Operating System that provide the same commands and similar command lines to tools found on UNIX systems. Period.

            So I suppose if I replace the GNU apps with Busybox that would make Busybox an operating system?!

          3. Is it really that hard to understand this concept? Linux is just a kernel – a very important piece of the operating system, but it’s not the operating system itself. Take this analogy for example. Kernel is like an engine of a car. You can’t drive around just with engine, you need chassis, wheels, transmission…. It’s same in terms of operating systems and kernels. You can’t have one without the other. Sure you can hack up the kernel to make it boot by itself, but what would be the purpose of that. You might as well run an empty infinite loop on the computer, it would be useless.

            It clearly says in the my first post that: “Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.”. Linux kernel together with GNU system forms a GNU/Linux operating system. Sure you can replace GNU with busybox and you will create Linux + busybox operating system which you can name whatever you want. Problem that I am addressing is people calling GNU/Linux operating system just Linux. You don’t call Android “Linux” now do you? By that logic you should call OS that your phone uses “Linux”. But you don’t. You call it “Android”. Android is an operating system that uses Linux kernel. It is exactly same thing with GNU. GNU is an operating system that uses Linux kernel, forming what is called GNU plus Linux operating system. Or even take Windows for example: Windows is an operating system that uses Windows NT kernel.

            Google search results for “difference between kernel and operating system”:

            Informations about GNU operating system:

            The reason why I even posted the first post is that when people say “Linux” they usually refer to the GNU/Linux system, for example Debian. Most of the time GNU part is omitted, because people like forget about FSF. There needs to be more awareness of their movement, thats why I tell people to call Debian or Ubuntu GNU/Linux and not just Linux, because those are GNU systems with Linux kernel.

    4. So what is it when you have a shell placed instead of a cant_remember_funct_name(“/bin/init”) with a hard-coded FS-driver and mounter all wrapped in the kernel replacing said fn()?

      I’d call that a fully functioning linux OS!!! Or a bodge job DOS clone.

    5. Correct. Even the SWAN site says “GNU/Cygwin Xfce Desktop” because it does not contain Linux but is linux-like. So it isn’t Linux at all.
      If this is Linux, GNU is Unix!

    6. And average Linux user should care because?
      When I tell my non-technical friends that I’m using GNU, they think I’m some kind of pervert. When I tell them I’m using Linux, they still think I’m a pervert, but at least they won’t send PETA to my home…
      For average user Linux can be called “that OS with GUI to display multiple terminals on one screen” or “the one, which has tools named after funny noises you can make with your body” and they wouldn’t really care…

    7. This is like a Turing Test, but to tell if the user is really RMS.

      However, this one is much easier to fail, because the next question is

      “Do you eat your toejams in public?”

    8. +1

      Every single time this issue comes up. Proper credit is so vital in the hacker community, there is no reason to publish anything if you don’t receive credit.

      I will always insist on people getting the credit they deserve.

      As far as I know the WSL provides a Linux compatible kernel interface, but this is really a unix V interface, really it provides everyting other than the Linux kernel.

      Microsoft call is “ubuntu”, in reality it’s just a lightly tweaked GNU distribution.

      Credit where credit is due.

      1. The biggest problem with WSL I’ve found is a complete lack of access to USB devices. Specifically, I’ve been trying to use a YubiKey for SSH auth under windows. Without a working libusb I can’t get ssh-agent to recognize the Yubikey.

    1. I’ve heard about this, but never tried it since I never had a Win10 box until now. I was about to re-install Cygwin, but this (i.e., Ubuntu on Windows) may be a good alternative. Does it come with a full Ubuntu installation (i.e., X11, gcc/g++, etc.)?

      1. I use Bash on windows. Since it does not have a desktop, i start tightvncserver out of bash. On windows i connet to it with a vncviewer. Works fine. Actually linux version on Win is Ubuntu 16.o4 LTE.

    2. Ubuntu on Windows is good but last time I checked did not have an X server. I got it to work with Ming but not the Cygwin X server, so there was something odd (as real unix/linux boxes will work with both servers). Also, UoW (again, last time I checked) only runs on Win10. We aren’t all on Win10, especially on work computers.

      So, again, yes, you can set up X separate using Ming, install the MS/Ubuntu (GNU, BSD, MIT, Joe Frobbin, and everyone else who wants credit) system, but it is more work, especially to get some of the integration that both Cygwin and (by extension) Swan give you.

  2. This would have been really handy about 12 years ago.

    That was a time when I frequently needed to use Windows for one task or another, and also needed the power of a Unix-like environment nearby in a package that didn’t lighten the wallet that adding an Apple logo would do.

    Instead, I struggled along, and worked harder to eliminating the need for Windows.

    I pretty much have achieved that. Yes, I have a laptop at work that dual-boots Windows 7, but it gets booted into that maybe once every few months, if that. Everything I do at work and at home now is done in Linux. My next laptop will likely be bought with the intent of running Linux only.

    The idea of Ubuntu on Windows, Swan and improvements to Cygwin are welcome, but too late.

    1. Well, I am glad you are able to eliminate Windows from your life. I don’t think I can. At least on computers, Linux is lacking in user friendliness. I have had so many headaches with it. I still use it every day, but sometimes I just throw up my hands and boot into Windows to get a simple task done it was taking hours to troubleshoot in Linux.

      1. I guess for me it’s the reverse. I find Windows lacking in user friendliness.

        On a Gentoo system, which is far from the easiest to use, I run emerge libreoffice, a bit of compiling later and I have an office suite. Binary distributions like Debian and Red Hat are even easier. In fact, the latter two often ship with one.

        The Windows equivalent is to open up the web browser, type http://www.libreoffice.org/, find the download link, click it, let it download, turn off the antivirus so it doesn’t interfere with the install, run the installer (as an administrator), go through the “installation wizard” … then I have an office suite.

        On Linux, all packages are cryptographically hashed and the hashes digitally signed by the vendor. It is verified on download before install. Windows, I’m never sure if the file I’ve gotten is what the vendor intended, been corrupted accidentally by line noise, or deliberately manipulated.

        Linux and Unix you can get by with a basic intrusion detection system. Windows you need to pay megabucks for a fancy one that does real-time detection and disinfecting, and steals significant amounts of CPU time and RAM to do so.

        Then there’s the OEM installs, which you spend about 3 hours un-installing all the un-wanted crap. Or if you decide to install it yourself, you spend a good day figuring out where to get the drivers from.

        My last laptop, Linux JustWorked™.

        I guess it all boils down to what you’re used to. If you’ve been using Windows all these years, I can understand that something different looks hard.

        For me, Windows is the pariah. I started with DOS, moved to Windows 95, then soon after, started with Linux. I can move between Linux, *BSD, Solaris, SCO, etc, without much trouble. Even MacOS X does not present a significant issue. Windows is the one that stands out as “different”, and the one I find hard.

        It is the one that refused to talk to anything else properly. File sharing between Linux and SCO? Use NFS, job done, works out-of-the-box. Windows? Naah!

        Microsoft’s saving grace here is that Windows became popular with suits, because it ran on IBM PCs back in the day, and IBM have been around in business circles for over 100 years. Had IBM signed up with Digital Research, things would look very different today.

        1. I agree. Linux was a problem to get working 15 years ago, not any more. Now whenever I use Windows it lacks this or that, and almost everything needs to be installed later, instead of coming with the system as in Linux. Strangely even Windows back compatibility is poor, so I can’t run some old Win games anymore on Win 10. All in all Win is a waste of time nowadays.

      2. Most of the perceived lack of user friendliness in Linux is really user familiarity with Windows.

        If you objectively look at both, they’re pretty similar (depending on distro/window manager, some are tricky). For every “editing config files is hard” complaint on Linux, there’s a “the registry is painful” corollary for Windows. And 95% of users will never have to do either…

        Windows has certainly upped their game since XP though, gotta give them credit.

        1. “Windows has certainly upped their game since XP though, gotta give them credit.”

          Removing configuration dialogue boxes that can be moved around a 1960×1200 LCD without distracting the web browser, the word doc and the other dialog boxes.

          In Windows 10, I find it easier to copy/paste registry settings out of my custom registry settings dumping ground (a text annotated text file containing the settings) than trying to work out why windows update suddenly kicked in inconveniently on a testrig, then loosing that 3+ clicks deep web-page-like XML abomination (or whatever number of clicks the update changes it to) all just because I needed to change the Video output settings (on a laptop that only sees daylight on the monthly 42″ monitor TRIAGE).

          It seems configurability has gone downhill since Vista and became unbearable in W8x, Windows 10… forget about configuration because Macro$haft knows you like default settings after every update unless you tell them otherwise by logging in all the time with a traceable telemetry tied E-mail (thus making stolen laptops all the more vulnerable)

  3. Im supprised no one has mentioned MSYS2
    Which seems to be a common replacement for cygwin these days on windows
    It already has a package management system pacman
    Which makes install very easy. Also i wouldnt be supprised to find it has more packages available if its been around a lot longer

  4. All these people thinking terminology is not important in here! It’s painful to watch. It’s like my mother calling the monitor ‘the computer’ and thinking she turned it off by turring off the screen.

    Cygwin *does not contain linux* so it is nonsensical to call it linux. I can understand you use ‘linux’ as a shorthand for GNU/linux . Everybody does it and it’s clear what you mean. But calling cygwin ‘linux’ is nonsense. It’s like calling BSD ‘linux’. Or OSX for that matter. Ubuntu on windows is not ‘linux’ either.

    Come on people. I expect better of the hardware hacking community.

    Also: credit where credit is due. I know it has become fashionable to hate on RMS and the FSF, but without them we would probably not have an open source ecosystem at all.

    1. No, it isn’t Linux… it doesn’t even use glibc, it uses an alternate C library called newlib.

      However, a Linux-like experience is what it aims to bring to Windows.

      As for the Free Software Foundation… if it weren’t for them, we’d be running BSD probably.

      1. BSD was (is? I haven’t used BSD in a while) *very* dependent on the GNU stuff. GCC is the main reason open source got off the ground at all. One would hope some other group would have written an open source compiler if the FSF hadn’t done it, but it is by no means sure. At the time lots of people though the task of writing a compiler was too complex for a ‘hobbyist’ project.

        Know your history people, or the same mistakes will be made again and again.

  5. Hmmm, I suppose that’s one way. I just VNC into the Linux VM on the server while still using Windows on the main machine. Both hardware and software are pretty cheap these days.

  6. I just decided to let arch live entirely on my SSD, used to dual boot but converted Windows 10 into a virtual hard drive file and keep that on the arch linux partition at /Windows10/vmdk_files_here

    Then have a 1TB hard drive that has 60GB for Windows vm userfiles, configs and the rest is for any GNU/Linux (Arch) User’s home directories and files.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.