Virtual Machine Basics
We’ve got a lot to cover with you in this lesson, so buckle up.
First, we’ll begin with easy basic questions to warm up your brain cells.
Second, you’ll see a comprehensive FAQ that lists the 17 top asked questions (with answers) about virtual machines.
When you’re done, you’ll know more than most sysadmins do about how VMs work.
Third, we’ll help you scale up your VM skills to the next level one step at a time…
Let’s get going…
What is a Virtual Machine?
x86-64 virtual machines have been around since about 1998.
Prior to VMs, buildings would literally fill up with 100s of hot physical rack and tower servers that only did one thing.
Also known as a VM, they are now widely used everywhere in the world to do almost anything a bare-metal server used to do.
I recall my first experience with VMs in late 1999 while working for Northrop Grumman IT.
A developer at Yuma Proving Ground (where I was a government contractor) wanted VMware.com beta installed on his laptop and I was tasked with handling the installation.
That was my first peek at a new technology that would change the server deployment process forever.
Everyone everywhere started building bunches of virtual servers using any physical server they had available.
In hindsight it’s obvious that VM performance would become a problem, right? We’ll get to that later on.
You can read more about this experience in – what is a hybrid cloud?
Video Training – What are VMs?
What is a virtual machine used for?
In the beginning, virtual machines were only used for development.
But that has changed.
Now VMs are used to provide isolated environments for testing, development, production, disaster recovery, and physical server consolidation.
There are many innovative uses for VMs across every industry.
A couple of examples are bitcoin mining and cloud infrastructure.
Virtual Machine Example:
The reason for their popularity is that you can run multiple different operating systems on a single physical computer (server, desktop, or laptop).
You can also use them in schools where each student has their own virtual computer to work on instead of taking up valuable lab space with a bunch of expensive physical computers.
Virtual machines can also be used by people who want to test apps without installing them on their computer’s hard drive first.
And finally, there is no limit on how many virtual machines you can create as long as you have enough physical storage space, CPU, and memory, making them great for enterprise data centers.
To start building your own VMs now: Download Free VirtualBox Software
Advantages of Using Virtual Machines:
#1. Virtual machine disks are portable. You can create a disk image on one computer and copy it to another where you can run it as if it were installed locally.
#2. Virtual machines provide isolated environments which can be configured differently, and you can use snapshots to return to a previous state if something goes wrong.
#3. Virtual machines only need as much disk space as is needed for the installation of the guest OS* plus any software that requires installation on top of it. This makes them less wasteful than physical computers where you typically have many GBs or even TBs of free space, memory, and CPU power left unused after the OS has been installed.
#4. Virtual machines are easy to set up. All you need is the desired guest OS installation media (including any required drivers) and an ISO of the desired operating system you want to install on the VM.
Note: A guest OS is an operating system that is installed on the VM such as any of the many versions of Windows, Linux, or other hardware compatible OS. VMs are also known as guests.
Some Disadvantages of Using VMs:
#1. Virtual machines are slower than physical computers. This is because they have to share resources with the host*, which can become a problem when you start building advanced systems with large transaction databases or apps with a lot of users. This is not as noticeable with today’s multi-core Xeon Processors as it was a problem decades ago.
#2. Not all physical hardware functionality such as HD graphics and sound can be used within a VM. This is also improving, but there are still some edge cases where VMs are not a good substitute for a physical computer.
#3. When too many VMs are created on the same host, you can experience poor performance. This is also known as over-subscribing resources.
Note: Host is what the computer is called that is hosting the VM with a guest OS.
As we’ve briefly covered in this introduction, virtual machines are an important technology. They are used everywhere where servers are deployed.
In the FAQ below, we will try to answer many of the questions you might have.
Virtual Machine Software Download
You can download and use a few popular virtual machine software products (free and paid) to create VMs.
Some of these software products can be installed on a desktop OS (Windows, Linux, macOS). Whereas, others install directly on the hardware and run as the OS (you’ll learn about the difference in the FAQ).
These downloads include some of the more popular installs such as VMware ESXi, Workstation and Player, Oracle VirtualBox, Parallels, Hyper-V, and Apple Boot Camp for Mac.
Challenge yourself with advanced: Virtual Machine Software Alternatives
Virtual Machine FAQ:
What is virtualization?
Using a hypervisor, virtualization is the overall concept that allows multiple operating systems to share common hardware resources in a safe and efficient manner. For example, Linux distributions can be run on the same host as Microsoft Windows without requiring any modifications to either system.
Virtualization allows us to maximize resource utilization while also improving security, stability, and workload management for complex computing environments.
It also gives system administrators more flexibility to manage large numbers of computing resources.
Virtualization is a strategy used by IT to perform server consolidation, maximizing hardware resource utilization while also improving security, stability, and workload management for complex computing environments.
More concepts for you: Introduction to Virtualization for Beginners
What does a virtual machine do?
Virtual machines are an important technology because they allow for isolated testing and development environments, disaster recovery, and server consolidation.
Additionally, virtual machines are very portable and can be moved from one physical system to another without any changes being required to the guest operating system or applications.
They allow for the sharing of physical resources in a safe and efficient way that would be difficult without virtualization.
Virtual machines also provide valuable flexibility that makes them an important part of all types of IT environments.
What’s the best virtualization software for home lab?
As you see there are quite a few VM software options you can use.
If you’re building a home lab to use for your training, this guide will help you build a home server lab for testing and training.
What are other ways a VM can be created?
Virtual machines can be created by cloning an existing physical computer, or by using a template to create a new virtual machine. A VM image can be stored on a local disk, network file share, or in the cloud.
Can a VM be turned off?
Virtual machines can be started and stopped as needed, and they can be moved between physical computers.
When a virtual machine is stopped, its state is saved to the virtual machine image.
When the virtual machine is restarted, it resumes from the same state that it was in when it was last stopped.
What is virtual hardware?
Each VM has its own virtual hardware devices that are presented to the guest operating system on top of which applications run.
Virtual machines do not share real hardware, instead, they use software versions of hardware (called emulated devices) in order to prevent conflicts. This isolates the guest OSs from each other and from the host OS.
The software emulation of hardware also helps performance because the hardware resources are divided out among the VMs and only shared as needed.
Stills confused? Here’s a book for you: Virtual Machines for Dummies
Working with Virtual Machines
What is a VM image?
A VM image, also known as a template, can be used to deploy VMs with a base OS and configuration.
There are many images and templates available online or from cloud providers for different OS builds and uses.
Virtual machines that are located in the cloud offer additional flexibility because they can be started at any time and accessed from anywhere.
Cloud providers typically rent out VMs to customers for a fixed period of time or on a pay-per-use basis.
Are VMs portable?
Virtualized systems are very portable and can be moved from one physical system to another without any changes being required to the guest operating system or applications.
This makes virtual machines a popular choice for development and testing. If you search the web you’ll find many sites with Linux, Windows, and even macOS virtual machine down image files that you can import in VirtualBox.
What is a P2V?
A P2V (physical to virtual) is when you convert a physical computer system to a virtual computer system.
A full copy of the host OS and its files and applications are copied to a VM during this process. This is a popular process for optimizing hardware and space in a data center.
Once the P2V is completed successfully, the original server is usually decommissioned or reused as another virtual host.
Are VMs and containers the same?
No, virtual machines and containers are not the same.
A virtual machine is a software computer that can run its own operating system and applications, while a container is a lightweight instance of an operating system that shares the kernel of the host system.
Containers are used to package and run applications, while virtual machines use a complete operating system to run applications.
What is an OVA file?
An OVA file is an Open Virtual Appliance, also called an Open Virtual Application.
These are files that can be imported directly into a hypervisor with preconfigured settings for devices such as load balancers, firewalls, network switches, and even Android simulators.
What is a virtual server?
A virtual server is a VM that has a server operating system such as Windows Server installed.
Many data centers have hundreds of virtual servers running on larger clusters of hypervisor hosts.
What is a virtual desktop?
A virtual desktop is a VM that has a desktop operating system such as Windows 10 installed.
Many of the free and open-source virtual machine software alternatives are great for creating a virtual desktop environment for testing.
What is a virtual private server (VPS)?
A virtual private server is basically a virtual server that is offered by a cloud provider.
Many VPS providers such as BlueOcean, Vultr, Linode, and NameCheap allow you to deploy a VPS and pay monthly for only what you use.
The great thing about a virtual machine in cloud computing is that you can customize the size of the VPS via a dashboard. You get to choose the CPU, memory, storage, OS, application, and other special offerings.
Spin-up a virtual private server in the cloud: Best VPS Alternatives
Types of Virtual Machines
What is a virtual host?
A virtual host is a computer that is running virtualization software.
When the virtual host is physical server hardware without a preinstalled OS, a bare-metal hypervisor such as ESXi, Xen, or KVM is used. These are known as type 1 hypervisors.
When the virtual host physical desktop hardware has a preinstalled OS such as Windows 10, a host OS hypervisor such as VMware Workstation, VirtualBox, or Parallels is used. These are known as type 2 hypervisors.
Both, type 1 and type 2 hypervisor hosts allow you to create and run multiple virtual machines on one physical computer.
What is a hypervisor?
The first type of hypervisor was developed for IBM mainframes in 1967. How things have changed.
Unlike IBM’s hypervisor for a mainframe, the hypervisor we’re discussing is a virtual machine software that manages virtual machines’ creation, use, and deletion.
The hypervisor software is installed on physical x86-64 hardware (not a mainframe). It then emulates copies of the physical computer hardware. When a VM is created it presents a complete virtual hardware platform to each guest operating system.
As long as there are enough resources, you can keep adding VMs to a virtual host. I’ve managed 40 VMs on a single host with 256 GB of memory and dual 12 core CPUs. This is why type 1 hypervisors are used in data centers to increase physical hardware and space efficiency and utilization.
There are many type 1 hypervisor alternatives available on the market today.
VMware ESXi is the most popular for private data centers. While MS Hyper-V, Citrix Xen, and Linux KVM are used broadly in public clouds.
What causes slow virtual machines?
When building fast virtual machines like a professional consider these best practices.
#1. Virtual adapter – One possible cause of slow virtual machines is a misconfigured virtual adapter.
When a virtual machine is created, a virtual adapter is also created.
This adapter can be used for communication between the virtual machine and the host operating system and other virtual machines on the same host.
If this adapter is not properly configured, it can cause the virtual machine to run slowly. In some cases, it may even be necessary to disable the adapter in order to improve performance.
#2 USB devices – Another possible cause of slow virtual machines is the use of USB devices.
When a USB device is attached to a virtual machine, it is redirected to the virtual machine from the host operating system.
This can cause a decrease in performance, particularly if the USB device is used for intensive tasks.
If possible, it is recommended that you do not use USB devices in virtual machines.
#3 System resources – Finally, another possible cause of slow virtual machines is the use of too many resources.
When a virtual machine is created, it is given a certain amount of resources that it can use.
If these resources are exhausted, the virtual machine will run slowly.
You can prevent this by ensuring that your virtual machines do not use more resources than they need.
These are only a few items to consider when building high-performing VMs. There are more…
When you’re ready for the Pro-level stuff: VMware vSphere Training
Virtualization in Cloud Computing
What is the role of virtual machines in cloud computing?
Virtual machines (VMs) have a critical role in cloud computing.
They provide the abstraction layer between the underlying physical hardware and the applications and services that run on top of it.
This allows providers to offer flexibility and elasticity to their customers, who can scale their usage up or down as needed without having to worry about the underlying infrastructure.
VMs also offer isolation and security, which are crucial in a shared environment like the cloud.
Each VM has its own operating system and can be isolated from others, preventing one customer from impacting the performance or stability of another.
This is an important consideration for businesses that are looking to use the cloud for mission-critical applications.
Overall, VMs are a key part of what makes cloud computing possible and without them, the cloud would not be able to offer the same level of flexibility, scalability, and security.
We will cover more about cloud concepts in later lessons.
Virtual machines are a great way to run different operating systems on one computer.
In this guide, we’ve introduced virtual machines and shown you how to set up your own virtual machine.
We’ve also given you some tips on what software to use and how to get started with virtualization.
If you want to learn more about virtual machines, check out our other guides.
Thank you for reading this Introduction to Virtual Machines guide. If you still have questions please leave them in the comments…