Jason Cannon bio photo

Jason Cannon

Professional system administrator, consultant, and open source enthusiast.

LinkedIn Github

Create, Build, Test Drive, or Deploy Your Very Own Linux Server with Full Root Access

We’ve covered four ways to get access to a Linux shell account, but most of those methods do not allow you to run commands as the superuser, also known as root. You can learn a lot with a normal user account, but if you want to start getting into the system administration aspects of Linux you’ll want to have complete control over an entire server or set of servers. Below are some strategies for doing just that.

Create a Virtual Machine Using Vagrant and VirtualBox

Vagrant allows you to easily create virtual machines with just a few commands. The idea behind vagrant is that you can create reproducible work environments that are disposable. This is great for learning Linux because it allows you to quickly create a virtual machine on which you can experiment. When you are ready to start over, discard the current image with vagrant destroy and recreate a pristine one with vagrant up.

To get started, head over to the VirtualBox download page and grab the installer for your current operating system. Click through the install screens and accept the defaults. Here’s a video that walks you through the process. Next, download a copy of Vagrant by visiting the Vagrant download page. Install it using the normal procedures for your operating system.

You will need to download an image to use with Vagrant and VirtualBox. Vagrant calls these images “boxes.” You can find a list of boxes at VagrantBox.es. You can add, remove, and list boxes with the vagrant box command. The format of the command to add a box is vagrant box add NAME URL.

Here is how you can download Ubuntu and CentOS boxes, for example.

$ vagrant box add ubuntu12.04 http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box
$ vagrant box add centos6.5 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.1/centos65-x86_64-20131205.box 
$ vagrant box list
ubuntu12.04 (virtualbox)
centos6.5 (virtualbox)

Vagrant makes it easy to create a virtual machine, start it, and connect to it.

$ mkdir temp-box
$ cd temp-box
$ vagrant init ubuntu12.04
$ vagrant up
$ vagrant ssh

Vagrant comes with out of the box support for VirtualBox, but it can provision machines on other backend services as well. You can use vagrant with Amazon Web Services (AWS), Rackspace, DigitalOcean, and others by installing the corresponding vagrant provider plugin.

Spin up a Cloud Instance

With cloud computing providers you can pick a pre-installed Linux image and launch an instance of that image. Instance is the cloudy way of saying virtual machine or server. One of the advantages of using a cloud provider is that you pay as you go. Traditional hosting services typically require you to pay for services in monthly increments. If you only need access to a server for a few hours a month, it is probably cheaper to use a cloud provider. Some providers charge by the minute like Rackspace and others charge by the hour like Amazon Web Services.

Here is a short list of popular cloud providers.

Use a Live Linux Distribution

Live Linux distributions give you the opportunity to try out Linux without having to modify your current system in any way. Just pop in the bootable CD, DVD, or USB drive and watch it run. Don’t use live distros to evaluate how Linux will perform on your hardware, though. Live images run in memory and also have to access a way-slower-than-your-hard-drive storage device. If you find that you like the distribution you can choose to install it on your hard drive.

Here are a few Live Linux distros to get you started.

Install Linux the Old-Fashioned Way

So far we’ve been looking at ways to create Linux servers without having to manually install them. However, installing Linux by hand can be a rewarding experience. It gives you the opportunity to see what decisions need to be made when deploying a server. You can choose the partitioning scheme, the file system types, the file system sizes, and even decide what software packages will be installed on your system. Having control over the installation process can allow you to create a customized Linux server that fits your needs.

Here are a couple of guides that provide step-by-step instructions on installing Linux complete with screenshots. Find some hardware or create a virtual machine and have fun installing Linux.

Now that you have your own Linux server, you’ll need a way to connect to it over the network. For that, see the “20 Windows SSH Clients You Can Use to Connect to Your Linux Server” article.

If you want to receive free Linux and other open source software tips from Jason, all you have to do is enter your email below and click "sign me up!"

comments powered by Disqus