Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

How To: Install an Ubuntu Server Virtual Machine in VirtualBox

In this tutorial, we'll walk through the process of installing an Ubuntu Server virtual machine in VirtualBox. We'll then install open-ssh server on the server so we can access it from the host. I'll also be installing MongoDB in preparation for a database project.

We'll use Ubuntu Server our guest operating system for its relative ease of use and because there is already a large amount of support information that can be found online for its setup and maintenance in VirtualBox. I'll be using the 64-bit version of Ubuntu Server 14.04.3. Make sure you choose the version with the correct architecture for your system: 32 vs. 64 bit. Download a copy of Ubuntu Server from the link.

30+ Resources for Linux Beginners

I'm a relative newcomer to Linux, having installed my first distribution on an old desktop computer just over a year ago to see if I could give it some new life.  It was an eye-opening experience coming from Windows/Mac environments where so much is hidden or locked away from the system's ostensible owner.  Perhaps it may sound absurd to some ears, but without exaggeration I can say this was the first time I experienced something like freedom while working at a computer. And that is no coincidence.  From the Free Software Foundation:
“Free software” means software that respects users' freedom and community. Roughly, it means that the users have the freedom to run, copy, distribute, study, change and improve the software. Thus, “free software” is a matter of liberty, not price. To understand the concept, you should think of “free” as in “free speech,” not as in “free beer”.
When I think about why I hadn't begun exploring the GNU/Linux space five, ten or even twenty years ago (yes, I'm old), I'm often reminded of a classic work by philosopher Eric Fromm from 1941: The Fear of Freedom. Fromm argues that individuals seek out authoritarian systems precisely in order to avoid the disorienting and potentially traumatic experience of actual freedom and the responsibilities that come along with it.  It is much easier to let others tell you what to think and how to act than it is to think and act for oneself.  Anyway, philosophical digressions aside, I've collected a fair number of resources on GNU/Linux since that first install, and thought I'd share some of them here to help orient others who are interested in exploring alternatives to the Microsoft/Apple digital duopoly.  Below, you'll find resources on Linux distributions, installation, the command line, as well as how to set up a file server, a development server and conduct remote management. Feel free to leave your own recommendations in the comments!

There is a wide variety of GNU/Linux distributions to choose from in the wild. Wikipedia's list of Linux distributions reaches into the hundreds. DistroWatch lists even  more.  How-to Geek has a helpful article on what a distribution is and how they are different from one another.  For beginners, it likely makes the most sense to choose from among those that are the most popular, since it will be easier to find answers to everyday questions. 

Once you've decided to check out a distribution or three, the next step is to install it.  There are many options here too: 1) a full install to a specific machine (overwriting the current operating system), 2) a dual boot install that allows you to run a second operating system alongside your primary one on a given machine, 3) a virtual install that allows you to run a second, third, fourth, or fifth operating system on top of your primary one, 4) or even so-called live versions that boot from a CD or USB drive and which you don't install on your machine at all! All the necessary information should be available from the official website and related forums of the distribution(s) you've chosen to explore. For the present post, we'll take Ubuntu as an example:

Perhaps the simplest way to test out and experiment with a new distribution is to create a virtual instance of the system on your current machine.  For example, I currently have twelve virtual instances of nine different distributions on my main laptop using the VirtualBox free software package. VirtualBox is an application that allows you to create a virtual environment on your host computer in which you can install a so-called guest operating system that runs on top of your host's system the same way any other software application would.
Note: unless you're running a server without a graphical interface, once you've installed a guest operating system on your machine, you'll very likely also want to install the so-called VirtualBox Guest Additions, which provide a full screen "seamless" mode, file sharing between host and guest systems and other amenities. I have found this process to be a bit tricky in the past, but recently I came across this post on a CrunchBang forum which provided instructions that have worked flawlessly on every single Debian-based distribution I've installed on VirtualBox since (specifically: Crunchbang, Ubuntu Desktop, Ubuntu Server, Kali and Backbox).

Command Line
Despite it's name, the command line terminal is the beginning, not the end! Finding your way around the command line can be intimidating at first, especially for those of us who have only ever used Windows Explorer or Mac Finder to navigate a computer's file system. But I guarantee that after a bit of experience you'll soon be asking yourself how you ever went without it! Would you rather copy and rename 300 pictures from your camera onto your computer one by one in a graphical interface, or with one relatively simple command from the terminal?

File Server
Linux distributions are great for re-purposing old computers. Lots of people have old laptops or desktop machines gathering dust in the closet. These can easily be transformed into file and media servers for your home network.

LAMP Stack Development Server
A LAMP stack is a software bundle used for running services like web sites, databases and the like. LAMP stands for: Linux (operating system), Apache (web server), MYSQL (database server), and PHP (server side scripting language).  Setting up a full fledged LAMP stack is actually ridiculously easy once you get the hang of it.

Open SSH Server
Once you've set up a dedicated home server of some kind, you don't really want to have to keep it hooked up to a monitor, keyboard and mouse. You want to put it in a closet and forget about it, but you still need to be able to dial into it for updates or maintenance. And that's what the Open SSH Server is for.  Basically, Open SSH allows for secure login to a remote machine over a given network. 

Well, that's all folks! I hope you've found some of these resources helpful.  As always, recommendations of your own favorite resources are welcome in the comments, as are suggestions, criticism and angry tirades! 

Pirate Box: A Simple LAMP Stack Live Server Build

I first came across the PirateBox DIY project late last year, and thought it would be fun to set one up, but I didn’t really have an idea of where it could be put to good use. And then one day it hit me. I'm in a band and we play shows fairly regularly here in NYC. After shows people often ask if they can download any of our songs online (which, of course, they can), or they want to share pics they took during the set, or they want to get in touch with us and need our contact info, and so on. So I thought, hey, I’ll set up a Pirate Box for the band and run it as a live server during shows, and then people could share pics with us and one another directly, download songs directly from us rather than through an online middleman, get general info about the band, upcoming shows and so on.

I began hunting on Craig’s List for an appropriate router to install the PirateBox ISO, but had no luck. Being the impatient type, I broadened my search criteria and found someone selling an old Mac Mini for $50. Perfect. That weekend, I went to a local flea market and picked up a cheap soho router and some cables for another $10, and set to work.

Because of some apparent incompatibilities between the PirateBox ISO and the Mac Mini hardware, I decided to scratch the idea of installing the PirateBox ISO and instead create my own build from scratch rather than spend endless amounts of time troubleshooting and tweaking to get the hardware and software to play nice with each other.

After a couple weeks of research and tinkering, I managed to put together a nice little LAMP stack running a main portal page, a band Wiki, a chat room, and a song downloads page (see below for full details). I keep the setup in an old laptop case with the Mac Mini and the router inside, plugged into a power cord. I’ve since brought it along to two shows and set it up somewhere inconspicuous on stage. When we’re doing sound check I just plug in the extension cord, turn on the router and the server, and it’s good to go!

I configured the network and server so that once someone has hopped onto the wifi, all they have to do is navigate to serverhostname.local to access the server, and I set the wifi broadcast name and the host name of the server to the name of the band.  Here are some screen caps from the initial setup.  Once someone connects to the wifi and navigates to the correct url (in the present case: utm.local), they are greeted with a success page. 

Clicking the portal link takes them to the site's main navigation page.

From there, users can navigate to the wiki:

Or to the chat room:

 Or to the download page:

Try not to laugh at the download page, this was what it looked like after initial setup, it's since been spiced up a bit.  If you want to see it now, you'll just have to come out to one of our shows!

All in all this was a fun little project.  It took about a month's worth of work (mostly on weekends) to get everything up and running, including preliminary research, installation, configuration and customization, as well as the time spent setting up an initial test on a VirtualBox VM on my laptop. 

There were, however, some frustrating hurdles along the way: finding an Ubuntu Server ISO that worked without problems on the Mac hardware, getting hostname resolution to operate correctly for both iOS and Android devices (avahi-daemon eventually did the trick, though a bug in older generations of the Android OS prevents those devices from being able to resolve the hostname.local URL to the IP address of the server), and, perhaps most ridiculously, uploading the band's logo into the MediaWiki (though drinking a bit less beer during configuration would have probably made that process go a bit more smoothly!).   

There's a lot more that one could go into here: installing Ubunutu Server onto the Mac Mini, installing and configuring the LAMP stack, comparisons of the various open source software packages I decided to include, as well as those that I decided against, potential security issues running an open wifi at bars and clubs in NYC, and so on.  But perhaps those are best left to their own individual posts. So for now, that's all folks!

UTM Live Server Build

• Mac Mini, $50 on Craig’s List
• Netgear router, $10 at a local flea market
• Cables, $5 at the same flea market
Total Hardware Cost: $65

• OS: Ubuntu Server
• LAMP Stack:
    • Apache2 Web Server
    • PHP5
    • MYSQL DB
    • PHPMyAdmin
    • OpenSSH
• Web Interface:
    • MediaWiki
    • Blueimp’s AJAX Chat
    • PHP login module for the downloads page (adapted from Harvard’s Building Dynamic Websites online course)
    • Noir HTML5 Template optimized for mobile devices
Total Software Cost: $0

Critical Linux Vulnerability Discovered

From Ars Technica:
Hundreds of open source packages, including the Red Hat, Ubuntu, and Debian
distributions of Linux, are susceptible to attacks that circumvent the most widely used technology to prevent eavesdropping on the Internet, thanks to an extremely critical vulnerability in a widely used cryptographic code library.
The bug in the GnuTLS library makes it trivial for attackers to bypass secure sockets layer (SSL) and Transport Layer Security (TLS) protections available on websites that depend on the open source package. Initial estimates included in Internet discussions such as this one indicate that more than 200 different operating systems or applications rely on GnuTLS to implement crucial SSL and TLS operations, but it wouldn't be surprising if the actual number is much higher. Web applications, e-mail programs, and other code that use the library are vulnerable to exploits that allow attackers monitoring connections to silently decode encrypted traffic passing between end users and servers.
The bug is the result of commands in a section of the GnuTLS code that verify the authenticity of TLS certificates, which are often known simply as X509 certificates.

Torrent Search to Be Included in Ubuntu by Default

From Torrent Freak:
A new scope set to be included in Ubuntu by default will allow users of The Pirate Bay to conduct BitTorrent searches directly from Unity desktop. The tool’s creator informs TorrentFreak that while there is still work to be done, the aim of the scope – which is endorsed by Canonical founder Mark Shuttleworth – is to embed Free Culture directly into the Ubuntu user experience.
In early December 2013 there was a nice announcement for Ubuntu users. Software developer David Callé revealed that a new torrent scope (search addon) for the Debian-based Linux OS was now available.
In the first instance Callé was skeptical about having the scope included in Ubuntu by default since it would inevitably turn up unlicensed content, something he feared would “generate a lot of FUD for Ubuntu.” However, Callé’s fears were quickly addressed by Ubuntu founder Mark Shuttleworth.