What is a Virtual Machine And How to Setup a VM on Windows, Linux, and Mac
Beau Carnes
A virtual machine is a program you run on a computer that acts like it is a separate computer. It is basically a way to create a computer within a computer.
A virtual machine runs in a window on the host computer and gives a user the same experience they would have if they were using a completely different computer. Virtual machines are sandboxed from the host computer. This means that nothing that runs on the virtual machine can impact the host computer.
Virtual machines are often used for running software on operating systems that software wasn’t originally intended for. For instance, if you are using a Mac computer you can run Windows programs inside a Windows virtual machine on the Mac computer. Virtual machines are also used to quickly set up software with an image, access virus-infected data, and test other operating systems.
A single physical computer can run multiple virtual machines at the same time. Often a server will use a program called a hypervisor to manage multiple virtual machines that are running at the same time. Virtual machines have virtual hardware, including CPUs, memory, hard drives, and more. Each piece of virtual hardware is mapped to real hardware on the host computer.
There are a few drawbacks with virtual machines. Since hardware resources are indirect, they are not as efficient as a physical computer. Also, when many virtual machines are running at the same time on a single computer, performance can become unstable.
Virtual Machine Programs
There are many different virtual machine programs you can use. Some options are VirtualBox (Windows, Linux, Mac OS X), VMware Player (Windows, Linux), VMware Fusion (Mac OS X) and Parallels Desktop (Mac OS X).
VirtualBox is one of the most popular virtual machine programs since it is free, open source, and available on all the popular operating systems. We’ll show you how to set up a virtual machine using VirtualBox.
Setting up a Virtual Machine (VirtualBox)
VirtualBox is an open source Virtual Machine program from Oracle. It allows users to virtually install many operating systems on virtual drives, including Windows, BSD, Linux, Solaris, and more.
Since VirtualBox runs on Windows, Linux, and Mac, the process for setting up a virtual machine is pretty much the same in each operating system.
Start with downloading and installing VirtualBox. You can download it at this link: VirtualBox Downloads
You will also need to download an .iso file for the operating system that you want to run in your virtual machine. For instance, you can download a Windows 10 .iso file here: https://www.microsoft.com/en-us/software-download/windows10ISO
Once you have VirtualBox running, click the «New» button
Create a new virtual machine.
Next you will have to choose which OS you plan on installing. In the «Name» box, type the name of the OS you want to install. VirtualBox will guess the type and version based on the name you type in, but you can change these settings if you need to.
Configure the virtual machine.
The wizard will automatically select default settings based on the OS type and version you selected. You can always change the settings as you go through the wizard. Just keep clicking «Continue» and «Create» until you get through the wizard. It’s usually fine to use the defaults.
Next, start the virtual machine you just created by clicking «Start».
Start the virtual machine.
Once the virtual machine starts up, select the .iso image file you want to use.
Install the operating system on the virtual machine.
Your virtual machine will now load your selected operating system. The operating system may require some setup, but it will be the same setup that would be required if you had installed it on a standard computer.
Windows 10 is successfully running inside a virtual machine.
Congratulations! You’ve run your first Virtual Machine in VirtualBox.
Beau Carnes
I’m a teacher and developer with freeCodeCamp.org. I run the freeCodeCamp.org YouTube channel.
If you read this far, tweet to the author to show them you care. Tweet a thanks
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
freeCodeCamp is a donor-supported tax-exempt 501(c)(3) nonprofit organization (United States Federal Tax Identification Number: 82-0779546)
Our mission: to help people learn to code for free. We accomplish this by creating thousands of videos, articles, and interactive coding lessons — all freely available to the public. We also have thousands of freeCodeCamp study groups around the world.
Donations to freeCodeCamp go toward our education initiatives, and help pay for servers, services, and staff.
How to install virtual machine on windows
Table of Contents
Welcome to Oracle VM VirtualBox.
Oracle VM VirtualBox is a cross-platform virtualization application. What does that mean? For one thing, it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac OS X, Linux, or Oracle Solaris operating systems (OSes). Secondly, it extends the capabilities of your existing computer so that it can run multiple OSes, inside multiple virtual machines, at the same time. As an example, you can run Windows and Linux on your Mac, run Windows Server 2016 on your Linux server, run Linux on your Windows PC, and so on, all alongside your existing applications. You can install and run as many virtual machines as you like. The only practical limits are disk space and memory.
Oracle VM VirtualBox is deceptively simple yet also very powerful. It can run everywhere from small embedded systems or desktop class machines all the way up to datacenter deployments and even Cloud environments.
The following screenshot shows how Oracle VM VirtualBox, installed on an Apple Mac OS X computer, is running Windows Server 2016 in a virtual machine window.
Figure 1.1. Windows Server 2016 Virtual Machine, Displayed on a Mac OS X Host
In this User Manual, we will begin simply with a quick introduction to virtualization and how to get your first virtual machine running with the easy-to-use Oracle VM VirtualBox graphical user interface. Subsequent chapters will go into much more detail covering more powerful tools and features, but fortunately, it is not necessary to read the entire User Manual before you can use Oracle VM VirtualBox.
You can find a summary of Oracle VM VirtualBox’s capabilities in Section 1.3, “Features Overview”. For existing Oracle VM VirtualBox users who just want to find out what is new in this release, see the Chapter 15, Change Log.
1.1. Why is Virtualization Useful?
The techniques and features that Oracle VM VirtualBox provides are useful in the following scenarios:
Running multiple operating systems simultaneously. Oracle VM VirtualBox enables you to run more than one OS at a time. This way, you can run software written for one OS on another, such as Windows software on Linux or a Mac, without having to reboot to use it. Since you can configure what kinds of virtual hardware should be presented to each such OS, you can install an old OS such as DOS or OS/2 even if your real computer’s hardware is no longer supported by that OS.
Easier software installations. Software vendors can use virtual machines to ship entire software configurations. For example, installing a complete mail server solution on a real machine can be a tedious task. With Oracle VM VirtualBox, such a complex setup, often called an appliance , can be packed into a virtual machine. Installing and running a mail server becomes as easy as importing such an appliance into Oracle VM VirtualBox.
Testing and disaster recovery. Once installed, a virtual machine and its virtual hard disks can be considered a container that can be arbitrarily frozen, woken up, copied, backed up, and transported between hosts.
On top of that, with the use of another Oracle VM VirtualBox feature called snapshots , one can save a particular state of a virtual machine and revert back to that state, if necessary. This way, one can freely experiment with a computing environment. If something goes wrong, such as problems after installing software or infecting the guest with a virus, you can easily switch back to a previous snapshot and avoid the need of frequent backups and restores.
Any number of snapshots can be created, allowing you to travel back and forward in virtual machine time. You can delete snapshots while a VM is running to reclaim disk space.
Infrastructure consolidation. Virtualization can significantly reduce hardware and electricity costs. Most of the time, computers today only use a fraction of their potential power and run with low average system loads. A lot of hardware resources as well as electricity is thereby wasted. So, instead of running many such physical computers that are only partially used, one can pack many virtual machines onto a few powerful hosts and balance the loads between them.
1.2. Some Terminology
When dealing with virtualization, and also for understanding the following chapters of this documentation, it helps to acquaint oneself with a bit of crucial terminology, especially the following terms:
Host operating system (host OS). This is the OS of the physical computer on which Oracle VM VirtualBox was installed. There are versions of Oracle VM VirtualBox for Windows, Mac OS X, Linux, and Oracle Solaris hosts. See Section 1.4, “Supported Host Operating Systems”.
Most of the time, this manual discusses all Oracle VM VirtualBox versions together. There may be platform-specific differences which we will point out where appropriate.
Guest operating system (guest OS). This is the OS that is running inside the virtual machine. Theoretically, Oracle VM VirtualBox can run any x86 OS such as DOS, Windows, OS/2, FreeBSD, and OpenBSD. But to achieve near-native performance of the guest code on your machine, we had to go through a lot of optimizations that are specific to certain OSes. So while your favorite OS may run as a guest, we officially support and optimize for a select few, which include the most common OSes.
Virtual machine (VM). This is the special environment that Oracle VM VirtualBox creates for your guest OS while it is running. In other words, you run your guest OS in a VM. Normally, a VM is shown as a window on your computer’s desktop. Depending on which of the various frontends of Oracle VM VirtualBox you use, the VM might be shown in full screen mode or remotely on another computer.
Internally, Oracle VM VirtualBox treats a VM as a set of parameters that specify its behavior. Some parameters describe hardware settings, such as the amount of memory and number of CPUs assigned. Other parameters describe the state information, such as whether the VM is running or saved.
You can view these VM settings in the VirtualBox Manager window, the Settings dialog, and by running the VBoxManage command. See Chapter 8, VBoxManage.
Guest Additions. This refers to special software packages which are shipped with Oracle VM VirtualBox but designed to be installed inside a VM to improve performance of the guest OS and to add extra features. See Chapter 4, Guest Additions.
1.3. Features Overview
The following is a brief outline of Oracle VM VirtualBox’s main features:
Portability. Oracle VM VirtualBox runs on a large number of 64-bit host operating systems. See Section 1.4, “Supported Host Operating Systems”.
Oracle VM VirtualBox is a so-called hosted hypervisor, sometimes referred to as a type 2 hypervisor. Whereas a bare-metal or type 1 hypervisor would run directly on the hardware, Oracle VM VirtualBox requires an existing OS to be installed. It can thus run alongside existing applications on that host.
To a very large degree, Oracle VM VirtualBox is functionally identical on all of the host platforms, and the same file and image formats are used. This enables you to run virtual machines created on one host on another host with a different host OS. For example, you can create a virtual machine on Windows and then run it under Linux.
In addition, virtual machines can easily be imported and exported using the Open Virtualization Format (OVF), an industry standard created for this purpose. You can even import OVFs that were created with a different virtualization software. See Section 1.14, “Importing and Exporting Virtual Machines”.
For users of Oracle Cloud Infrastructure the functionality extends to exporting and importing virtual machines to and from the cloud. This simplifies development of applications and deployment to the production environment. See Section 1.15.7, “Exporting an Appliance to Oracle Cloud Infrastructure”.
Guest Additions: shared folders, seamless windows, 3D virtualization. The Oracle VM VirtualBox Guest Additions are software packages which can be installed inside of supported guest systems to improve their performance and to provide additional integration and communication with the host system. After installing the Guest Additions, a virtual machine will support automatic adjustment of video resolutions, seamless windows, accelerated 3D graphics and more. See Chapter 4, Guest Additions.
In particular, Guest Additions provide for shared folders , which let you access files on the host system from within a guest machine. See Section 4.3, “Shared Folders”.
Great hardware support. Among other features, Oracle VM VirtualBox supports the following:
Guest multiprocessing (SMP). Oracle VM VirtualBox can present up to 32 virtual CPUs to each virtual machine, irrespective of how many CPU cores are physically present on your host.
USB device support. Oracle VM VirtualBox implements a virtual USB controller and enables you to connect arbitrary USB devices to your virtual machines without having to install device-specific drivers on the host. USB support is not limited to certain device categories. See Section 3.11.1, “USB Settings”.
Hardware compatibility. Oracle VM VirtualBox virtualizes a vast array of virtual devices, among them many devices that are typically provided by other virtualization platforms. That includes IDE, SCSI, and SATA hard disk controllers, several virtual network cards and sound cards, virtual serial and parallel ports and an Input/Output Advanced Programmable Interrupt Controller (I/O APIC), which is found in many computer systems. This enables easy cloning of disk images from real machines and importing of third-party virtual machines into Oracle VM VirtualBox.
Full ACPI support. The Advanced Configuration and Power Interface (ACPI) is fully supported by Oracle VM VirtualBox. This enables easy cloning of disk images from real machines or third-party virtual machines into Oracle VM VirtualBox. With its unique ACPI power status support , Oracle VM VirtualBox can even report to ACPI-aware guest OSes the power status of the host. For mobile systems running on battery, the guest can thus enable energy saving and notify the user of the remaining power, for example in full screen modes.
Multiscreen resolutions. Oracle VM VirtualBox virtual machines support screen resolutions many times that of a physical screen, allowing them to be spread over a large number of screens attached to the host system.
Built-in iSCSI support. This unique feature enables you to connect a virtual machine directly to an iSCSI storage server without going through the host system. The VM accesses the iSCSI target directly without the extra overhead that is required for virtualizing hard disks in container files. See Section 5.10, “iSCSI Servers”.
PXE Network boot. The integrated virtual network cards of Oracle VM VirtualBox fully support remote booting using the Preboot Execution Environment (PXE).
Multigeneration branched snapshots. Oracle VM VirtualBox can save arbitrary snapshots of the state of the virtual machine. You can go back in time and revert the virtual machine to any such snapshot and start an alternative VM configuration from there, effectively creating a whole snapshot tree. See Section 1.10, “Snapshots”. You can create and delete snapshots while the virtual machine is running.
VM groups. Oracle VM VirtualBox provides a groups feature that enables the user to organize and control virtual machines collectively, as well as individually. In addition to basic groups, it is also possible for any VM to be in more than one group, and for groups to be nested in a hierarchy. This means you can have groups of groups. In general, the operations that can be performed on groups are the same as those that can be applied to individual VMs: Start, Pause, Reset, Close (Save state, Send Shutdown, Poweroff), Discard Saved State, Show in File System, Sort.
Clean architecture and unprecedented modularity. Oracle VM VirtualBox has an extremely modular design with well-defined internal programming interfaces and a clean separation of client and server code. This makes it easy to control it from several interfaces at once. For example, you can start a VM simply by clicking on a button in the Oracle VM VirtualBox graphical user interface and then control that machine from the command line, or even remotely. See Section 1.17, “Alternative Front-Ends”.
Due to its modular architecture, Oracle VM VirtualBox can also expose its full functionality and configurability through a comprehensive software development kit (SDK), which enables integration of Oracle VM VirtualBox with other software systems. See Chapter 11, Oracle VM VirtualBox Programming Interfaces.
Remote machine display. The VirtualBox Remote Desktop Extension (VRDE) enables high-performance remote access to any running virtual machine. This extension supports the Remote Desktop Protocol (RDP) originally built into Microsoft Windows, with special additions for full client USB support.
The VRDE does not rely on the RDP server that is built into Microsoft Windows. Instead, the VRDE is plugged directly into the virtualization layer. As a result, it works with guest OSes other than Windows, even in text mode, and does not require application support in the virtual machine either. The VRDE is described in detail in Section 7.1, “Remote Display (VRDP Support)”.
On top of this special capacity, Oracle VM VirtualBox offers you more unique features:
Extensible RDP authentication. Oracle VM VirtualBox already supports Winlogon on Windows and PAM on Linux for RDP authentication. In addition, it includes an easy-to-use SDK which enables you to create arbitrary interfaces for other methods of authentication. See Section 7.1.5, “RDP Authentication”.
USB over RDP. Using RDP virtual channel support, Oracle VM VirtualBox also enables you to connect arbitrary USB devices locally to a virtual machine which is running remotely on an Oracle VM VirtualBox RDP server. See Section 7.1.4, “Remote USB”.