How are Virtual Machines made?

588 views

How are Virtual Machines made?

In: Technology

3 Answers

Anonymous 0 Comments

You have a certain CPU + RAM + HDD (3 resources) on a hardware (ignoring other resources for this example). Then there is an Operating System (like Linux / Windows) that is installed onto it. This OS has access to all of machines resources. Within that OS there is a program that allows the administrator to create compartments with specificed fractions of all the 3 resources allotted to each compartment. Then that compartment is called a VM. So VM1 may have 30% of the CPU + 4 GB (out of 16 GB) RAM + 500 GB (out of 4 TB) HDD and VM2 will have the balance.

Compartment 1 does not know what is happening in compartment 2. All these compartments run independant of each other. So even if there is a crash / data corruption in compartment 2 – other compartments are not affected.

This is a very simplistic explanation but its quite complex to allocate other resources and ensuring that all VMs on the machine are running in a balanced way. Optimization of the VMs on a particular hardware – is a totally different ball game by itself.

Anonymous 0 Comments

They reserve part of your hardware and it runs a second OS on that. Running a VM will take away resources from your applications running on the main OS.

VMS will allocate the resources, even if they are not needed. Therefor a VM should be configured with minimal resources, especially when running on your personal machine.

When running a VM in the cloud there is usually multiple machines that form 1 big machine, which is called the hypervisor. That big machine is then broken down in multiple VMs. These are the ones offered by AWS, GCP or Azure. (Or any other cloud provider)

So a cloud VM is run on multiple hard metal machines, when you would shoot one of those hard metal machines with a shotgun, the VM would continue to be online, as the hypervisor continues to live on. When you keep shooting, the hypervisor will eventually die, taking your VM with it.

Anonymous 0 Comments

You run a program on your computer, right? Well, a virtual machine is just another program. It’s job is to act as a reserved part of your memory and storage to host another operating system, and then programs in that.

If that seems strange, realize that your browser is a host to all the JavaScript programs web sites run on it. [Here](https://talks.dos.zone/c/en/5) your browser hosts JavaScript that emulates DOS to allow you to play old DOS games.