This article explains a trick, almost like a magic trick. The aim of this trick? To deceive our computer into thinking that it is inside another computer, equipped maybe with another operating system. Why do we do that? For numerous reasons. Some of the possible reasons include: to be able to run multiple applications on one server, to be able to simultaneously run multiple operating systems on one computer, to be able to run multiple sessions of a single operating systems or just to be able to host applications that are incompatible with our host operating system. The reasons are numerous, the solution is elegant. Let’s see then what is virtualisation and how it is achieved!
What is virtualisation?
Virtualisation is a technic that aims to provide a way to mimic the characteristics of a physical server, and a virtual machine is a software that does that. A virtual machine slices the resources of a server and creates individual parts, that feel, behave and think that they are an individual server. These slices of the physical server, these virtual machines are configured with processors, RAM space, storage resources and connectivity through network ports. Once they are configured and created, they can be used as a physical server, we can load an operating system on them, we can install softwares and run our code in this isolated environment. If we are in one of these virtual machines, already equipped with an operating system and software solutions, our computer is tricked into thinking that it is actually in that computer. The original operating system of the computer is called the host, while the virtual one called the guest. The virtual machines can only see and use resources it has been configured with, they are isolated from all resources of the physical server. The way how the virtual machines communicate with the physical server and how physical resources (I/Os) are passed from the physical server to the right virtual machine are facilitated by the use of a hypervisor.
The schema of virtual machines is shown below:
Why do we need virtualisation?
Some of the incentives are already mentioned in the introduction. Virtualisation enables a single computer to run multiple operating systems simultaneously or to run multiple sessions of a single operating system in parallel. Therefore, we can also run several applications and we can run apps that are not compatible with the host OS.
How virtualisation work?
Virtualisation machines (VM) are actually made up from files that contain the configuration of the virtual machine. The configuration of the VM describes how much and what resource the VM has. For instance, how much RAM it has, how many processors are allocated to it, how many network interface cards are in it, and so on. These configuration files also contain information about the storage the VM can access. Some additional logging files are also created when creating a VM, for memory management and backups.
Little drawback of virtualisation?
Virtualisation helped to resolve a problem of optimising server resource allocation and use one server for multiple applications. It also resolves another issue: softwares that are incompatible with the host operating system can be run in a VM. However, they are not fully optimised as on each VM we need to install a separate OS. The following schema shows the overhead of using virtual machines.
This is a waste of resource, and this slows down VMs. Of course this is still an amazing technology and had many benefits, and finally not only our computer can trick us but we can also trick our computer! But still, is there another way to create these isolated environments that can host different operating systems?
The answer is yes, and it is Docker. Check my article about Docker if you are interested! Thanks for reading and see you soon!