vps header 1200x200

2.1 Install Virtual Machine Manager and Cockpit

In this article, we will first explain why we want to install VMM and Cockpit and then review the steps to install these two important tools.

Why VMM and Cockpit?
We will combine VMM and Cockpit to create a “test” virtual private server (VPS). The benefit of learning with a test server is that, if you make a mistake, you can easily delete the VPS and start over. This is why it is called a sandbox. If you sand castle falls over, you can quickly make another one.

01

The VMM – Cockpit learning platform is a little more complex than a previous platform we reviewed called a LAMP server. While a LAMP server is a good introduction to the Linux File System and business website creation process, the VMM – Cockpit process is much more like the process used to create a real virtual private server. With a LAMP server, we used a simple internal connection process called Localhost to display our business website. With the VMM sandbox, we will use an actual static IP address and DNS server combined with fake or real domain names to display our practice business websites. The VMM sandbox therefore is a useful stepping stone in understanding how a secure business website is actually created.

VMM and Cockpit versus VirtualBox
I have previously written articles explaining how to use a tool called VirtualBox to create a virtual private test server. However, VirtualBox is needlessly complex - resulting in too much time spent learning how to use VirtualBox rather than spending time learning how to use Virtual Private Servers. While VirtualBox is free and open source, it is not specifically designed for Linux servers. By contrast, VMM and Cockpit are specifically designed for Linux Kernel Virtual Machines (KVM). These are the same virtual machines or virtual servers that are used on real Virtual Private Servers.

02

What is a Virtual Private Server
A virtual private server (VPS) – also called a virtual machine (VM) - is a way to test an operating system that runs inside of your own computer. Virtual machines are a great way to test out any new operating system you might be interested in before installing the operating system on a real computer or a real Virtual Private Server.

Why a VPS is Better than Shared Hosting
In the past, I recommended a shared hosting account at a Canadian web host called Fullhost for new startup businesses. However, recent events have caused me to change this recommendation. Recently, Cpanel which is essential to manage a Shared Hosting account dramatically raised their prices. As a consequence, a basic shared hosting account with 15 GB of Disk Space, 2 Cores and 4 GB of RAM with Cpanel is now $15 US per month – and likely to be more in the near future. This does not include a dedicated IP address. Meanwhile, a KVM VPS through Fullhost with 25 GB of Disk Space, 2 cores and 4 GB of RAM and a dedicated IP address is only $20 US.

The drawback is that a VPS does not come with Cpanel. However, we will show you how to add a better free control panel called Hestia.

Hidden Advantages of VPS over Shared Hosting
Shared hosting is like having 1000 people (websites) share the same large house (server). They share the same bathroom and kitchen and thus problems can result. Virtual private hosting is like turning the large house into a series of apartments. There are walls between the apartments and each person or website has their own kitchen and bathroom. Another difference is that with shared hosting the hosting company provides the furniture in the house (Cpanel) while with a VPS you need to create your own furniture (our own custom control panel). Historically, a Virtual Private server cost much more than shared hosting. However, recent technology advances have lowered the cost of a VPS – while at the same time, the massive price increase of Cpanel has increased the price of shared hosting – to the point where there is no longer a significant difference in price.

The only real obstacle to creating a VPS is learning how to set it up. It does take time to learn how to create your own custom server and control panel. But in the long run, it actually takes less time – because Cpanel can be much more difficult to work with than our own custom control panel.

03

If set up properly, a VPS will load faster than Shared Hosting. You will also have much more control over the appearance of the back end of your control panel. There is no way to change the appearance of Cpanel or reduce its complexity. With a custom control panel, you can choose your own color scheme and decide who has access to different tools in the back end of your server.

Finally, you can do much more with a VPS because you have root access to all functions on the server. With shared hosting, you have much more limited access. Root access is particularly important to business websites as is having your own dedicated IP address.

Why we will use Debian instead of Ubuntu
The two most common types of Linux servers are called Debian and Ubuntu. Ubuntu is based on Debian and is basically Debian with a few changes made to it. Unfortunately some of the changes made by Ubuntu create privacy and security problems. In addition, Ubuntu Server is about three times the size of Debian server (1200 MB versus 400 MB). This bloated code also creates security problems. You can have a Debian server complete with the Joomla Content Management System and the Phoca Cart Shopping Cart and a newsletter component and a form creation tool – and still use up less space on your host computer than Ubuntu takes up!

The created practice Debian server will have 2 GB RAM and 20 GB disk space. This is comparable to a typical online Virtual Private Server (VPS). Completing this exercise will provide you with an ideal foundation for learning how to create your own Virtual Private Server running Debian 10.

Host Computer Hardware Requirements
To install a Virtual Machine, you should have a host or home computer with at least 4 GB of RAM and preferably 8 GB of RAM (as the process requires giving 2 GB of your RAM to your virtual server). You should also have at least 20 GB or more of free space on your hard drive. Your CPU (Central Processor Unit) must support Intel VT-x or AMD-v virtualization features which must also be enabled in UEFI/BIOS.

Download the ISO of the Debian Operating System
In our case, we want to test the Debian 10 operating system. Go to the Debian Download page:

04

https://www.debian.org/distrib/

You have four options. You can download a small installation image or ISO file which is a zipped version of the operating system. Or you can download a complete installation image of the operating system with the Desktop interface. Option 3 is to download a cloud version of the operating system. This is what you or your hosting provider will install on your Virtual Private Server. Option 4 is to Try Debian Live. This is the ISO used to create a live USB stick for installing Debian on a personal computer. We will be installing just the server part of Debian. We will therefore download option 1 which is the small installation image. Click on the 64 bit PC Net ISO to download the file. It is only 353 MB which is much smaller that the Ubuntu Server ISO file which is 1.2 GB. Small is good.

05

Leave this ISO file in your Downloads folder as we may use it several times during the learning process.

Install Virtual Machine Manager aka Virt Manager

We will next install Virtual Machine Manager from the Mint Software Center. Type Virtual Machine into the Search Box. Then click on Virt Manager.

06

Click Install and enter your password. Then close the Software Manager. When you install virt-manager, it comes with 5 components:

virt-install: Command-line utility to provision OS

virt-viewer: The UI interface with graphical features

virt-clone: Command-line tool to close existing inactive hosts

virt-xml: Command-line tool for easily editing libvirt domain XML using virt-install’s command-line options.

virt-bootstrap: Command tool providing an easy way to set up the root file system for libvirt-based containers.

However we also need to open a terminal and add the following packages by copying and pasting this command into the terminal:

sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

Then close the terminal.

Install Cockpit
After completely installing VMM, we can go back to the Mint Software Center to install Cockpit. Enter Cockpit in the Search box.

07

Click Install and enter your password. Installing Cockpit also installs Cockpit Bridge, Dashboard, Network Manager, package kit and storage. But it does not install Cockpit Machines. So we will also need to type Cockpit Machines into the search box and install Cockpit Machines. The Cockpit Machines install page says we also need virtinst package installed. However this was already installed with Virtual Machine Manager. Close the Mint Software Manager. Then, restart your host or home computer.

Update Cockpit to a more recent version
LMDE often comes with very old packages. This is not a problem with packages such as Virtual Machine Manager which are not undergoing rapid development. But it can be a problem with packages such as Cockpit that are being actively developed. Thankfully, LMDE comes with a way to solve this problem. LMDE comes with a feature called Debian Backports automatically installed. Debian Backports allow us to easily install newer versions of some packages just by entering this command in the terminal:

sudo apt install -t buster-backports package_name

For example, to update to the latest version of Cockpit from Debian backports, the command would look like this:

sudo apt install -t buster-backports cockpit

Type Y at the prompt. We also want to install the backport version of the package called cockpit-machines with this command:

sudo apt install -t buster-backports cockpit-machines

When done updating these two programs, close the terminal.

 

Open Virtual Machine Manager
Open the Mint Menu and click on Administration, Virtual Machine Manager. This screen will appear.

08

Enter your password. Then this screen will appear:

09

Congratulations. You have now installed VMM and Cockpit.

What’s Next?

In our next article, we will use Virtual Machine Manager to create a Virtual Private Server