Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Linux Administration Cookbook

You're reading from   Linux Administration Cookbook Insightful recipes to work with system administration tasks on Linux

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher Packt
ISBN-13 9781789342529
Length 826 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Adam K. Dean Adam K. Dean
Author Profile Icon Adam K. Dean
Adam K. Dean
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Introduction and Environment Setup FREE CHAPTER 2. Remote Administration with SSH 3. Networking and Firewalls 4. Services and Daemons 5. Hardware and Disks 6. Security, Updating, and Package Management 7. Monitoring and Logging 8. Permissions, SELinux, and AppArmor 9. Containers and Virtualization 10. Git, Configuration Management, and Infrastructure as Code 11. Web Servers, Databases, and Mail Servers 12. Troubleshooting and Workplace Diplomacy 13. BSDs, Solaris, Windows, IaaS and PaaS, and DevOps 14. Other Books You May Enjoy

Installing VirtualBox

As I said in the previous section, I've chosen to mostly use CentOS for the recipes in this book. Hopefully, this gives you a good baseline for learning about Linux Administration, but also gives you a bit of a head start if you plan on going for any of the Red Hat exams.

Instead of requiring you to have a spare laptop handy, or renting a server somewhere, I'm going to advocate using VMs for testing and running through the examples given.

VMs are exactly as they sound – a way of virtualizing computer hardware on one or a cluster of physical machines, thus allowing you to test, break, and play to your heart's content, without risking rendering your own computer unbootable.

There are many ways of creating a VM: macOS has xhyve, Windows has Hyper-V, and Linux has a native implementation called Kernel Virtual Machine (KVM).

KVM (along with libvirt) is the technology that you will come across most often in the Linux virtualization space. It forms the basis of popular technologies, such as Proxmox and OpenStack, while providing near-native speeds.

Another way of creating and managing VMs is a program called VirtualBox, which is now developed by Oracle. The nice thing about this software, and the reason I shall be using it here, is that it's cross-platform, being produced for macOS, Windows, and Linux.

Installing VirtualBox on Ubuntu

I'm using Ubuntu to write this book, so I'll run through the basic way of installing VirtualBox on an Ubuntu desktop.

This will be slightly different to installing it on other distributions, but a good number of them package it for installation, and should provide a guide for installing it.

Command-line installation

Open your Terminal and run the following:

$ sudo apt install virtualbox
Using sudo will generally prompt you for your password, and you won't see anything being printed to screen as you type.

You will likely be prompted to confirm installation of VirtualBox and its dependencies (there may be a lot—it's a complex program and if you haven't updated in a while, you may get a few dependency updates too).

Hit Y and Enter to continue. The following screenshot shows an example of the installation if started from the command line:

Once done, you should have a working VirtualBox installation.

Graphical installation

If you'd like, you can also install VirtualBox through Ubuntu software.

Simply search for the software you desire, in this case, VirtualBox, and click through to its store page.

Once there, click Install and the package will be installed, no Terminal required!

After installation, your screen will change to show Launch and Remove options.

Installing VirtualBox on macOS

Although I'm using Ubuntu, it's not the end of the world if you're not. macOS is a fine OS too, and handily it supports VirtualBox.

In this recipe, we'll run through a couple of ways of installing VirtualBox in macOS. You'll find that the layout is extremely similar, regardless of the OS you use.

Command-line installation

If you already have the command-line program brew installed, then getting VirtualBox is as easy as running the following command:

$ brew cask install virtualbox

You may be prompted for a superuser password to complete the installation.

Homebrew is available from https://brew.sh/ and is effectively the package manager that macOS needs, but doesn't have out of the box. I can't readily recommend blindly running scripts from mysterious websites, so be sure you understand what's being done (read the code) before you take the plunge and install brew.

Graphical installation

Oracle also provides an installation image for macOS, if you'd like to install it in the more traditional way.

Simply navigate to https://www.virtualbox.org/wiki/Downloads and select the OS X hosts option.

This will prompt you to download the installer to your local system, which you can unpack and install.

Running through the installation, you may be prompted for your superuser password.

Installing VirtualBox on Windows

If you're not using a Linux flavor on your computer, and you're not using macOS, it's a good bet that you're running Windows (unless you've delved into FreeBSD on the desktop or similar, in which case I can't help you here—we'd need an entire afternoon).

If using Windows, I can suggest VirtualBox again, due to its cross-OS nature, and it can again be installed from Oracle's site.

Graphical installation

Like the macOS installation, navigate to https://www.virtualbox.org/wiki/Downloads and select the Windows hosts option:

This will download an executable that can be run.

It's worth noting that Windows can complain if you're attempting to run multiple virtualization solutions at once. If you've previously run Hyper-V, or Docker, and you experience issues attempting to start VirtualBox machines, try disabling your other solutions first.

You have been reading a chapter from
Linux Administration Cookbook
Published in: Dec 2018
Publisher: Packt
ISBN-13: 9781789342529
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image