ubuntu bash now in windows 10…?

There’s a little-known feature now in Windows 10 which is a fairly awesome piece if you know Linux/Ubuntu and, say, you’re a coder. Microsoft and Canonical got together to add an Ubuntu on Windows subsystem in the 14393.0 “Anniversary Update” OS Build.

The feature is also called the Windows Subsystem for Linux. What’s interesting is that from bash you can actually invoke a Windows executable or one compiled for Ubuntu. It can run DOS batch files as well as shell scripts.

  1. Turn on Developer Mode in Windows 10 -> Settings -> Update & Security -> For developers
  2. Turn on the Windows Subsystem for Linux (Beta) in Windows 10 -> search for “Turn Windows features” -> select Turn Windows features on or off
  3. Restart Windows 10
  4. Go to a command prompt
  5. Enter bash and type a y to continue, noting that this step will take about 20 minutes
  6. When finally prompted, enter a UNIX username (it’s case-sensitive) and a password (again, case-sensitive) which are completely separate from your other credentials

From this point you can run an Ubuntu bash prompt either from the added Start entry or by entering bash in an MS-DOS or PowerShell prompt.

Notes

  • It’s probably not a good idea to use Notepad or similar Windows tools to edit configuration files within the Ubuntu space.
  • You should be able to sudo from this first user as you might expect.
  • Once logged in, you’ll land in a /mnt/c/Users/username location from a Unix perspective.
  • Since the OS is Ubuntu, you would run sudo apt-get update to install things.
  • If you want to invoke Windows executables from a bash session, you probably want to start by adding the SYSTEM32 folder to your path, for example: export PATH=$PATH:/mnt/c/Windows/System32 but since this is UNIX you’ll need to make sure that the capitalization is right for each path.
  • Run lsb_release -a if you’d like to see which release of Ubuntu is running.
  • In theory, you could run bash scripts within a PowerShell script.
  • At this time, it does not support GUI applications.

windows 10 from vm on ubuntu

If you’ve been reading my blog for any time whatsoever, you know that I have been irritated with Microsoft lately. I purchased a new HP laptop with Windows 8, upgraded it immediately to 8.1 Pro and then took advantage of the free upgrade to Windows 10 Pro.

Things seem to work out okay for a bit. I must admit my frustration at Microsoft for trying to be just like Apple. The Microsoft Store mentality, the logging in via Internet-based credentials rather than local credentials, the inability to innovate rather than to just copy. It’s a little sad, actually. There was a time when Microsoft led the industry and now they can’t make a move unless they’re mimicking something that Apple’s already done.

And yet, Microsoft is still the leader in business applications for the moment.

Ubuntu 16.04 LTS

After some ugly automated update that left my laptop is a non-working status, I decided after three months of this that I needed something else. I reformatted the hard drive completely and installed the free operating system Ubuntu Desktop. It’s nearly bullet-proof at this point. There is a manageable glitch regarding the ethernet adapter after a Restart but I’ve got a work-around. (And I’ve installed it on many other computers without this issue—it seems to be related to the wi-fi adapter only.)

Virtual Machine Manager

I was playing around with its features today and remembered that it includes a working VM solution. You can create a virtual machine, spin it up and run it from Ubuntu. I wondered if I could then run Windows 10 Pro again in a VM session on this same laptop.

WindowsOnUbuntu

Windows 10 Pro in a Virtual Machine

Why yes I can. (As in “been there, done that”.) The actual download of the ISO image of Windows 10 took more time than the actual installation itself. Here’s the overview of that install.

  1. Download an ISO image for Windows 10 and indicate your language choice
  2. In Ubuntu, select the Search item and look for Virtual Machine, selecting Virtual Machine Manager
  3. Create a new virtual machine, selecting the ISO file from the first step
  4. Give it at least 20248 RAM and at least 16GB hard drive space (I initially selected 3072 and 80 for these)
  5. Go with the defaults and give your VM a name, I chose Win10Pro for this
  6. Watch it go through the standard Windows 10 Pro installation and at the Product Key entry screen choose the option to do that later
  7. It will quickly run through the installation (much faster than it normally would or so it would seem)

Activating It On-the-Cheap

I followed the prompts afterwards to see what Microsoft wanted to charge on their Store for a legitimate Product Key. Microsoft wanted $199.99 for this.

So I searched on Google for anything less than this and wasn’t disappointed. eCrater just sold me the same thing for $10. They provided the Product Key, I entered it in and it’s now activated without any hassle.

Oddities

Since this is one of my first forays into VM on Ubuntu, I’ll note a couple of strange things which I saw.

  • Choosing the full-screen option seems to select a more squarish/middle part of the laptop’s screen rather than using its entirety.  I will likely have to research this or just ignore it.
  • Once in full-screen mode it’s not apparent how one gets out of that and back to Ubuntu.  It looks like pressing Ctl-Alt may bring down an upper menu. I’ve also heard that Ctl-Alt-F seems to toggle the cursor out of the VM window’s control. I was ultimately able to toggle from full-screen AND be able to move the cursor from its window, (a major breakthrough).

That said, I was able to finish up a session running Windows 10 Pro and then within that window, shut it down as you might normally do. The Virtual Machine Manager then informed me that this VM was down.  It’s possible then to alter the VM’s device settings, say, to change the available amount of RAM.

And the next time I need Windows, I can just spin up the virtual machine image again. I’m thinking that this is better than multi-booting, as I’ve done in the past. (I’m looking at my dual-boot MacBook with Ubuntu on it.)

Believe It Or Not…

The original Windows 10 Pro networking bug isn’t seen in this Windows-on-Ubuntu setup. It actually works… better?

I guess I’ll need to use it more to find out but it somehow seems faster than I remember. How is that even possible? Before, the native-mode Windows 10 Pro had access to all 6MB of RAM and now, it has only 3MB. Granted, I haven’t tried to run several programs at once on it and I haven’t installed Office 365, for example. We’ll see. I’ll keep an eye on it and let you know.

windows 10 sucks balls

Seriously. So today’s saga ends with me giving up on my relatively-new Windows 10—based laptop as just a lost cause. Since around November, it’s had its microprocessor firmly stuffed up its I/O port.

The Symptoms

The symptoms began about the same time. The Mail app just failed to sync: no new email.

Further troubleshooting suggested that the wi-fi adapter wasn’t consistently connecting to my own zone and not that of one of my neighbors. Tracking down the correct settings allowed me to definitely not connect to that other zone. Although that worked, still no resolution of the problem.

I thought updating might help. Unfortunately, Windows Update thought that it wasn’t connected to the Internet so I couldn’t update. I could browse the Internet with my browser but it just didn’t think that I was connected to the Internet.

The Attempts

I tried using only the wi-fi. I tried using only an Ethernet connection. Same result.

I tried opening an administrative MS-DOS console and entering a variety of terse commands in an effort to clear my DNS cache, reset my IP adapter’s DHCP lease, reset the WINS catalog, you-name-it.

I tried rebooting. Oh yeah, I rebooted the fuck out of that thing. Still, no-go.

I wanted to adjust the network’s location so that instead of thinking that I’m in a public space, it would know that I’m in a private place. But since it thinks I’m not connected, you can’t do that.

The Research

It turns out that I’m not the only one experiencing this. Almost 70,000 viewers on one Microsoft help page alone and thousands of participants in the discussion. Keep in mind that a subset of the users think that this is an email problem, another just-as-large collection of users think that their Windows Update has a problem, another several thousand think that they have a Firewall problem, another several thousand think that they have an Ethernet adapter problem…, (you get the point).

It looks to me like Microsoft has painted themselves into a corner. If Windows Update now doesn’t function, then you can’t easily push out a fix. You then have to rely upon the millions of users to ask you for help.

The Fix

Fortunately, it hit upon me how I could fix the problem which I now share with you.

buy-a-macbook

Update

Now that I’ve formatted the HP laptop with Ubuntu 16.04 LTS, I’ve been able to spin up a virtual machine and run Windows 10 Pro in it… and it doesn’t have the aforementioned bug.  Read more

android os

I got tantalizingly close with Android OS on this attempt, manually creating my own USB install disk with the very good UBootin open-source software. I can see now that the folks from Remix OS had customized both code bases for their own use in an attempt to make things easier but fell short, it would seem.  UBootin appears to allow you to create almost any sort of live/install USB drive and well worth the time spent with it.

I managed to “live boot” (without installing) Android OS from my USB drive only to find that the Google Play Service appears to be crashing on the Dell Vostro 200 upon initialization, a known bug. The software appears to expect that 1) I have cellphone service, 2) I have wi-fi. I have neither and it doesn’t seem to know how to drive forward to the point of using DHCP on my Ethernet adapter to continue.

I’ll check the documentation to find out how I might get further but this is the best attempt so far within the Android OS—compatible collection.

Eureka…?

I’ve finally gotten the live boot to work by sneakily removing the Ethernet connection in order to get past the Google Play Service screen. It has an interesting interface that looks a lot like a cellphone might. So I’ve decided to boot again and actually install this time.

I’ve managed to navigate around the interface a bit during the live boot session. Oddly-enough, you get to a terminal screen with the Ctrl-Alt-F1 screen and back to the GUI with Ctrl-Alt-F7. There’s a very thin setup of UNIX under the covers and some familiar commands if you are savvy to such things.

It appears to be a little heavy-handed with the processor fan control, in my humble opinion. There are many times when the fan is adjusted to full while it’s doing anything. For example, it’s blaring away while presumably formatting the first drive.

The installation process is shy on status. I couldn’t honestly tell you how much of the drive is formatted at the moment, for example. In old Western movies the Indian scout would put his ear to the ground in order to hear distant horses. Here, I put my ear to the side of the chassis in an attempt to hear whether or not the drive is being written to. Color me “worried”.

If At First You Don’t Succeed…

Okay, that didn’t work. So I reboot, reformat but this time without GRUB. It now appears to be going further.

Android OS starts up at least. I does still throw an error that Google Play service is stopped, like before. Like before, I need to temporarily disconnect the Ethernet cable to get past the same bug as seen during the live boot attempt.

Finally booting from the hard drive results in Error: no such partition, entering rescue mode, Grub rescue>. Really?

I think we need to vote Android OS off the island as a viable solution.

And yet…

I just keep imagining that this will work. So now I’m trying again with the previous (perhaps more stable) version of Android OS x86 5.1 rc1. This version plows right through the previous installation bug involving the Ethernet adapter, always a good sign. And the browser actually comes up without crashing, another bonus.

Finally, I’ve managed to find a working version of an Android OS for a PC. I’ll continue my review in depth and follow-up with what I find.

phoenix os

Continuing the testing of replacement operating systems I next attempted to install Phoenix OS of Beijing Chaozhuo Technology Co. Unfortunately that failed during the multiple attempts to get the installer onto the USB drive. I’m not sure what format they’re looking for but it errors out with a message complaining about NTFS partitions. I attempted using the FAT and FAT32 styles but neither made the installer happy.

Again, it looks like we’ll need to pass on another Android-like operating system for PCs.

remix os, part 2

Well, that didn’t work. As you might recall from my last post, I was attempting to install Remix OS onto a Dell Vostro 200 computer for testing purposes. It seemed to show activity on the USB drive so I let it run all night.

I interrupted it this morning since it was still on the pulsing Remix OS logo screen. And then when I attempted to use GPartEd to delete any unwanted disk partitions I found to my great surprise that there were no partitions to be found. The 64-bit version of the Remix OS installation from USB was essentially a total fail.

Next, I attempted to get the 32-bit version loaded onto the USB drive but that didn’t seem to complete, leaving the USB drive empty. Guess we’ll pass on Remix OS for now.

windows 10 “free upgrade” is over

Bummer. We had a year to upgrade from Windows 7/8 to the latest Windows 10 for free and we missed it. It’s not because we’re lazy. Sometimes it’s just because I.T. is under-funded and it literally takes all of our time to do other things. A fraction of those workstations only had 2GB of RAM, for example, and couldn’t be updated. And sometimes you have a collection of Windows XP computers that didn’t quality for the update.

So here you are, August 2016 and you have several aging computers that may or may not be worth the $$ to pay for the Windows 10 license. If you’re anything like me then you review alternatives.

MaaS (metal-as-a-service)

One very cool option that you can do with a pile of old Dell Vostro 200 workstations is to convert them into a private cloud. I recently did just this. Imagine a rack of computers—all without monitors/keyboards/mice—and they all do something you rarely see: they boot over the network via Ethernet to pull down an image you’ve setup. Once you’ve set everything up it’s wonderfully automatic. The name of the collection of services is called Openstack.

What’s even better is that once each node has fully provisioned itself with an image, it goes to sleep, turning itself off. And then the cluster control can wake it up remotely over Ethernet and it goes to work again.

And the best of all is that the entire thing is free from a software standpoint. (Free is good.) Note that for the default installation you’ll need a spare Ethernet hub/switch, one of the computers needs to have two Ethernet adapters and at least five of the computers will need double hard drives. Since I had so many spare computers I just cannibalized where necessary.

If you’re interested in reviewing this as well, check out this link on Ubuntu’s website. Once you’re finished you’ll have a system in which you can spin up virtual computers and allocate them as you wish. You may securely remote into these virtual computers using the putty software client. If you’ve configured it to use public IP addresses you can even publish websites, for example.

The version that I reviewed was a few back from the current release and hopefully everything is much more stable now. I noted then that it wasn’t quite ready for “prime time” but I’d guess that it’s ready to go by now.

Ubuntu Server or Desktop

Even if you don’t go all the way and create a private cloud you can always just install the free Ubuntu operating system as a server or a desktop computer. It seems to be a very usable collection of well-maintained code. Canonical is the company behind this effort.

Remix OS

And today I’m trying something I’ve just discovered called the Remix OS for PC. It’s essentially the Android operating system for smartphones, just setup especially for a standard computer. Jide Technology appears to be the underlying developer.

At the one-hour mark: Things looked good for the first fifteen minutes or so of the installation. Unfortunately, after an hour I would guess that it’s possibly stuck. The Dell Vostro 200 appears to have an acceptable graphics adapter (Intel GMA 3100) and yet I still don’t have a full installation yet. Since the status light on the USB drive does still randomly blink perhaps it’s just taking a very long time. I’ll not interrupt it and see what happens.

At the two-hour mark: I’m still staring at the same pulsing Remix OS logo. The status light seems to indicate that progress is still happening or so I’d hope.

End-of-day: At this point I think I’m going to just let it run all night if it wants and see if it’s finished in the morning.