What is Virtualization?
There are different ways that virtualization is used. Generally speaking, it involves creating a virtual version of hardware in software. However, virtualization can also be used to virtualize software usually for security purposes.
For example, let’s say that we have a virtual machine. A virtual machine is essentially a computer that has been completely virtualized. In this example, I will consider only the hard disk. All the devices in the virtual machine have a virtual counterpart. These devices will appear to the virtual machine as if they are physically connected devices; however, they are virtual devices existing only in software. The operating system, in most cases, won’t be able to tell the difference.
In this example, the virtual hard disk will connect to a software layer. The software layer translates the instructions received by the virtual hard disk to physical hardware. In the case of hard disks, generally this means the commands from the virtual hard disk will be translated to a virtual hard disk file or a physical storage device.
Using virtualization, you have a great feature where the data from the virtual hard disk can be stored in a file rather than on traditional storage. This makes it easy to move the file, and you also have the ability to have the file increase in size as data is added.
Having the virtual hard disk data stored in a file can decrease storage performance. However, with improvements in virtualization, this decrease in performance has become very small. If you are concerned about this, you have the option to directly access a physical storage device. For example, the virtual machine could directly access a storage device like a solid-state drive or hard disk.
Virtualization can improve efficiency and has other benefits. For example, having a computer virtualized makes it easier to move from one computer to another. You simply need to copy the files and configuration to the new computer. If it supports the same virtualization solution, import the files and run the virtual machine.
Using virtualization can more efficiently use resources. For example, if you have a number of physical computers, each physical computer will require its own memory. Using virtual machines, all the virtual machines can use a pool of memory, which reduces the total amount of memory that you require.
In the case of virtual machines, let’s have a look at how virtual machines are run by the computer.
Hypervisor
A software layer is used to create and run virtual machines. This layer is called a hypervisor. Hypervisors come in two main types.
The first type of hypervisor, type-1, connects directly to the hardware. The virtual machines connect directly to the hypervisor. Type-1 hypervisors are pretty fast and efficient because there is only one layer between the virtual machines and the hardware. Depending on the virtual machine solution, this may be part of an operating system or run as a standalone system.
The other type of hypervisor is type-2. Hypervisors generally only come in one of these two types. In type-1, the operating system connects directly to the hardware. This is often referred to as the host. The hypervisor runs on top of the operating system. Like before, the virtual machines connect to the hypervisor.
Type-1 hypervisors are generally faster than type-2. However, type-2 hypervisors have improved. Depending on what you are doing, you may not see much difference in performance between the two. If you are running production servers, you would generally use a type-1 hypervisor. If you are testing or trying to run old software, you may want to consider type-2.
Let’s have a closer look at Type-2.
Type-2 Virtualization
There are many different type-2 virtualization solutions available. VMware has a free-for-personal-use VMware Workstation Player. VMware is the market leader when it comes to virtualization solutions. VMware Player, for a free product, has quite a lot of features. It is available on both Windows and Linux.
The old versions would not allow you to create virtual machines; however, this is no longer the case. The biggest feature, in my opinion, missing from VMware Workstation Player is the snapshot feature. This allows you to save the current state of the virtual machine and restore it back to that state later on if you wish.
If you want more features, VMware has a paid product called Workstation Pro. As of 2024, Workstation Pro is available for free for none-commercial use. This product has more features, including the ability to perform snapshots. If you are thinking about trying out virtualization, this product is definitely worth a look.
Another free product is Oracle’s free product called VirtualBox. This product was previously owned by Sun. VirtualBox has quite a lot of features and is quite functional. VirtualBox is available on Windows, Linux, and Macintosh. At the time this video was made, it was not currently available for M1 and M2 CPUs. It is an excellent product, and if you just want to give virtualization a try, it is worth having a look at.
If you are using a Macintosh, there is Parallels. This is a paid product and is quite good. There are others that I have not mentioned. However, the important takeaway is that these products are all installed on the operating system and run just like any application would on the operating system. Let’s have a closer look.
Demonstration VirtualBox
On this computer, I have installed VirtualBox. You will notice, like any other application, it is launched from the start menu. Once it is launched, it will run like any other application. Since it runs as an application on the operating system, the resources it uses are shared with the other applications running on the operating system.
To understand how virtual machines work, I will have a look at the main functions. I won’t look at the virtual machine in a lot of detail because it is a big topic and I could not cover it in one video. To create a new virtual machine, I will press the new button at the top. This will start the wizard to create a new virtual machine.
I will enter a name for the virtual machine and then select an ISO to install the operating system. Notice that VirtualBox has automatically detected the operating system on the ISO.
Different virtual machine solutions will support different operating systems and may have additional features for those operating systems. In this case, VirtualBox has detected the operating system as Ubuntu and will automate the installation for us. This means once the installation has started, I will not be required to enter any additional information or be given any prompts.
If you want to disable this and perform a regular install with all the install options given to you, tick the option at the bottom “Skip Unattended Installation”.
I will move on to the next screen of the wizard. Here, I can configure some options for the automated install to use, but I will leave it on the default and move on. On the next screen, I can configure the amount of memory and CPUs the virtual machine will use. This will use the local computer resources, generally called the host. Thus, you need to be careful how many resources you allocate to a virtual machine, as it shares resources with the host operating system. Running a virtual machine is just like running another computer, thus requiring the same amount of memory and CPU as a regular computer.
You are essentially sharing the host memory and CPUs with the virtual machines that are running. Different virtualization solutions may be more efficient at this process. For example, they may have additional features like dynamic memory, which only uses host memory when required. You can start to understand that running virtual machines requires a lot more resources than just running a single computer.
On the next screen, I can allocate a file to store the virtual hard disk. By default, the file will expand as more data is added. You can also choose to pre-allocate the data in the file. Pre-allocating the file can improve the performance of the virtual machine. However, since the whole file has to be written before the installation of the operating system can start, this can significantly increase the time it takes to create a virtual machine, particularly if the virtual machine file is large. Having the file increase in size as data is added saves a lot of storage space if you are planning on running a lot of virtual machines, particularly if you don’t use a lot of the space available.
On the last screen of the wizard, I will be shown the options that will be used to create the virtual machine. I will press the finish button, and the virtual machine will be created. Depending on what option you choose, the virtual machine should not take too long to create.
You will notice that when I click on the virtual machine window, I will get a window. This window is telling us that when you select the virtual machine, the mouse pointer and keyboard will be captured by that virtual machine. In order to release them so they can be used by the host operating system, you will need to press the right-ctrl key. Different virtualization solutions use different keys for this.
When the mouse pointer is captured by the virtual machine, in some cases you won’t be able to move it outside the virtual machine window. You will notice that in this case, I am able to, so I don’t need to press the release key.
Some operating systems will have additional software pre-installed that allows the virtual machine to communicate with the host. For example device drivers that allow the mouse and keyboard to be shared so they don’t need to be released from the virtual machine. Other features may also be included, such as better video support.
Older operating systems won’t have these additional features pre-installed. Older operating systems and some alternative operating systems won’t support these additional features. If the installation software is not installed, the virtual machine will run more sluggishly.
Rather than waiting for the installation to complete, I will select a virtual machine installation that I installed earlier.
To start the virtual machine, I will right-click on the virtual machine and start it. The virtual machine was running previously and essentially paused, thus it will start up where it left off, which is the login screen.
Once started, I can log in to it like I would any other physical machine. It essentially runs just like a physical machine. There are a lot of different options that can be configured for the virtual machine, for example, increasing the amount of video memory if you want to run higher resolutions. Now, let’s have a look at Type-1 Virtualization.
Type-1 Virtualization
Type-1 uses a bare-metal virtualization platform. That is, the hypervisor is connected directly to the hardware of the computer rather than running as an application on the computer. VMware has a free hypervisor called vSphere Hypervisor. When installed, there is only a text-based interface like the one shown. This allows for basic configuration of the installation, for example network configuration.
In order to perform even basic tasks like creating a virtual machine, you need to use a management tool like the web tool. In most cases, you will perform the initial install, configure the network, and then you probably won’t ever connect directly to the computer again unless the computer crashes or there is a problem with the hardware of the computer. If you install this hypervisor, you effectively lose the ability to use the computer to run applications but gain the ability to run virtual machines that you can control using remote management.
VMware has many different products. These products provide more advanced solutions, including the management of virtual machines.
Microsoft has a free hypervisor included with Windows called Hyper-V. Assuming your hardware and the edition of Windows supports it, you can add Hyper-V to Windows. Unlike other Type-1 virtualization solutions, when Hyper-V is added to Windows, the operating system connects to the hypervisor directly. The virtual machines also connect to the hypervisor, so essentially the OS runs just like a virtual machine would. The advantage of this is that virtual machines have direct access to the hardware using the hypervisor. This is a more efficient way of running virtual machines than running a virtual machine virtualization solution as another application on the operating system.
Let’s have a look at Hyper-V.
Hyper-V Demonstration
If you don’t have Hyper-V installed on the newer version of Windows, it is included with Windows as a feature and just needs to be added. To do this, open the start menu and then open settings. Once settings is open, I will next perform a search for features.
Notice that at the bottom is the option “Turn Windows Features on or off”. When I select this option, it will show the current list of enabled and disabled features. Features are optional parts of Windows and can be switched on or off. Switching them on enables more features, as the name suggests, but uses more resources on the computer. Features that are not commonly used are generally not enabled to reduce the amount of resources used on the computer.
You will notice that there is a section called “Hyper-V”. Since I have already installed Hyper-V, these are already ticked. If you want to use Hyper-V, it is a simple matter to tick the features you want to enable. Hyper-V is further divided into two more sections. The first section is “Hyper-V Management Tools.” These are the tools needed to manage Hyper-V. It is possible to install these without the hypervisor. You would do this if you wanted to use this computer to manage a Hyper-V installation on another computer.
The next subsection is “Hyper-V Platform,”. The first component “Hyper-V Hypervisor” installs the core hypervisor that allows a computer to run virtual machines. This is the part that actually handles the virtualization at the hardware level. However, by itself, it does not include any way to manage or interact with those virtual machines.
The “Hyper-V Services” components provide additional features needed to interact with virtual machines. They also include support for features like enhanced session mode, which improves USB redirection and device passthrough—letting you use USB devices inside your virtual machines more easily.
In most cases, you will want to install both components on the same machine. This gives you full local management and USB support. But there are situations where you might only install the hypervisor—for example, you are setting up nested virtualization.
Since I have Hyper-V already installed on this computer, I will cancel out of here. To manage Hyper-V, I will enter “Hyper-V” in the search box and then select “Hyper-V Manager” from the start menu. On this computer, there are three virtual machines installed. I will double-click on the first one to open it.
This virtual machine is running PFSense, which is a minimal operating system designed to perform routing. Virtual machines are great for test networks. Using virtual machines, you can install multiple network cards and networks. Setups that would be difficult and costly to use physical hardware for.
I will now go back to the manager and open the second virtual machine. The second virtual machine is running Ubuntu. You can see that just because the virtualization is provided by Microsoft, this does not mean that it is limited to only Microsoft products. However, different virtualization solutions will support different operating systems better than others. You will also find that different virtualization solutions may provide different features depending on which operating system is installed.
I will now open the third virtual machine. This virtual machine is running Windows. You will notice that when the virtual machine opens this time, I am given some options. Modern operating systems by default will have additional virtualization features. In older operating systems, these additional features may need to be installed manually if they are available for that operating system.
You will notice I am able to change the resolution before connecting to the virtual machine. Thus, we can connect to the virtual machine using a different resolution than the current virtual machine is using.
I can also select the tab “Local Resources”. Under this tab, local resources on the local computer can be made available to the virtual machine. For example, printers and the clipboard. I will now press the “More” button. This allows for different devices to be available to the virtual machine. This uses enhanced session mode, which is part of the remote desktop protocol. So essentially, Hyper-V Manager is using the remote desktop protocol to access the virtual machine. This may seem like a strange way to do it. The reason it is done this way is that Hyper-V does not have USB device support. Thus, to share devices like USB devices, it uses enhanced session mode.
I will now connect to the virtual machine. So, you can see that using Hyper-V has allowed me to run three different operating systems on the same host computer. This is great if you want to try out a new operating system or do some testing.
I will now go back to the virtual machine, right-click, and select the option “Settings.” This will show all the settings for this virtual machine. In the case of Hyper-V, there are currently only two different versions referred to as generations. In other virtualization solutions, there may be a lot more to choose from. Each different one has a different hardware base, which can affect which operating system can be run.
In the case of Hyper-V, notice that newer features like TPM are available, as well as secure boot. If you are installing an older operating system or an alternative operating system, you may need to switch these features off.
At the bottom, notice the section “Integration Services”. To improve the virtual machine’s interaction with the host computer, virtualization solutions will have device drivers and other software to communicate between the two. In the case of Hyper-V, this is called integration services. In VMware, this is called VMware tools.
Since Hyper-V is a Microsoft product, support for Microsoft operating systems is good. Alternative operating systems are generally not as well supported, if at all. Most of the options are enabled by default. The only one that is not enabled by default is “Guest Services.” Guest services allow files to be copied between the host and the virtual machine. In some cases, this may be a security risk, which is why it is off by default.
I will now exit out of the settings for this virtual machine. There are also settings that can be configured for the host itself, which are on the right side. I will now select the option on the right, “Virtual Switch Manager.”
There are three different networks configured. One connects directly to the internet using the network card in the host computer. Another is used for network traffic between virtual machines, including the hosts, but does not have internet access. The last is a private network connection that has no access to the host or the internet.
You can see that you can achieve a lot using virtualization, and we have only really scratched the surface of what can be achieved. Now that we have an understanding of what virtualization is, let’s have a look at how it is used.
Client-Side Virtualization
Client-side virtualization has a lot of different uses. One use may be sandboxing. This is when your software and infrastructure are installed in a virtual environment. This isolates it from the rest of your applications and network. Hence the name sandbox, as it provides a virtual area away from the production environment.
Using this sandbox, untested software can be installed. For example, you have some software that you want to use that you have not used before. You want to look at it to see if it may be useful for your needs.
Sandboxes can also be used for viruses and malware. If you work in network security or penetration testing, you may have come across software that you think may be infected. Using a sandbox allows you to install and test the software to see if there is any dangerous payload included.
Another use is for legacy software. Legacy software is old software you would prefer to no longer use; however, the organization still needs to use it. Perhaps it is no longer supported or upgrading is too expensive.
Legacy software may require old hardware to run. It can be difficult to purchase old hardware, so one solution is to use virtual machines and use a virtual machine with the hardware you require. There are virtualization solutions, for example, DosBox, which are designed specifically to run older software.
Another use of client-side virtualization is for testing. Using a virtual environment means it can be tightly controlled. For example, you can reduce the amount of memory and CPU access to see how the software reacts. Thus, you can perform testing in environments that may be difficult to achieve under normal circumstances
Virtual machines also allow for cross-platform testing. For example, you can test a Linux-based install using a virtual machine on a computer running Windows. Keep in mind that you will be limited by what operating system the virtual machines can run due to the CPU. Virtual machines use the same instruction set as the host computer’s CPU; they are not emulators.
Having the software in a virtual machine means it is separated from the production environment. This means your testing won’t affect your production environment. Also, you can test out changes before trying them in your production environment. For example, restoring a backup to a virtual machine and trying out the changes.
Lastly, virtual machines are often used for training. In this environment, this means the users can practice using the software without having to worry about consequences. If something goes wrong, using features like snapshots, the virtual machine can be restored back to a previous version of the virtual machine. Once the training is completed, the virtual machine can be discarded.
You can see there are a lot of uses for client-side virtualization. There is also a lot of use for virtualization for server communication.
Server-Side Virtualization
Although there are many reasons to use virtualization on a server, the main use is for consolidation. Consolidation means combining multiple servers so they run on one server. Doing this makes better use of resources and money. However, it does increase your chance of failure since you are putting your eggs all in one basket, so to speak. Thus, there is a trade-off between cost and reliability.
To understand this better, let’s consider an example. In this example, there are three servers. Each server is only using a little CPU, thus the remaining CPU is not being utilized. When you have servers with hardware that is being underutilized, these are good candidates for consolidation.
To consolidate these servers, a single server is required. This server will need to have enough resources to run the three servers in virtual machines. This may mean additional memory, storage, or better hardware, but this generally costs a lot less than running three dedicated servers.
If you are using virtualization management products, these products may pool your server resources and move resources around as required. These products are often used for cloud services. There are times when it is not ideal to consolidate many different services on the same server.
Application Virtualization
Application virtualization is when the application is virtualized and run either on the server or the client computer. The type of virtualization solution being used will determine where it is run. The important point is that the user will contact the server, and the application will be sent to them, either as a stream of video with the application running on the server or as a package so it can be run on the local computer.
It may be a little confusing how this is different from other solutions, for example, running the application through remote desktop. The important point to take away is that the application can be run in a virtual environment isolated from the operating system. In other solutions, the application can’t be isolated from the operating system. This provides much better security because if the application were to become compromised with a virus, it would not be able to spread the virus directly to the operating system.
There are a few different solutions to application virtualization, depending on what virtualization solution you are running. Application virtualization may become more popular in the future; only time will tell.
Application virtualization is one way to virtualize an application, but there is another way.
Container Virtualization
It is also possible to virtualize an application using a container. When this occurs, resource separation is performed at the OS level. This virtualization is done a little differently since the programmer of the application chooses to virtualize it.
The virtualization provides binaries and libraries for the application. That is, the applications run on a computer. The applications, however, do not communicate directly with the host operating system. Instead, they communicate through an additional layer of binaries and libraries. The advantage of this is that the binaries can be for different operating systems. However, the binaries are not a full operating system and thus don’t provide all the features an operating system would.
This effectively removes the application from being tied to the operating system. This means that if a library is updated on the operating system, it should not affect the application as it is using its own copy of the library. In some cases, for example, if the application is built on top of Linux libraries and running on Windows, Windows may not have that library installed. This can also occur between different flavours of Linux. Thus, the container provides an abstract layer between the application and the operating system.
The advantage of using containers is they use fewer resources than a virtual machine but do not provide as many features. You can see when you look at virtualization, it is implemented in many different ways. Each method has its advantages and disadvantages.
End Screen
That concludes this video on virtualization. I hope you have found it informative. Until the next video from us I would like to thank you for watching.
References
“The Official CompTIA A+ Core Study Guide (Exam 220-1101)” pages 228 to 233
“Picture: Zork screen shot” https://wiki.scummvm.org/images/c/ce/Zork_screenshot.png
“Picture: Software box” https://pixabay.com/vectors/box-product-blank-cigarettes-308010/
Credits
Trainer: Austin Mason http://ITFreeTraining.com
Voice Talent: HP Lewis http://hplewis.com
Quality Assurance: Brett Batson http://www.pbb-proofreading.uk