Virtual machines

465 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

There are some really good rundowns so far but I don’t think any match the point you were thinking about with saving the essay.

You will often hear of a VM used so that every time it is restarted it is in a known state. ie EVERY THING on the ‘disk’ is wiped when it reboots. In this use case there will normally be a network drive to save files to (this is bound to also be presentenced form another VM) that is persistent and you can retrieve your documents from.

This all used to be done in-house but more and more is being outsourced to the cloud – that are yet more VMs that may be running on a VM on real hardware (that is running in a simulation?)

Anonymous 0 Comments

**Definitions:**

A normal (or physical) PC is a device with the OS (usually Windows, Linux, or MacOS) on it’s Hard Drive and it’s specs are whatever the physical PC contains

A Virtual Machine (VM) is a program that runs a version of the OS with *allocated* specs. An emulator is a good way to look at it. So you can have a *physical* PC with 32GBs of RAM in it and then create a VM on that PC allocating 16GBs of your RAM to it.

I believe most VMs are actually on servers, which is like a PC on steroids.

When you open a VM on a PC/Server you basically make a mini PC inside of the existing PC/Server that you have. VMs are used for things like virus testing, systems testing, nefarious testing, etc. Basically the idea is IF something gets into your system AND it’s a virtual system, you can just delete the VM and everything inside it (including the bad thing).

**Examples:**

It’s basically like having a fake house as the entrance to your real house so when a burglar breaks into the fake house you can just lock everything from the outside and set it on fire. Then when it’s all done burning, build a new fake house.

OR, let’s say you want to mix some chemicals because you read something on the internet. You go to your fake house, mix the chemicals, if it goes wrong, run out of the fake house and then launch it to space. Then build a new fake house.

Then go back to your real house and go on with your life.

Fake house = VM. Real House = PC/Server.

**Your Last Question:**

>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?

Yes, but you’d be using it like a storage device, and while it’s possible to do that, it’d be easier to use your regular PC or a flash drive for that.

Anonymous 0 Comments

Not one answer has yet hit the ELI5 level. Many worthy explanations have been submitted, alas aimed at a tech level. So try this:

You don’t need to know anything about VMs, finding out won’t give you any advantage, and unless you are being technical, and not just being a user, you can’t tell when you are connected to one. They aren’t magic, they are just yet another complex software thats useful to people who have to supply and manage a lot of computers.

If, on the other hand you get interested, and want to do some IT, or developing, or hacking, then by all means read the long answers. VMs are really a wonderful bit of tech. The Cloud couldn’t run without them.

Anonymous 0 Comments

Picture that your computer is just an internet browser.

A regular computer is just like a browser with only one tab.

If you have a browser with multiple tabs, picture that each tab is a VM. Every tab is running on the same hardware, but when you are using each tab they operate essentially the same as the stand alone computer.

So in your example, you can go to one tab and type an essay. Open another tab and type an email. When you click back to your first tab your essay is still there. Your essay doesn’t know that your email exists, nor does your email know that your essay exists, even though both are running on the same computer.

Anonymous 0 Comments

A virtual machine is basically an OS (operating system) that interfaces with you and the host OS, instead of interfacing with you and the physical hardware.

Before deciding which Linux distro to put on an old, slow laptop I have kicking around, I used a VM to try a bunch of them out from Windows. The Linux distro is talking to the VM, which is just a Windows program, thinking that its talking to the hardware itself. Doesn’t run as quickly as the distro alone on a PC would (Its’s ‘Linux -> VM -> Windows -> Hardware’ instead of ‘Linux -> Hardware’), but but it let me have a taste.

The thing is, as a VM is just a program, you can have many of them running, each with a different OS, each given its own chunk of physical resources at its disposal (ram, diskspace, CPU cores etc.) so it is more useful a technology for servers. A server can have dozens of cores and hundreds of gigs of RAM running many VMs to serve clients whatever they need.

Out of that scope, the use cases get harder to justify. They can be useful in researching computer viruses to a degree, and the virus tries to do things to the OS, but with a VM the virus can think its messing with the OS, but is really just messing with the VM, and can be contained through it.

Writing an essay? Yea totally, but it will only be seen by that VM… if you use a VM to load a OS to run a program to write an essay… that VM has a chunk of disk space set aside for it, and only the VM can really access that diskspace.

Anonymous 0 Comments

Going to try and make this an extremely non technical answer.

So when people first started building houses, they had one big room. Sleeping, cooking, relaxing was done All in one shared space.
This was a vast improvement over no shelter at all, but it has limits. Someone moving around cooking is going to make it hard for the other person that might want to sleep, or the person sleeping might snore and disturb the person trying to read a book to relax.

So along comes the next improvement: Walls! Now one person can sleep, while another cooks, and another reads a book. It made the house more useful, because you can have multiple people doing different things, without getting in each other’s way.

Anonymous 0 Comments

A VM is just a program that pretends to be a computer. Where a physical computer has transistors and hard drives, a VM is programmed to simulate those. As far as the software running on a VM is concerned it’s running on a physical computer. The program just says “I want to save a document to the hard drive,” and the VM takes that document as saves it to a file on the actual machine.

It allows us to do some cool things like:

* Run multiple different machines off 1 physical computer (just like you might run Chrome and a video game at the same time)
* Quarantine users to a virtual space that makes it hard for them to mess with anything. EX: A student can’t log into their schools network at 1:00 in the morning and mess around with things they aren’t supposed to. Since it’s a VM if anything got messed with they would just delete the VM and create a new one, no different than deleting a Word doc.

Anonymous 0 Comments

On the hypervisor level (the operating system, software, and/or hardware that the VM is actually running on), the VM is just a process, no different than any other.

The hypervisor, through whatever method, provides what looks like hardware to a process inside of it. An abstracted CPU, for example, basically just sees a fake CPU (vCPU) send instructions to a real CPU, which is connected to the hypervisor process.

The benefit is utilization. Your car can drive 175kph. Yet you never do. That horsepower is there because you need to be able to accelerate at a reasonable pace. When you aren’t using that extra horsepower though, it’s not really doing you any good.

Virtualization is the same. A computer will generally have spikes of usage and lulls in usage… but they’ve got their horsepower just to deal with those spikes. So by combining multiple virtual machines onto one set of hardware, that hardware just handles all of those spikes (since they don’t generally happen at the same time). Net result is the hardware sees a lot more utilization on average. Which saves money because you buy less hardware.

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).

Anonymous 0 Comments

Trying a more ELI5 answer:

A Windows computer is able to use the physical components of a computer to run softwares. These softwares can do pretty much anything, including emulating physical components, and therefore run a Windows computer on these emulated components. This is how you can run windows inside a Windows!

But there is not much point to do that, however let’s imagine you have a very specific software you love, such as a mobile game, or an old Windows app, or a Mac or Linux software. You can’t run it on your current system.. but you can run a virtual system on your Windows, and finally run the software you want on this virtual system 🙂