Virtual machines

1.24K views

I’m trying to understand them a bit better, but it’s just not clicking for me. How is it able to operate like a physical computer and what is the benefit of that? Would you be able to say write an essay for your English class on a VM, save it there, and access it at a later time?

In: 49

21 Answers

Anonymous 0 Comments

> How is it able to operate like a physical computer

An OS is software that runs on a CPU. The OS uses CPU instructions to “talk” to hardware devices. The VM software tells the CPU that if it encounters such an instruction, rather than following the instruction “for real”, the CPU should instead execute a subroutine in the VM software. The VM’s subroutine is designed to “pretend” to execute the instruction. For example, if the instruction says to overwrite hard disk sector 537, instead of overwriting sector 537 on the actual physical hard disk, it overwrites sector 537 in a file that represents the VM’s hard disk.

> what is the benefit of that?

Some software only works with certain OS’s, certain OS versions, or certain versions of other software. In the days before VM’s this was very painful:

– Stop using your current OS
– Buy an extra PC just to install the OS you need and run the software
– Install a second OS on your PC in a “dual boot” configuration; you have to reboot your PC to change OS’s

There are some benefits for software developers:

– Quick and easy to test your software’s installation works on a “clean” OS that’s never had your software installed before.
– Quick and easy to test your software on different OS’s
– Quick and easy to recover if you have some kind of problem that prevents the system from starting, e.g. critical files deleted or OS misconfigured
– VM’s are very useful for developing or debugging the OS itself

And finally VM’s are *incredibly* useful in all sorts of commercial applications for fundamental economic reasons:

– *If you’re a cloud provider* who rents out computers, you want to buy a $20,000 computer with an enormous amount of memory and number of processors, because it’s a lot more cost efficient in terms of computing power per dollar spent compared to, say, buying 40 $500 computers (especially once you account for costs beyond the purchase price, e.g. floor space, installation, maintenance, electricity, cooling, etc.)
– *If you’re a cloud customer* who wants to rent out a computer, you often want a smaller computer — even the $500 model is overkill for many applications. You also want the flexibility to upgrade or downgrade the size and number of computers you rent as your business needs change.

VM software allows a cloud provider to carve up large machines into smaller pieces. This allows them to respond to what their customers want to rent right now. From the customer’s point of view they can fully customize the machine’s software and OS (a major pain point for so-called “shared hosting providers” that existed before cloud computing took off).

You are viewing 1 out of 21 answers, click here to view all answers.