|
Pardon the dust! This page includes some jargon that hasn't been added to the site's glossary yet. I'll be around to fix this later, but sorry for the inconvenience in the meantime. |
Virtual Machine 101
Quick Overview
A virtual machine, in simple terms, is a special type of program that can pretend to function like an actual computer. If this seems too incredible, think about it this way: software is just a bunch of 1s and 0s, so anybody who knows how to decode these numbers could use them in any way they want - even "fool" them into thinking they are existing and running on a real machine!
Of course, you won't need to go into quite that much detail if you'd like to try it yourself. There are already plenty of tools out there that manage virtual machines for you. All you need to do is provide the computing power and the software you'd like to run.
A word of caution though: virtual machines use a lot of resources. You're literally asking your computer to hold another computer within itself, so if your computer doesn't play modern games well, it probably won't be able to handle running virtual machines either.
But if it can, then you'll be able to open many new doors and explore a whole new realm of computing!
Or you could just run some games that can't run natively.
The choice is up to you.
Of course, you won't need to go into quite that much detail if you'd like to try it yourself. There are already plenty of tools out there that manage virtual machines for you. All you need to do is provide the computing power and the software you'd like to run.
A word of caution though: virtual machines use a lot of resources. You're literally asking your computer to hold another computer within itself, so if your computer doesn't play modern games well, it probably won't be able to handle running virtual machines either.
But if it can, then you'll be able to open many new doors and explore a whole new realm of computing!
Or you could just run some games that can't run natively.
The choice is up to you.
Legal Issues
Being able to run software doesn't mean you have the legal right to do so. Using virtual machines legally requires you to have a proper license for the operating system and the programs you'll be running on it.
Put simply, you'll only be able to legally run Microsoft Windows or other non-free programs in your virtual machine if you've purchased them. This includes older versions of Windows, as they are still protected by copyright. If you're interested in running them, check eBay or some other reputable storefront.
Fortunately, this is actually the exception, not the rule, when it comes to modern operating systems. The majority of operating systems out there today are open source, which means you're allowed to run them in your virtual machines to your heart's content.
By the way, if you're just trying to run some old Windows games, you don't need to bother going through all the trouble of setting up a virtual machine. There's a pair of open source tools called WINE and WineVDM that can handle this for you.
Put simply, you'll only be able to legally run Microsoft Windows or other non-free programs in your virtual machine if you've purchased them. This includes older versions of Windows, as they are still protected by copyright. If you're interested in running them, check eBay or some other reputable storefront.
Fortunately, this is actually the exception, not the rule, when it comes to modern operating systems. The majority of operating systems out there today are open source, which means you're allowed to run them in your virtual machines to your heart's content.
By the way, if you're just trying to run some old Windows games, you don't need to bother going through all the trouble of setting up a virtual machine. There's a pair of open source tools called WINE and WineVDM that can handle this for you.
Some Downsides to Virtual Machines
As wonderful as this sort of technology is, there are some drawbacks, as no virtualization program is able to perfectly reproduce the quirks and software environment of a real computer.
Perhaps the biggest issue is that virtual machines will always suffer from timing issues. Since there's a level of abstraction involved, a virtual machine will always be slightly slower than a real computer.
Aside from being slightly slower, timing features may not be able to be consistent with how long a millisecond lasts. Sure, 10 millionths of a second gained or lost isn't generally a problem, but it's enough to make a video have a visible stutter. This issue can be made worse by other software running on the host, as those other programs will "steal" time from the virtual machine.
Another issue is that some technologies may not be supported by the virtualization tool you're using. As an example, VirtualBox doesn't have support for MIDI playback. This isn't much of an issue with newer software, as the MIDI era ended a few decades ago, but this does mean that you won't always get the full experience when using it for retro gaming.
Ultimately, virtual machines aren't perfect recreations of computers. They're close enough, and sometimes that's all that matters.
Perhaps the biggest issue is that virtual machines will always suffer from timing issues. Since there's a level of abstraction involved, a virtual machine will always be slightly slower than a real computer.
Aside from being slightly slower, timing features may not be able to be consistent with how long a millisecond lasts. Sure, 10 millionths of a second gained or lost isn't generally a problem, but it's enough to make a video have a visible stutter. This issue can be made worse by other software running on the host, as those other programs will "steal" time from the virtual machine.
Another issue is that some technologies may not be supported by the virtualization tool you're using. As an example, VirtualBox doesn't have support for MIDI playback. This isn't much of an issue with newer software, as the MIDI era ended a few decades ago, but this does mean that you won't always get the full experience when using it for retro gaming.
Ultimately, virtual machines aren't perfect recreations of computers. They're close enough, and sometimes that's all that matters.
Hosts and Guests
Now, things can get very confusing very quickly when we're talking about multiple computers at once. With virtual machines, you're working with at least two computers - one that's real and one that isn't - so we need some way to tell them apart. This problem is easily solved by adopting the proper terminology, namely the words host and guest.
The host is the real computer. It's the one that the virtual machine is running on, and it's the one that'll continue to exist when the virtual machine is closed or erased. The host system always needs to have enough resources available to run itself and any virtual machines you create.
The guest is any operating system running within a virtual machine. While you can only have one host per computer, you can have as many guests as you want - the only limit is how many resources the host has available.
Also, it's important to remember that guests only need access to certain resources when they are actively running. For instance, when the guest is "turned off", it won't need access to the host's CPU or RAM anymore. But on the other hand, the guest's storage media will still take up space on the host's hard drive.
The host is the real computer. It's the one that the virtual machine is running on, and it's the one that'll continue to exist when the virtual machine is closed or erased. The host system always needs to have enough resources available to run itself and any virtual machines you create.
The guest is any operating system running within a virtual machine. While you can only have one host per computer, you can have as many guests as you want - the only limit is how many resources the host has available.
Also, it's important to remember that guests only need access to certain resources when they are actively running. For instance, when the guest is "turned off", it won't need access to the host's CPU or RAM anymore. But on the other hand, the guest's storage media will still take up space on the host's hard drive.
Some Brief Words on Virtual Hardware
Virtual machines mimic real computers. This means they have the same types of hardware as a real computer, like a motherboard, CPU, and various adapters. When you create a virtual machine, you'll be prompted to specify what components should be available to the guest.
The first thing you should know is that this isn't asking you for information about the host. It's asking for you to choose what sort of hardware the virtual machine should pretend to have. In other words, these are the parts that the guest will think is plugged into its various ports and sockets.
The main catch here is that the guest needs to have the proper device drivers for the parts you've supplied for it. Without the right driver, the guest won't know how to use the hardware its been given, so some features might not work until you've tweaked the virtual machine's settings a little.
One of the nice things about VirtualBox is that you'll rarely need to change these from the defaults - once you've selected what operating system a virtual machine will be running, VirtualBox helpfully selects the best parts for it.
The first thing you should know is that this isn't asking you for information about the host. It's asking for you to choose what sort of hardware the virtual machine should pretend to have. In other words, these are the parts that the guest will think is plugged into its various ports and sockets.
The main catch here is that the guest needs to have the proper device drivers for the parts you've supplied for it. Without the right driver, the guest won't know how to use the hardware its been given, so some features might not work until you've tweaked the virtual machine's settings a little.
One of the nice things about VirtualBox is that you'll rarely need to change these from the defaults - once you've selected what operating system a virtual machine will be running, VirtualBox helpfully selects the best parts for it.
Storage Media
Unsurprisingly, an operating system needs some place to store information. The host has their own hard drive, which is a physical piece of hardware built into the machine itself. Virtual machines need a place to store data too, but instead of using a real hard drive, they'll use many different types of files, often known as images.
The most common, and most accessible, type of virtual storage media are raw images. These are files that use raw bytes to represent a form of digital storage, like a hard drive, floppy disk, or CD-ROM. Files like these can actually be accessed like a real external file system by both the guest and, with the right software, the host.
However, the trade off for that ease of access is that the files aren't compressed or encoded in any way, which means they take up the same amount of room as the information they are capable of storing. This isn't much of an issue with images of floppy disks, as those are only about 1.5 megabytes each (roughly half the size of a photo you took with an iPhone) but that becomes a problem with we're talking about larger images, like CD-ROM or hard drive images.
CD-ROMs can take up to 700 megabytes, while DVDs can use more than 3,000 megabytes per file. Hard drive images are the real heavyweights, often using over 20,000 megabytes.
There are, thankfully, alternatives. Just about every virtual machine tool has its own specialized format for storing hard drive images in a more compact way. For example, a format may store only the parts of the drive that have been written to. This way, empty space isn't included in the image file itself.
The main tradeoff with using these specialized formats is that other software probably won't know to access the data inside these files. Since getting files out of a virtual machine can be tricky on a good day, this could make an already difficult situation worse. Another trade off is that it might take slightly longer for a guest to access these images - the data in them needs to be decoded before it can be read or written.
Regardless of which method you pick, you'll need to have a large hard drive on your host machine in order to provide enough storage space for your virtual machines.
The most common, and most accessible, type of virtual storage media are raw images. These are files that use raw bytes to represent a form of digital storage, like a hard drive, floppy disk, or CD-ROM. Files like these can actually be accessed like a real external file system by both the guest and, with the right software, the host.
However, the trade off for that ease of access is that the files aren't compressed or encoded in any way, which means they take up the same amount of room as the information they are capable of storing. This isn't much of an issue with images of floppy disks, as those are only about 1.5 megabytes each (roughly half the size of a photo you took with an iPhone) but that becomes a problem with we're talking about larger images, like CD-ROM or hard drive images.
CD-ROMs can take up to 700 megabytes, while DVDs can use more than 3,000 megabytes per file. Hard drive images are the real heavyweights, often using over 20,000 megabytes.
There are, thankfully, alternatives. Just about every virtual machine tool has its own specialized format for storing hard drive images in a more compact way. For example, a format may store only the parts of the drive that have been written to. This way, empty space isn't included in the image file itself.
The main tradeoff with using these specialized formats is that other software probably won't know to access the data inside these files. Since getting files out of a virtual machine can be tricky on a good day, this could make an already difficult situation worse. Another trade off is that it might take slightly longer for a guest to access these images - the data in them needs to be decoded before it can be read or written.
Regardless of which method you pick, you'll need to have a large hard drive on your host machine in order to provide enough storage space for your virtual machines.
Mouse Capturing
If you've played a lot of games, then there's a good chance that you've seen a program use this technique before. Programs can "grab" the mouse cursor, restricting its movement to a small portion of the screen. This is known as "capturing" the mouse, and it's often used by virtual machines to handle mouse input.
When you click on a virtual machine's window, it will typically capture the mouse and hold on to it until a specific key is pressed. While captured, the mouse's input is redirected to the guest system. Once the mouse has been released, the guest won't see any mouse input until the virtual machine captures the mouse again.
This is a good way to avoid accidental clicks and handle the problems of the mouse moving outside of the guest's screen area, but it can be a little frustrating until you're used to it.
For the curious, VirtualBox uses the right CTRL key as the signal for the virtual machine to let go of the mouse.
When you click on a virtual machine's window, it will typically capture the mouse and hold on to it until a specific key is pressed. While captured, the mouse's input is redirected to the guest system. Once the mouse has been released, the guest won't see any mouse input until the virtual machine captures the mouse again.
This is a good way to avoid accidental clicks and handle the problems of the mouse moving outside of the guest's screen area, but it can be a little frustrating until you're used to it.
For the curious, VirtualBox uses the right CTRL key as the signal for the virtual machine to let go of the mouse.
Enhanced Features
Normally, the host and guests are kept separate by a layer of abstraction. The guest doesn't know anything about the host, and the host isn't allowed to poke around the guest's internals. But virtual machines don't need to isolate themselves this much - if the guest has the right drivers, then the virtual machine can become more integrated with the host.
Some operating systems, especially more modern Linux distros, are clever enough to recognize when they're being run in a virtual machine and activate these special drivers automatically. Alternatively, if your virtualization software comes with a disk image containing these drivers, you can install them manually.
Not all of these enhanced features work with every operating system, and sometimes they don't even work when the drivers are installed properly. But when they do work, it can make working with virtual machines a lot easier.
Here's an overview of some things that are possible with these nifty features.
Some operating systems, especially more modern Linux distros, are clever enough to recognize when they're being run in a virtual machine and activate these special drivers automatically. Alternatively, if your virtualization software comes with a disk image containing these drivers, you can install them manually.
Not all of these enhanced features work with every operating system, and sometimes they don't even work when the drivers are installed properly. But when they do work, it can make working with virtual machines a lot easier.
Here's an overview of some things that are possible with these nifty features.
Mouse Integration
Instead of capturing the mouse, the virtual machine will attempt to handle the mouse like any other program. In other words, moving the mouse over the virtual machine's window or clicking on it will move or click the mouse in the guest system. This makes the virtual machine feel more like a normal program rather than something intruding on your host machine.
Unfortunately, this doesn't always work, so you may need to disable it with some virtual machines.
Unfortunately, this doesn't always work, so you may need to disable it with some virtual machines.
Clipboard Integration
Although the host and guest operating systems share the same computer, they each have their own clipboard. This means that you can't copy and paste things between the host and guest - they aren't looking in the same place.
This all changes if the guest offers clipboard integration: now the guest and host will be looking in the same place, and they can use the familiar copy and paste techniques to share data with each other!
This all changes if the guest offers clipboard integration: now the guest and host will be looking in the same place, and they can use the familiar copy and paste techniques to share data with each other!
Desktop Integration
One of the quirks of virtual machines is that you can't resize their windows - or if you can, then you typically get a larger frame rather than a larger picture. This is because the guest system is displaying itself with a certain screen resolution. In order to change the size of the virtual machine's screen, you'll need to change its display resolution from within the virtual machine.
The desktop integration feature fixes that, automatically adjusting the guest's resolution so that it matches the size of the window.
It's a nice feature, but unfortunately, I have seen this result in virtual machines crashing, so use it with caution.
The desktop integration feature fixes that, automatically adjusting the guest's resolution so that it matches the size of the window.
It's a nice feature, but unfortunately, I have seen this result in virtual machines crashing, so use it with caution.
Shared Data
Getting data into and out of a virtual machine can be surprisingly difficult, so it's no surprise that virtualization tools have come up with ways to get around this problem. Depending on the tools you're using, you may be able to access the guest's files directly through the virtualization tool itself, or you might be able to set up a shared folder that the host and guest can both access.
VirtualBox can handle shared folders, but it also offers a very nice file manager feature that works like an FTP client. If the latter is available, I'd recommend using it!
VirtualBox can handle shared folders, but it also offers a very nice file manager feature that works like an FTP client. If the latter is available, I'd recommend using it!
Further Reading
If this sounds like something you'd like to try, I have several other guides on here to help you explore the possibilities - just have a look at the virtualization hub!