Install Cygwin X-Windows and OpenSSH on Windows8

This tech-tip describes how I installed Cygwin X-Windows and OpenSSH on Windows8.
Before I discuss the how, I'll explain the why.
Most current laptop software-development environments fall into three categories:
- Windows
- Linux
- Apple
Most current server software-deployment environments fall into two categories:
- Windows
- Linux
I develop software on a Windows8 laptop and deploy it to Linux servers
running in data centers owned by companies like Amazon, Rackspace,
Google and my favorite, NephoScale.
Why do I develop software on a Windows8 laptop?
I do it for three main reasons.
First, compared to Apple laptops, Windows8 laptops are cheap.
Today, 2013-11-08, I can buy a 15 inch Apple laptop for about $2000:
http://store.apple.com/us/buy-mac/macbook-pro
I can buy a 17 inch Windows8 laptop with 16G of ram, 1TB of disk,
and an Intel i7 CPU for about $1000:
http://www.google.com/search?q=17+inch+laptop+i7+site:costco.com
Secondly, a new Windows8 laptop with 16G of ram, 1TB of disk, and an i7 CPU,
is a powerful machine.
Third, for software development, I want a large 17 inch screen.
Apple has discontinued manufacturing 17 inch laptops.
One problem with Windows8 laptops is the OS is poorly suited
for developing Linux software.
That is easy to change though, and that is why I wrote this tech-tip.
Enhancing a Windows8 laptop boils down to two main ideas:
First, install software, Cygwin, on the laptop which makes it easy
to communicate with linux servers.
Second, install more software, VirtualBox and Vagrant, on the laptop
which allows me to run linux servers inside the laptop.
How I installed Cygwin
I searched:
goog: cygwin download
I landed here:
http://cygwin.com/install.html
Avoid this link, do not download it:
http://cygwin.com/setup-x86.exe
I downloaded this and clicked it.
http://cygwin.com/setup-x86_64.exe
The UI is not initially friendly.
Once I understood it though, I liked it.
Usually the default options are okay.
I clicked through until:
Choose A Download Site
My favorite sites:
ftp://mirrors.kernel.org
http://mirrors.kernel.org
In UI I searched for:
xorg-server
I clicked X11.
I clicked xorg-server.
I ignored others.
I clicked Next; I kept clicking through.
I checked boxes to create/add icons.
That completed the install of xorg-server.
I use it as a demo of a typical install.
Cygwin is full of many types of useful software for your Windows8 laptop.
Next, I started an install of xinit.
I clicked this again:
setup-x86_64.exe
I clicked through until I was presented the search box.
I typed in xinit.
I kept clicking through as I had done before.
I checked boxes to create/add icons.
I doubt it is necessary, the icons already exist, but I did it anyway.
That completes the install of xinit.
I searched for the XWin Server via the Windows8 magnifinder.
It sent me to the Start-Menu folder.
I clicked the icon and Cygwin gave me a bare-bones xterm window
with a shell prompt in it.
I wanted an xterm with a scroll-bar so I asked for one via a simple shell command:
xterm -sb &
I wanted a mintty terminal so I asked for one via a simple shell command:
mintty &
Next I started on the task of installing cygwin software called OpenSSH.
I clicked this again:
setup-x86_64.exe
I clicked through until I was presented the search box.
I typed in openssh.
I kept clicking through until it was installed.
That completes the install of openssh.
Next, I tested it by using the ssh-shell-command to connect to
a Linux server on my LAN:
It worked, I was happy:
I tested an X-Windows feature that allowed me to run X-Window software
on the Linux server, but display on my laptop:
It worked perfectly and I was happy.
The next tech-tip, part 2, describes how I installed both VirtualBox
and Vagrant on my Windows8 laptop:
Part2: VirtualBox, Vagrant, Linux on Windows8
That software combination allows me to run many Linux servers inside my laptop.
This is useful when I need to develop software for cluster technology like Hadoop.

VirtualBox, Vagrant, Linux on Windows8

I started my effort to install VirtualBox on my Windows8
laptop by drilling down into the laptop BIOS interface
and enabling virtualization.
This was a multistep procedure which required some finesse.
It is difficult to show you how I did this because I had
to deal with an area of Windows8 which cannot be easily
screen-captured.
So in order to explain how I did this,
I'll use a lot of English and some poor quality photos
from an actual digital camera.
I started by right-corner-mouse-hover.
I searched for "BIOS"
I clicked Advanced Startup Options:
I clicked through and saw this page:
I scrolled the right window all the way to the bottom.
It is difficult to read but the text in the image says:
Advanced startup
And the button under the description says:
Restart now
I pressed the button and it led me down a path to reboot my laptop.
In the next screen I clicked 'Troubleshoot'.
I could not capture the screen so I took a photo with my camera:
I clicked Advanced Options:
I clicked UEFI Firmware Settings:
I clicked through and was shown Startup Menu.
I pressed F10 to gain access to BIOS Setup:
I saw the main BIOS screen:
I found the Virtualization Setting and enabled Virtualization:
I saved the new settings, and exited the BIOS interface
and Windows8 rebooted:
I continued my effort to install VirtualBox on my Windows8
laptop by searching google which lead me to a download page:
http://www.virtualbox.org/wiki/Downloads
After I downloaded the installer, I saw it in my Downloads folder:
After I walked through the install, I imported some virtual-boxes
I had built on another laptop.
I clicked the VirtualBox startup icon,
and the VirtualBox GUI appeared:
With VirtualBox installed, I started on the task of installing Vagrant.
Before I describe that effort I'll insert a short opinion about both
VirtualBox and Vagrant.
VirtualBox is very useful software.
On a usefulness scale of 1 to 10, I give it a 9.
In the old days, before VirtualBox and VMware, if I wanted a new
Linux server in my office, I would order an actual desktop
computer from zareason.com at a cost of about $700.
After a few days, UPS would deliver it. Then I would spend
an hour or three getting it configured.
Now, when I want a new Linux server in my office I use
VirtualBox to create a new one inside my laptop.
The incremental cost is $0; I really like VirtualBox.
I have a lower opinion of Vagrant, not because I dislike it.
It is because I'm not very dependent on it.
On a usefulness scale of 1 to 10, I give it a 4.
When Vagrant is working correctly, it saves me time
because it provides an elegant interface to VirtualBox.
I've worked with several versions of Vagrant and sometimes
I could not get it to work as I expected.
I suspect the problems were due to my attempt to run
VirtualBox 4.1.x on Windows8.
I got it to sort of work but that combination is not
officially supported.
That lack of compatibility caused problems for Vagrant.
Anyway, if my problems with Vagrant are too severe, I just stop using
it for a few weeks/months and do all my virtualization activities via
the normal interfaces to VirtualBox.
If you have problems with Vagrant, I suggest you just wait for a newer
version to come out and see how that works.
Currently I have this combination of software:
Vagrant 1.3.5
VirtualBox 4.3.2
Windows8
The above combination is working well for me.
With that opinion behind us, I now describe how I installed vagrant.
I used google to find the Vagrant download page:
http://downloads.vagrantup.com
After the download and install, I used a bash shell to look for the
vagrant command.
A little knowledge goes a long way here.
A typical Windows-person usually expects new software to be visible
as a click-able icon.
Vagrant though, has a command line interface so the place to
look for it is in either a DOS command line or a Cygwin bash shell:
Next, I used Vagrant to create a specification for a new Linux
server in the following directory inside my Cygwin account:
~/vagrants/ubuntuDemo/
Screen Captures:
Then, I used the 'vagrant up' command to transform the
specification (a file called Vagrantfile) into a running
Linux Server:
Then I verified the server was indeed up:
Next, I used 'vagrant ssh' to login to the vagrant account on the
new Linux server from my Cygwin account.
Once in, I connected to the root account using the command:
sudo bash
From the root account, I changed the password of root.
Then, I created an account called 'dan'.
Next, I changed the password of dan.
Then, I verified that I could ssh into the new dan account:
So that concludes this tech-tip.
Typically what I do next is configure the Linux server so that
it can be used as a software development environment.
That is a rather large topic so I shy away from it now.
I can say that most configuration in Linux is automated
with the help of sophisticated tools.
My favorite configuration tool is Chef:
https://github.com/opscode/chef

101

Some people want to use Linux as a platform to run software.
I call this type of person an 'Operator'.
If that describes you, the Linux you need to learn is both easy and
minimal.

The next step up, is deploying software on a Linux host.
I call this type of person a 'Deployer'.

Learning to deploy is about as difficult as baking pie,
which is not that hard unless you want to do something
like build a pie factory.

If you pick up deployment skills, the next higher level is 'Developer'.
Developing software on Linux mostly requires diligence.

In the old-days you needed strong problem solving skills,
knowledge, training, and a mentor.

Now you only need three things: persistence, an ability to breakdown
complex English questions into several simple questions, and access
to Google.

Aside from 'Developer', another role is 'Administrator'.

I have picked up a few administrative skills. The ones I've found
most useful are related to networking, adding diskspace,
adding accounts, and troubleshooting malfunctioning software.

Operator

As an Operator, I need to login to my Linux box.
Sometimes the box is on my LAN.
Other times the box is in a datacenter far away.
Sometimes the box is inside VirtualBox or VMware which is
inside my laptop somewhere.

In all three of these cases, the best way to login is via
software called SSH.
If you are on an Apple laptop, you are in luck.
I'll take a minute to describe SSH on Apple,
then I'll take the discussion back to Windows.

On Apple just find the terminal application.
Then find the IP address (or hostname) of your Linux box.
Then type in something like this:

ssh -YA dan@192.168.1.42

The above command logs you into the dan account on a Linux
box at IP address: 192.168.1.42

Actually this would work also:

ssh dan@192.168.1.42

Enough about Apple.
On Windows, I have no terminal application like I find on Macs.
So, I install one.

The best terminal application for Windows is xterm which is
inside of Windows software called Cygwin.

Categories

Featured

Usually when I think about launching a new site, I visualize the look of the site with pencil and paper.
After 15 minutes or so, I add color to my idea with colored pencils.
Once I have some drawings I like, I start the task of coding up HTML and CSS files.