BoUoW: Bash on Ubuntu on Windows

bash_tuxsay_uobow_sysinfo
Tux is telling you the most current Ubuntu running for Windows for BoUoW.

I am not proud of possibly inventing the ugly acronym “BOUOW”, but “BASH on Ubuntu on Windows” appears to compel it. Maybe we can pronounce it “bow-wow” — not sure if that’s complementary. Just did a Google search, and, no, as predicted I couldn’t have invented it: It is variously acronymed: B.O.U.O.W., or BoUoW. It has been around since at least March of 2016, giving end users, computer geeks, and developers plenty of time to come up with something of a nickname or acronym.

But I actually mean to praise BoUoW, and to give it considerably high praise. This is a brave move on Microsoft’s part, and a long time coming. MS has made *NIX access available in its kernel for some time now, thus making *NIX conventions possible on the command line like certain commands in the Power Shell. The user has to enable the capability in the Windows 10 settings (“Windows Subsystem for Linux” (WSL)), and as Admin, the kernel has to be set to “Developer mode”, and follow the instructions on the MSDN website to download binaries and to enable a bash shell on either the command line or PowerShell.

BoUoW takes advantage of the WSL to do impressive things like use the same network stack as Windows 10 itself. This is because with WSL enabled, a UNIX command such as SSH can now make calls directly to the Windows 10 kernel to access the network stack.

This is, by Microsoft’s admission, a work in progress. It would worry me if they would not have said that. But lots of things do work. vi works and is symlinked (or somehow aliased) to vim. The bash shell comes with some other common aliases like “ll” for “ls -l”, for instance, and apparently, as part of the installation, you actually have a miniature version of Ubuntu, complete with a C compiler, and an image of Ruby, Perl, Python, and if it isn’t installed, you can always use “apt-get” to install it.

One of the security features has the disadvantage of conducting an install of BoUoW separately for each user. If a user types “bash” in a cmd window, and if BoUoW is not installed for that user, the install happens all over again, and the image goes under each user’s AppData directory requesting a BoUoW install. If you are using an SSD for C: drive like me, then you might find that limiting due to a shortage of space.

There are many things not recommended yet. If you are a serious web developer, for example, you would find many of the things you want, such as mySQL, are not currently working the right way. If you are a systems programmer, then you’ll find that ps and top only work for unix-like commands, so I wouldn’t use BoUoW for any serious process management. That being said, it does contain the old standbys: grep, sed, and awk.

gcc_output_uobow
The compiling and output of my “Hello, world!” program, also showing the source code.

gcc had to be installed separately. The binary it created for my “Hello, world!” program lacks the Microsoft .exe extension. And as it is for Unix binaries, it lacks any default extension. It is using gcc version 4.8.4. The current version is 6.3. This older gcc usually won’t pose a problem for most users.

The current stable Ubuntu is 16.04. BoUoW uses the previous stable version, 14.04, and thus has slightly older versions of Perl (5.18), Python (2.7.6), bash (4.3.11), Ruby (1.8) (available using apt-get), vim (7.4), and other software. Vim, however, appears to be the “large” version, which is expandable, using plugins like Vundle, which is good news. I don’t suspect that these slightly older versions would cause anyone problems, except possibly for Python, which has gone all the way up to version 3.5.2 since. You are warned also that it is possible that under Python or Perl, you might run into problems due to not all of their libraries running correctly under BoUoW. Not surprising, since Python has hundreds of installable libraries and Perl has thousands of them. Could take a while.

 

Cygwin has come a long way … A story in animated GIFs

cygwin_setup
Search is handy for adding new packages to your installation.

First of all, let me say that there is some currency to what the title and pictures imply.

Cygwin/X really has come a long way.  10 years ago, the only viable way to run Cygwin was through a DOS-style UNIX shell. The windows system Cygwin/X provided, such as it was, was  mostly TWM, a primitive window manager which  I used to use, which ran the core programs in the X-Windows distribution. Most  of what came with Cygwin,  such as Gnome or KDE, never worked for me, making me an FVWM2 fan for a long time. Along the way, I appreciated  that while FVWM2 was very stripped-down, it made up for it in flexibility and configurability. Even now, FVWM2 is quite liveable.

cygwin_wait
Postinstall scripts can be a bit of a wait.

I decided yesterday to upgrade Cygwin on one of my older computers,  and after working past some glitches in installation, found that:

  1. If you have your guard down, you may still install packages you hadn’t intended, particularly the TeX language packs for languages and alphabet systems that you know you will never use. Minutes can turn to hours with postinstall scripts running trying to configure these redundant packages.
  2. hacking_keys
    I had this idea of moving my old Cygwin installation to another drive; and it was then I discovered a thicket of permission problems that I had to untangle. This took a lot of work.

    Mate is recent addition to Cygwin, and actually works on my slow system in 2016. In fact, I am using the Midori web browser to edit this blog under Mate in Cygwin/X.

  3. GIMP was once a graphics program you had to compile; now it is intallable for Cygwin as its own package.
  4. When moving my old
    vim_install_github
    Github is the place for a lot of things to round out Cygwin. I was using it to clone source code remotely, then compile and install.

    distribution to another drive, I found a ton of permision problems which were caused by compiling the source for various downloaded code  as another user – not the owner of the directory.

  5. I now have a good system, with much more functionality than ever before. Cygwin has gone from a system that was “mostly broken” to “mostly working” in the space of 10 or so years.green_ninja

Pet peeves about the Windows Registry

The MS-Windows registry has been around since version 3.1, and has probably been a constant in the Windows NT world. It is designed to thrive in multi-user environments because of its system of hives, which guarantee that each user can use the same application with individualized settings. This is in contrast to having each application save its settings in an INI file, which is only ideal for one user. Backing up a registry out of a single known folder is better than backing up many disparate INI files scattered all over your hard drive.

But I have many pet peeves about the registry, all extending from the idea that its biggest strengths are also its biggest weakeness. I am usually the sole user of my computers and laptops, so this idea of multi-user environments is lost on me, and probably most people outside of sysadmins in large organizations. The thought of having centrally-located hives for backups appeals to me, though, but I usually end up taking my chances on not backing it up. I only seldom edit the registry by hand, and there are registry cleaners such as ccleaner that do the job with greater efficiency. I currently have five computers at home, and after three years, I haven’t had a corrupt registry yet. But I do remember having to back up INI files back in the day. Indeed, they have a point. The fact that I haven’t backed up the registry is slothful on my part, but it would have had the same effect, albeit with greater efficiency.

But with this single location for a fixed number of registry files comes the cost of having to load it in memory. With INI files, the only configs that load in memory pertain only to the program(s) you are running. With the registry, the whole bloody hive loads into RAM at boot time. All configs for all applications all at once. This leads to a lot of people complaining of slow responses due to bloated registries. It is not seen as that big a problem, since nowadays just about everybody uses more than 1 gig of RAM on their PCs and laptops. Ideally, that should speed up the startup of programs.

If the Windows installation became corrupted, the answer was as it is now, to re-install. When there were INI files, it wasn’t necessary to reinstall programs since their configurations were normally intact. All you needed was to reinstall windows and everything was normal. With the reigistry, unless you had a backup (and even then), you needed to reinstall all of your programs as well, since they are tied to a single, central registry. If the INI files were not corrupt (the only problem residing under C:\WINDOWS), it wasn’t necessary to restore INIs from backup.

Those are mostly my gripes about the registry, but there is one more, regarding the fact that the registry poses a big fat, centralized target for viruses and malicious software.

Sequel: Installing MS Windows with the patience of a saint …

This is the conclusion of my ordeal with a defective TouchSmart TM2 laptop, bought as new very recently.

There has since been a series of repairs precipitated by the fact that the laptop bluescreened during the installation of the factory image. The moment that happened, I sent it back again. Since then, a new hard drive was installed with a fresh factory image. It has since survived all updates I’ve thrown at it, including various and sundry software installations.

What frustrated me was that I didn’t get the minimal image which would have obviated all of the crapware on this machine. Instead, I got the normal install with the crapware and all of the unregistered games, which meant that I spent the next few days removing all of that stuff.

It has certainly survived one of the torture tests, which consists of sitting on my desk and doing nothing while switched on for a few hours. Previously, it would bluescreen almost certainly that way. Now, it never seems to. It is now within probability that I could actually use it to complete a task or two in the future, who knows?

About the previous blog entry

That entry the other day was somewhat in the form of a log. A blog entry that is a log. Imagine that.

Earlier this week, I decided to document the rescuing of my TouchSmart TM2 laptop from oblivion. It has nothing except the basic operating system installed, and it seems to give me the BSOD if I do things to it that in the laptop’s opinion is too much for it’s endurance. Such as running Microsoft Update. Such as letting it sit on my desk for a couple of hours, running while I made breakfast or something. I haven’t tried to install a single piece of any other software, just the OS.

I have certainly learned the power of good documentation from this exercise. The BSOD errors were many and varied. I rolled back the installation every time I saw one, or looked up the error code if the blue screen was on long enough. Things just seemed to get worse and worse. At one point, even doing a minimal install gave me a BSOD, and as a result, an incomplete install. At that point, I sent it, still under warranty, to an authorized repair depot, and even told them to try the install themselves (since they seem to stick to their guns about it being a “software issue”, when the only software is coming solely from the factory image). This will cost me $69.00 (plus extra costs to run MS Update), but I am pretty confident that they won’t make it past the SP1 installation, unless they really investigate the hardware beyond disk and memory. If it crashes on me again as a result of sitting on my desk or something, I am going to demand a refund (which I think will be coming from HP, which might be an issue).

The Windows’ AVI File of Death

I swear to God, my Windows XP installation is haunted.

On my storage drive, I have an AVI file I made that is possessed. It clearly is letting me know that it doesn’t like me.

If I click on it, Winndows Explorer crashes without explanation. If I click on a different file, then press the down arrow to highlight the file in an attempt to delete it, it crashes again, when I press delete. Then it doesn’t delete. Also, hovering the mouse over the file is fatal to Explorer.

Running Cygwin as administrator and deleting the file through the command line fixed it.

Too cheap to upgrade Win 7 HE to Win 7 Pro

I have a couple of computers running Windows 7 Home Edition and found the need recently to run remote desktop. I had found after looking around at the MS website that “I can’t get there from here”. That is, remote desktop is not a feature for HE, but is present if I upgrade. The person on the website did mention an alternative to Remote Desktop, and that was TeamViewer, which is free for non-commercial use.

On the plus side, I was able to run the program just as downloaded from the website without installation. Even better, I was even able to run the same copy of the program individually from both ends of the connection.

It seems to do the job, for sure. But I’m surprised at its slowness. At default resolution (which at 256 colors is not that great), windows move around slowly over my 10+Mbps lan connection (oh yeah, I forgot that the remote computer is connected using Wi-Fi). The speed improves slightly if you use TeamViewer to disable Aero. I may have to live with the slow speed due to the rather necessary Wi-Fi issue.

Features I have no use for, but may interest some are its ability to record a session on the remote connection. There seems to be also menu options for conference calls and VOIP. For myself, I ‘m just glad that I can view my desktop from another room and multitask in my home office, rather than having to go back and forth between two rooms (except to initiate the connection, which requires the remote computer and the local computer to run the program).

This kind of thing is intended for help desks, but I find it useful if I want to download and store certain kinds of files on particular computers, such as EMusic downloads, which are better off being stored on the same computer as my home theatre. Or download email from my ISP, which I keep on one computer, and not my laptop.