Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Virtualization

From PCGamingWiki, the wiki about fixing PC games

This page is for a general overview of virtualization. For software emulating a gaming console, see Emulation.

Virtualization refers to various methods used to creating a virtual version of something at the same abstraction level. This is not to be confused with emulation, which is the replication of the same or different hardware via software (e.g. a NES emulator running on a PC) and has significant performance penalties due to conversion through an interpreter compared to virtualization methods.

Key points

Allows the use of older software which may have problems running natively on newer OSes or hardware.
3D acceleration support varies drastically between virtualization type as well as software.
Virtualization will generally run slower than software running natively unless the virtualization layer includes or enables optimizations that the software benefits from.

General information

Virtualization
quickhakker - Program Tutorial: Running 16 bit programs on 64 bit operating systems - YouTube

Hardware virtualization

Removes the need to install another OS to the host system and having to separately boot into it.
Snapshot or save state features allow saving a virtual machines current state, which can be useful for troubleshooting or testing.

Virtualization is commonly used to refers to hardware virtualization, the act of creating and running an operating system within a virtual machine (VM) alongside code belong to other virtual machine(s) running on the same architecture and hardware (without converting; no emulation). As few elements as possible are emulated, therefore most of the expected CPU performance can be obtained with a variable overhead depending on the system. The underlying machine used for the virtualization is referred to as the host, and the software that creates these virtual machines is called the hypervisor or virtual machine monitor (VMM), while the virtual machines themselves are often referred to as guests.

Modern computers have additional hardware capabilities to assist in virtualization called Intel VT-x and AMD-V, commonly just referred to as hardware-assisted virtualization. While older hypervisors allowed hardware virtualization even without these features enabled, they were often recommended or required for virtual machines to achieve their most optimal performance. As of 2022 most of the prominent hypervisors requires hardware-assisted virtualization and will not work without it.[1]

A common use case for hardware virtualization is to circumvent compatibility issues with older software by running the software inside a suitable VM. One example is 16-bit program compatibility as support for these is not included in 64-bit variants of Windows. However since modern CPUs still support 16-bit execution through the virtual 8086 mode when running in legacy mode, hardware virtualization allows 16-bit execution through a suitable guest VM with a 16-bit or 32-bit operating system installed.

Hardware virtualization also has plenty of other use cases such as for e.g. running an isolated environment (sandbox), running older software, or a different OS without dual booting the host machine. Modern versions of Hyper-V also features the ability to natively boot some OSes from virtual hard disks, giving the user the benefits of dual booting different OSes without having to manage separate boot launchers or hard drive partitions.

When running an older version of an OS in a VM, the same security risks apply when installing & running that OS natively, so there will always be a possibility of viruses and malware that can take advantage of the guest OSes vulnerabilities; even of the VM software itself. If the software in question does not need access to internet, it is usually safer to disable all connections from the VM to the host computer. When using shared folders, it is safer to mark the folder as read-only if moving files to the host is not required. Taking these security measures into consideration can make running a guest OS considerably more secure.

Application virtualization

Application virtualization is a form of software technology where a virtualization layer is used to isolate applications files and/or registry keys from the host machine, allowing the ability to make programs completely portable between different computers or system configurations. Instead of virtualizing the entire operating system, as with a VM through hardware virtualization, only the files and/or registry keys of the application are virtualized. This method allows for a wide range of isolation options, such as the application being able to merge with the existing system, select parts of it, or to be completely isolated from the rest of the system. Necessary prerequisites or runtimes can also be bundled within the virtual application bundle itself instead of having to be natively installed on the host machine.

This type of technology is most often used for enterprise purposes where a third-party application suite comprising of a management tool, distribution channel, and client agent is used to create, distribute, and run virtualized applications. The closely related consumer option is the so called Portable application creators which allows users to create portable applications which does not require an installation to be run on a system. These portable applications are most often agentless in that they do not rely on a pre-installed client agent on a computer to run.

Examples of some common solutions:

Software Primary Audience Platforms Homepage
Citrix Virtual Apps Enterprise
Windows
Link
Cameyo Enterprise
Windows
Link
Microsoft App-V Enterprise
Windows
Link
PortableApps.com Consumer
Windows
Link
Sandboxie Plus Consumer
Windows
Link
Turbo Studio Enterprise
Windows
Link
VMware ThinApp Enterprise
Windows
Link

Compatibility/translation layers

Compatibility layers are another common but less known type of virtualization which allows applications of a legacy or foreign system to run in environments it was never intended for. The layer intercepts system calls made by the application during runtime and manipulates or translates them into a more appropriate equivalent if necessary. This can range from just fixing up a few individual system calls that was changed in later versions of the OS than the application was developed for, to translating all system calls to alternate APIs allowing the application to run on completely foreign systems. If a direct one-to-one translation is not possible between the original and replacement APIs, the compatibility layer also emulates the behaviors of the original API as much as possible through multiple calls to the replacement API.

The performance impact of a compatibility layer comes down to the extent of translation required, whether direct one-to-one translation is possible or if more complex translation is needed, as well as other factors involved such as the accuracy and performance of the translation and use of any custom behavior to optimize and fix unnecessary performance issues and overhead caused by unoptimized calls made by the application. As a result applications running through a compatibility layers is often capable of reaching close to native performance, and in some cases even outperform native systems due to the aforementioned optimizations made by the compatibility layer.

Some common compatibility layers are:

  • Wine (originally an acronym for "Wine Is Not an Emulator") is a compatibility layer that translates and allows running Windows applications on Linux, macOS, and other Unix-like systems.
  • Display wrappers such as dgVoodoo2 are a type of compatibility layer that translates calls made in one graphics API to another API.
  • 32-bit versions of Windows included WOW (Windows on Windows) which provided support for running legacy 16-bit programs written for Windows 3.x or earlier. This compatibility layer was never included in 64-bit versions of Windows despite the underlying component NTVDM including full emulation capabilities of 16-bit CPU instructions.[2][3]
    • WineVDM on 64-bit Windows is an alternate compatibility layer and emulator which allows 16-bit programs to be executed on Windows 64-bit.
  • 64-bit versions of Windows includes WOW64 (Windows 32-bit on Windows 64-bit) which provides support for running 32-bit applications.
  • Windows Compatibility Mode is an underlying compatibility engine within Windows that uses compatibility shims to apply fixes and changes for applications that might otherwise not function properly.
  • D3D9On12 is a mapping layer in Windows 10 and 11 that maps calls made by the D3D9 API to the D3D9 display driver interface (the role D3D9On12 fills in this case) over to their respective D3D12 API equivalent. It is automatically used by Windows for display drivers that lack native D3D9 drivers and allows D3D9 applications to still be used provided the driver supports D3D12. It differs from more typical display wrappers as the original D3D9 API and runtime is still present and doing its thing — D3D9On12 essentially sits "below" those at the driver level. This mapping layer also handles earlier D3D versions, including DirectDraw.[4]

Virtualization and emulation software

These are some notable hardware virtualization and emulation software.

Software Type Platforms Wikipedia Homepage Cost Comment
DOSBox Emulation
Windows
macOS (OS X)
Linux
Link Free
Hyper-V Virtualization
Windows
Link Included in Windows 10/11 Not suited for 3D games.
Parallels Virtualization
macOS (OS X)
Link Costs
PCem Emulation
Windows
Linux
Link Free
86box Emulation
Windows
Linux
macOS (OS X)
Link Free Fork of Pcem
QEMU Virtualization or Emulation
Windows
macOS (OS X)
Linux
Link Free
WineVDM on 64-bit Windows Compatibility layer
Emulation
Windows
Link Free OTVDM (WineVDM)
VirtualBox Virtualization
Windows
macOS (OS X)
Linux
Link Free
VMware Virtualization
Windows
macOS (OS X)
Linux
Link Basic free
Premium costs

DOSBox

Suitable for DOS era gaming (pre-1998).
DOSBox emulates DOS.
For more information see DOSBox.

PCem

Suitable for Windows 95/98 gaming, supports 3D hardware acceleration (up to 3dfx Voodoo 3 emulation)
All hardware emulated on CPU. Pentium 2 200-250 MHz - voodoo 1 equivalent performance on Ryzen 3xxx/Intel 10th Gen CPUs.
Due to hard drive emulated 90s actual hardware's speed, io speed is very low.
High resolusions and refresh rates need tweaking in vm, mouse movement is very sluggish on low refresh rates
No state save feature

86box

Suitable for Windows 95/98 gaming, supports 3D hardware acceleration (up to 3dfx Voodoo 3 emulation)
Hard drive emulation with ramdisk speed option provides much better usage.
Fork of pcem that aims to achieve complete emulation without performance shortcuts, therefore, little slower. it has more organized ui and more device options.
All hardware emulated on CPU. Pentium 2 200-250 MHz - voodoo 1 equivalent performance on Ryzen 3xxx/Intel 10th Gen CPUs.
High resolusions and refresh rates need tweaking in vm, mouse movement is very sluggish on low refresh rates
No state save feature

QEMU

On Linux, using QEMU virtualisation + KVM + GPU-passthrough can achieve almost native performance (80-90%).
On Linux, GPU-passthrough requires multiple GPUs.
Good compatibility with programs when using emulation, though carries a high performance penalty.

WineVDM on 64-bit Windows

WineVDM on 64-bit Windows is an altered version of Wine's 16-bit compatibility layer called WineVDM coupled with an 80386 CPU emulator that allows running 16-bit Windows apps (Windows 1.x, 2.x, 3.0, 3.1, etc.) transparently on 64-bit Windows.
The compatibility layer allows 16-bit apps to interact transparently with the host 64-bit Windows operating system and filesystem.
Minimal to set up and use compared to using hardware virtualization.

VirtualBox

Suitable for Windows 98/ME gaming with modern fast cpus(ryzen 3xxx-intel 12xxx or more) with 2 patches, 1- speed and instruction fix 2 - cpu emulated 3d accelerated gpu, also rloew 4gb ram patch strongly suggested for more than 512 mb ram, with all these fixes, tnt2 equvalent GPU performance possible.
Have state save (snapshot) feature
Due to incomplete 3D hardware acceleration (and instruction set support issues on AMD), it is not suitable for 3D gaming on xp or newer systems, however DOS-98-ME and software-rendered 3D games can run.


VMware

For Windows hosts, VMware is generally the best option for GPU intensive games, 3d hardware acceleration support for Windows XP and later is typically superior than alternative software.
Only supports 60Hz refresh-rate and stereo sound output.[citation needed]
The free version, VMware Workstation Player, lacks a snapshot feature.
No 3D acceleration on Windows 95/98/ME, and the virtual 3D drivers for XP and Vista is no longer being developed. The final drivers for Windows XP runs some DirectX 6-8 games slow to the point of being unplayable. For lightweight games Windows XP has enough performance, but for more demanding games using Vista or 7 guests are strongly recommended.


References

  1. Verified by User:Aemony on 2022-09-22
    Both Hyper-V and VMware Workstation Pro on a Windows 11 install requires Intel VT-x to even work, and I came across a website that mentioned VirtualBox does the same as of a few years ago.
  2. Wikipedia - Virtual DOS machine - Windows NTVDM - last accessed on 2022-09-17
    "Since virtual 8086 mode is not available on non-x86-based processors (more specifically, MIPS, DEC Alpha, and PowerPC) NTVDM was instead implemented as a full emulator in these versions of NT, using code licensed from Insignia's SoftPC. Up to Windows NT 3.51, only 80286 emulation was available. With Windows NT 4.0, 486 emulation was added."
  3. GitHub - leecher1337/ntvdmx64 - last accessed on 2022-09-17
    "NTVDMx64 is a port of the well-known Windows NTVDM, which is used by windows to run DOS-Applications, to 64bit Windows, so that you can run your DOS-Applications on 64bit Windows too. This is a proof-of-concept that it is possible to run the NTVDM on 64bit Windows"
  4. DirectX Discord Server - #dx9-dx11-developers - Jesse Natalie on August 18, 2022 - last accessed on 2022-08-18
    "9on12 handles all D3D versions before 10 including DDraw"