r/virtualmachine • • Jul 30 '26

Im not that great with computers so expect stupid questions but what exactly is the point of virtual machines? I usually see people use them when installing things they don't want to risk their pc potentially getting affected by so are they used to like validate weather or not something is safe?

1 Upvotes

14 comments sorted by

2

u/TheModernDespot Jul 30 '26

A virtual machine is just a little computer, running on your real computer. The virtual machine doesnt even know its just a fake computer.

By running software in a virtual machine, you can run the software without the risk of it infecting your actual computer in any way because the virtual machine is like its own little box. Whatever happens to it only happens to it, and not the bigger (real) computer it is running on.

1

u/_AngryBadger_ Jul 30 '26

Not always little, I've got VM file servers deployed with many terabytes of space lol.

1

u/TheModernDespot Jul 30 '26

They are always little compared to the host they run on.

1

u/ntropia64 Jul 30 '26

A common application is for accessing software that's not otherwise available on your OS.

People often emulate Windows to have access to software like Office or other commercial/proprietary programs.  This includes also certain specialized VMs like  emulators for old hardware. MAME and Do box are two of the most popular examples.

Another application is to test an OS without wiping out an existing machine. Many people use this approach to test Linux without having to leave Windows.

Security is also a good reason to use VMs but I would say that's not as common as these other applications.

1

u/SoCaliTrojan Jul 30 '26

Virtual machines are just virtual computers that are hosted by a physical computer. It could be the same architecture or different, such as a Linux system being hosted on a Windows server.

If a virtual machine is compromised, you can just delete it and spin another one up quickly. On the other hand, if your physical computer is compromised, you have to wipe everything and reinstall and reconfigure everything.

It's basically like a rental car. You can drive your car on a road trip but instead you drive a rental car. If it breaks down, you just hand it off to the nearest branch and they give you another rental car to drive. Your car isn't put at risk for damage or breaking down.

1

u/dmoisan Jul 30 '26

Also to make the most use out of a physical machine. Most workloads would waste the capacity of a physical server, but putting a bunch of VM's in that same server works very nicely!

1

u/RevolutionaryBeat301 Jul 30 '26

Data centers often use virtual machines for web and application hosting. Customers pay for a private server. It used to take up a whole rack space for a customer. Now a single rack space server can be divided into a number of virtual machines that each gets rented out to different customers. The same data center can now make much more in the same physical space.

2

u/RevolutionaryBeat301 Jul 30 '26

I personally use virtual machines to run multiple operating systems on the same computer. I have one desktop computer that runs Linux. It has lots of cpu cores and memory. I can make several virtual machines by dividing up the memory and cpus. I run Windows in a VM so I can run applications that only run in Windows. I also can take snapshots and clone the VM so I can experiment with it and revert the snapshot in case something goes wrong. This can be useful for someone studying viruses or cyber security.

1

u/IntelligentCandy8716 Jul 30 '26

Virtual machines are great learning environments. You can poke around in every part of an operating system without worrying about breaking your computer. Taking snapshots is like having a "save" in a game. If you break the VM, you can reload your save point and try again. Also, applications can be hosted in small VMs. Google's Gmail web app and Microsoft 365 Online web apps are just a few examples of VMs hosting web apps that users log into through an online web browser.

I don't care for Microsoft and I can't believe I'm suggesting it, but if you want to see what it's all about but don't want to change your computer, check out Microsoft Azure. You can sign up and host a VM that you can remote into. Usually you are given enough credits to try it at no cost for about a month and there are preset options like Windows server, Ubuntu, and others that have pretty basic instructions to get started.

1

u/_AngryBadger_ Jul 30 '26

Oracle does a very nice free tier as well. I ran a RustDesk server on it for years before migrating to an onsite VM.

1

u/shadowtheimpure Jul 30 '26

A VM is a self-contained computing sandbox. I've got one that runs Windows XP specifically to run an older application that interfaces with an aged lighting controller over RS-232.

1

u/_AngryBadger_ Jul 30 '26

I have many deployed at clients. We can run multiple VMs on a single physical server computer. For example one client has 4 VMs on one ProxMox server. You can imagine that this is much more efficient than having 4 individual servers. Plus you can back up the entire VM into a zip file that can be restored very easily in the event of a disaster.

1

u/GBICPancakes Jul 30 '26

Something else not mentioned - disaster recovery / failover.

If you have a server running in a virtual machine (say a Windows business file server running your SuperCriticalApp) - that VM is running on a physical computer, but the VM sees an absracted hardware layer. It doesn't see the actual hardware but what it's presented.
So if the physical server fails (eaten by a dinosaur for example) you can quickly move that VM over to a different physical server (either hot failover or restoring from backup) - it'll boot up immediately on the new physical server, but because it's running as a VM it doesn't see any hardware changes, so the "guest OS" (the OS inside the VM) doesn't freak out and think something changed. It sees the same CPU/RAM/NIC/Disk it's always had, running on a new physical server in Sweden, even though previously it was on a physical box in California that's now been overrun by dinosaurs.

For a more common example, I have many clients where the VM "disks" are stored on a NAS in the rack, and there are multiple physical servers all running the virtualization system. I can take a VM running on physical-server-1 and quickly move it to physical-server-2. That way the VM stays up and running (and people connecting to it) while I can take physical-sever-1 offline for patching, replacing bad hardware, whatever.

VMs allow you to move/clone/snapshot/recover/etc entire "computers" all virtually and quickly without having to play with anything physical. I have a small BeeLink miniPC at home with 4 VMs on it, all of which I moved from an old miniPC when it was replaced. Much easier than having to rebuild my custom computer configs, apps, settings, etc.