Virtualbox how to use
Virtualbox how to use
Virtualbox how to use
To start a virtual machine, you have several options:
Double-click on the VM’s entry in the list in the VirtualBox Manager window.
Select the VM’s entry in the list in the VirtualBox Manager window, and click Start at the top of the window.
Starting a virtual machine displays a new window, and the virtual machine which you selected will boot up. Everything which would normally be seen on the virtual system’s monitor is shown in the window. See the screenshot image in ChapterВ 1, First Steps.
In general, you can use the virtual machine as you would use a real computer. There are couple of points worth mentioning however.
1.8.1.В Starting a New VM for the First Time
For this reason, the wizard helps you to select a medium to install an OS from.
If you have physical CD or DVD media from which you want to install your guest OS, such as a Windows installation CD or DVD, put the media into your host’s CD or DVD drive.
In the wizard’s drop-down list of installation media, select Host Drive with the correct drive letter. In the case of a Linux host, choose a device file. This will allow your VM to access the media in your host drive, and you can proceed to install from there.
If you have downloaded installation media from the Internet in the form of an ISO image file such as with a Linux distribution, you would normally burn this file to an empty CD or DVD and proceed as described above. With Oracle VM VirtualBox however, you can skip this step and mount the ISO file directly. Oracle VM VirtualBox will then present this file as a CD or DVD-ROM drive to the virtual machine, much like it does with virtual hard disk images.
In this case, the wizard’s drop-down list contains a list of installation media that were previously used with Oracle VM VirtualBox.
If your medium is not in the list, especially if you are using Oracle VM VirtualBox for the first time, click the small folder icon next to the drop-down list to display a standard file dialog. Here you can pick an image file on your host disks.
After completing the choices in the wizard, you will be able to install your OS.
1.8.2.В Capturing and Releasing Keyboard and Mouse
Oracle VM VirtualBox provides a virtual USB tablet device to new virtual machines through which mouse events are communicated to the guest OS. If you are running a modern guest OS that can handle such devices, mouse support may work out of the box without the mouse being captured as described below. See Section 3.5.1, “Motherboard Tab”.
Otherwise, if the virtual machine detects only standard PS/2 mouse and keyboard devices, since the OS in the virtual machine does not know that it is not running on a real computer, it expects to have exclusive control over your keyboard and mouse. But unless you are running the VM in full screen mode, your VM needs to share keyboard and mouse with other applications and possibly other VMs on your host.
After installing a guest OS and before you install the Guest Additions, described later, either your VM or the rest of your computer can «own» the keyboard and the mouse. Both cannot own the keyboard and mouse at the same time. You will see a second mouse pointer which is always confined to the limits of the VM window. You activate the VM by clicking inside it.
FigureВ 1.7В Host Key Setting on the Virtual Machine Task Bar
This means the following:
Your keyboard is owned by the VM if the VM window on your host desktop has the keyboard focus. If you have many windows open in your guest OS, the window that has the focus in your VM is used. This means that if you want to enter text within your VM, click on the title bar of your VM window first.
To release keyboard ownership, press the Host key. As explained above, this is typically the right Ctrl key.
Note that while the VM owns the keyboard, some key sequences, such as Alt+Tab, will no longer be seen by the host, but will go to the guest instead. After you press the Host key to reenable the host keyboard, all key presses will go through the host again, so that sequences such as Alt+Tab will no longer reach the guest. For technical reasons it may not be possible for the VM to get all keyboard input even when it does own the keyboard. Examples of this are the Ctrl+Alt+Del sequence on Windows hosts or single keys grabbed by other applications on X11 hosts such as the GNOME desktop Locate Pointer feature.
Your mouse is owned by the VM only after you have clicked in the VM window. The host mouse pointer will disappear, and your mouse will drive the guest’s pointer instead of your normal mouse pointer.
Note that mouse ownership is independent of that of the keyboard. Even after you have clicked on a titlebar to be able to enter text into the VM window, your mouse is not necessarily owned by the VM yet.
To release ownership of your mouse by the VM, press the Host key.
As this behavior is inconvenient, Oracle VM VirtualBox provides a set of tools and device drivers for guest systems called the Oracle VM VirtualBox Guest Additions. These tools make VM keyboard and mouse operations much more seamless. Most importantly, the Guest Additions suppress the second «guest» mouse pointer and make your host mouse pointer work directly in the guest. See ChapterВ 4, Guest Additions.
1.8.3.В Typing Special Characters
Some OSes expect certain key combinations to initiate certain procedures. The key combinations that you type into a VM might target the host OS, the Oracle VM VirtualBox software, or the guest OS. The recipient of these keypresses depends on a number of factors, including the key combination itself.
Host OSes reserve certain key combinations for themselves. For example, you cannot use the Ctrl+Alt+Delete combination to reboot the guest OS in your VM because this key combination is usually hard-wired into the host OS. So, even though both the Windows and Linux OSes intercept this key combination, only the host OS would be rebooted.
On Linux and Oracle Solaris hosts, which use the X Window System, the key combination Ctrl+Alt+Backspace normally resets the X server and restarts the entire graphical user interface. As the X server intercepts this combination, pressing it will usually restart your host graphical user interface and kill all running programs, including Oracle VM VirtualBox, in the process.
If, instead, you want to send these key combinations to the guest OS in the virtual machine, you will need to use one of the following methods:
This menu also includes an option for inserting the Host key combination.
Use special key combinations with the Host key, which is normally the right Control key. Oracle VM VirtualBox then translates the following key combinations for the VM:
Host key + Del sends Ctrl+Alt+Del to reboot the guest OS.
Host key + Backspace sends Ctrl+Alt+Backspace to restart the graphical user interface of a Linux or Oracle Solaris guest.
A soft keyboard can be used to input key combinations in the guest. See Section 1.17, “Soft Keyboard”.
1.8.4.В Changing Removable Media
While a virtual machine is running, you can change removable media in the Devices menu of the VM’s window. Here you can select in detail what Oracle VM VirtualBox presents to your VM as a CD, DVD, or floppy drive.
The settings are the same as those available for the VM in the Settings dialog of the Oracle VM VirtualBox main window. But as the Settings dialog is disabled while the VM is in the Running or Saved state, the Devices menu saves you from having to shut down and restart the VM every time you want to change media.
Using the Devices menu, you can attach the host drive to the guest or select a floppy or DVD image, as described in Section 3.7, “Storage Settings”.
The Devices menu also includes an option for creating a virtual ISO (VISO) from selected files on the host.
1.8.5.В Resizing the Machine’s Window
You can resize the VM’s window while that VM is running. When you do, the window is scaled as follows:
If you have scaled mode enabled, then the virtual machine’s screen will be scaled to the size of the window. This can be useful if you have many machines running and want to have a look at one of them while it is running in the background. Alternatively, it might be useful to enlarge a window if the VM’s output screen is very small, for example because you are running an old OS in it.
The aspect ratio of the guest screen is preserved when resizing the window. To ignore the aspect ratio, press Shift during the resize operation.
See Known Limitations for additional remarks.
Otherwise, if the window is bigger than the VM’s screen, the screen will be centered. If it is smaller, then scroll bars will be added to the machine window.
1.8.6.В Saving the State of the Machine
FigureВ 1.8В Closing Down a Virtual Machine
The difference between the three options is crucial. They mean the following:
Save the machine state: With this option, Oracle VM VirtualBox freezes the virtual machine by completely saving its state to your local disk.
When you start the VM again later, you will find that the VM continues exactly where it was left off. All your programs will still be open, and your computer resumes operation. Saving the state of a virtual machine is thus in some ways similar to suspending a laptop computer by closing its lid.
Send the shutdown signal. This will send an ACPI shutdown signal to the virtual machine, which has the same effect as if you had pressed the power button on a real computer. This should trigger a proper shutdown mechanism from within the VM.
Power off the machine: With this option, Oracle VM VirtualBox also stops running the virtual machine, but without saving its state.
This is equivalent to pulling the power plug on a real computer without shutting it down properly. If you start the machine again after powering it off, your OS will have to reboot completely and may begin a lengthy check of its virtual system disks. As a result, this should not normally be done, since it can potentially cause data loss or an inconsistent state of the guest system on disk.
As an exception, if your virtual machine has any snapshots, see Section 1.10, “Snapshots”, you can use this option to quickly restore the current snapshot of the virtual machine. In that case, powering off the machine will not disrupt its state, but any changes made since that snapshot was taken will be lost.
The Discard button in the VirtualBox Manager window discards a virtual machine’s saved state. This has the same effect as powering it off, and the same warnings apply.
Copyright В© 2004, 2020 Oracle and/or its affiliates. All rights reserved. Legal Notices
Virtualbox how to use
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.
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.
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.
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.
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”.
How to Use VirtualBox: Quick Overview
When using a traditional you need to install the operating system on a physical machine for evaluating software that cannot be installed on your current operating system. Oracle VirtualBox is what you need in this case, instead of reinstalling software on your physical machine. VirtualBox is designed to run virtual machines on your physical machine without reinstalling your OS that is running on a physical machine. One more VirtualBox advantage is that this product can be installed for free. A virtual machine (VM) works much like a physical one. An OS and applications installed inside a VM “think” that they are running on a regular physical machine since emulated hardware is used for running VMs on VirtualBox. Virtual machines are isolated from each other and from the host operating system. Thus, you can perform your tests in isolated virtual machines without any concerns of damaging your host operating system or other virtual machines. Today’s blog post explores how to use VirtualBox and contains the following sections:
Operating Systems Supported by VirtualBox
VirtualBox supports a long list of host and guest operating systems. A host OS is the operating system installed on a physical machine, on which VirtualBox is installed. A guest OS is an operating system installed on a virtual machine running inside VirtualBox. VirtualBox can be installed on Windows, Linux, macOS, Solaris, and FreeBSD. On VirtualBox you can run VMs with Windows, Linux, macOS, Solaris, FreeBSD, Novell Netware, and other operating systems.
How to Set Up VirtualBox?
Let’s explore how to set up VirtualBox on Windows. The process of VirtualBox installation is not difficult and is similar for all supported operating systems.
Enable CPU virtualization features
First, you need to enable hardware virtualization features on your CPU (Central Processor Unit) such as Intel VT-X or AMD-V in UEFI/BIOS of your physical computer. Otherwise, if you run 64-bit guest operating systems, you can get the error: VT-x is not available. If Hyper-V is installed on your Windows machine, uninstall Hyper-V before installing VirtualBox (otherwise Hyper-V will block hardware virtualization extensions needed by VirtualBox to run VMs). The majority of modern processors support hardware virtualization.
Download the VirtualBox installer
Go to the official web site to download the VirtualBox installer for your operating system (Windows in this case). If you are looking for how to set up VirtualBox on mac, download the OS X installer. At the moment of writing this blog post, the latest VirtualBox version is 6.0.8. You can also download older versions, for example, version 5.2. VirtualBox 5.2 supports 32-bit hosts while VirtualBox 6.0 doesn’t. In the current example, you can see how to set up VirtualBox on an example of VirtualBox 5.2. In the next blog post, the VirtualBox upgrade process will be explained.
Run the installer and define the installation options
Run the VirtualBox installer. The installation wizard that has a GUI (graphical user interface) should appear.
Select the manner in which you want features to be installed, clicking on the installation directory and installed components—you can leave the default values. Then tick the checkboxes near shortcut options and file associations.
Confirm installation of VirtualBox network interfaces (click Yes).
On the Ready to Install Screen, hit Install to start the installation process.
After finishing installation, you can tick the checkbox for starting VirtualBox after installation.
Deploying a New VM
Once you have installed VirtualBox, open the application. You can see the graphical user interface of VirtualBox which is unified for all supported host operating systems. You can also use the command line interface and VBoxManage if needed. In the current example VirtualBox is set up on Windows 10. Imagine that you need to evaluate Windows Server 2019 before making a decision – to buy or not to buy. Let’s look at how to use VirtualBox for running Windows Server 2019 on a virtual machine.
Download the ISO image of Windows Server 2019 installer from the Microsoft’s site. Rename the downloaded ISO file to WinServer2019.iso for more convenience.
Creating a Virtual Machine
Click Machine > New or hit the icon with the blue star to create a new virtual machine in VirtualBox GUI.
Define the new VM options.
Type: Microsoft Windows.
Version: Windows 2016 (64-bit). This parameter defines the reasonable default amount of virtual memory, virtual disk size; a set of emulated hardware (devices that are supported by the selected OS version, drivers for which are included); as well as a set of system features such as EFI, PAE (physical address extension), I/O APIC (input/output advanced programmable interrupt controllers). If you are using the latest version of VirtualBox, Windows 2019 is available in the list of OS versions.
Memory size: Set memory for the VM. 8 GB of RAM should be enough for Windows Server 2019 for the beginning. You can add more memory later, after installing the guest OS (a VM must be powered off to change the amount of memory).
Hard Disk: Create a virtual hard disk now.
Click the Create button.
Creating a Virtual Hard Disk
Set the following parameters:
The name and file location for the virtual disk. Try not to use a system partition for storing virtual disks if possible.
The file size of the virtual disk. Select 50 GB for Windows Server 2019.
Hard disk file type. VirtualBox supports a lot of virtual disk formats:
Let’s select VDI in the current example.
Storage on physical hard disk: Dynamically allocated or fixed size (the analog of thin and thick provisioning in VMware). Select the dynamically allocated option if you want to save disk space, as in this case, the size of your virtual disk is near zero right after creation, and grows after writing data to the virtual disk before reaching the maximum allocated size.
Click Create to finish VM creation.
Virtual machine Tuning. Tune your virtual machine by going to Machine > Settings. The following sections are in this window.
General. You can edit the VM name, enable shared clipboard, drag & drop, write the VM description, and enable virtual disk encryption.
System. Disable a virtual floppy drive in the Motherboard tab. In the System tab, you can add more processors for the VM, configure acceleration, and select one of the two emulated chipsets.
Display. In the Screen tab, it is possible to set the video memory, monitor count, and scale factor as well as enabling 2D and 3D acceleration. The Remote Display tab allows you to manage your guest OS by connecting to the VirtualBox VM desktop remotely with RDP (Remote Desktop Protocol). Capturing video is configured in the Video Capture tab.
Storage. Add and remove virtual hard disks, virtual DVD drives, and disk controllers if needed. Select your DVD drive (it should be empty until this moment) and insert the virtual ISO DVD disc into the drive. Click the disc icon and select “Choose virtual optical disc file.” Browse your WinServer2019.iso file and open it. Now your ISO disc is displayed in the list of storage devices.
Audio. Audio can be enabled or disabled; the host audio driver, audio controller and extended features can be selected.
Network. Virtual network adapters are configured in this section. The maximum number of virtual network adapters per VM is four. A virtual network adapter can use a variety of different network modes: Not attached, NAT, NAT Network, Bridged Adapter, Internal Network, Host-only Adapter, Generic Driver, among which the NAT network mode is used by default.
When the NAT mode is selected, your VM is connected to the virtual router and can access the host, the network to which the host is connected and external networks that can be accessed by the host. If you deploy a single VM, which is not needed to be seen as a regular machine in your physical network, you can select the NAT mode for VM networking. If you want your VM to be fully representative in your physical network, use the Bridged mode.
The model of the emulated virtual network adapter is selected from the drop-down menu. You may set the MAC address manually if necessary. Configure Port Forwarding for accessing VMs that use the NAT network mode from the physical network your host machine is connected to (if necessary). If you use the bridged networking, you don’t need to configure port forwarding.
Serial Ports. Enable Serial ports if for some particular reason you need COM ports to be enabled on a VM.
USB. USB options for a VM are configured in this section.
Shared Folders. Shared folders are used for file exchange between host OS and guest OS.
User interface. Customize the elements of GUI if you wish.
Click OK to apply the edited VM configuration.
Installing a guest OS
Now you can start the VM. Hit Machine > Start > Normal Start.
Normal Start. Opens a VM window and displays the video output of the VM in that window similarly as the output of the physical machine is displayed on a monitor. When you close the VM window, VirtualBox asks you what to do:
Headless Start. A VM is started, but the Window with the video output of the VM is not appeared. You can connect to the VM for managing it by using a remote desktop protocol (including VRDP – VirtualBox Remote Display Protocol that is backward compatible with Microsoft RDP), SSH etc.
Detachable start. This is the combination of the normal start and headless start. When you close the VirtualBox VM window, one more option is available – Continue running in the background. You can close the VirtualBox VM window without interrupting the VM.
The OS installer is now booting from the ISO image inserted to a virtual DVD drive. This process is displayed in the new VirtualBox VM window. If you know how to set up Windows 10 on VirtualBox, or on a physical machine, the installation process of Windows Server 2019 in a GUI mode shouldn’t cause any problems.
Select suitable options for the Windows installation wizard:
Create a new partition (or partitions) on your 50-GB virtual hard disk.
The VM automatically restarts a few times during Windows Server 2019 installation.
Set the Windows administrator password to finish Windows Server 2019 setup on VirtualBox.
After loading, Windows asks you to press Ctrl+Alt+Delete to unlock. Click Input > Keyboard > Insert Ctrl+Alt+Del in the VirtualBox VM window.
Once you have logged in your Windows system, install VirtualBox Guest Additions. Guest Additions are a set of drivers and system utilities for supported guest operating systems that optimize the guest OS performance and usability, in addition to providing closer interaction between host and guest operating systems. Features such as mouse pointer integration, enhanced video mode support, shared folders, shared clipboard, and time synchronization can be enabled after installing VirtualBox Guest Additions on a guest OS. The ISO file with Guest Additions is located in the VirtualBox installation directory.
In the VirtualBox VM window, click Devices > Insert Guest Additions CD image. The virtual ISO disc is now inserted to the virtual DVD drive of your Windows VM.
Open the contents of the disc and run the VBoxWindowsAdditions-amd64.exe file. After the installation wizard opens, follow the tips of the wizard recommendations, clicking Next on each step to continue. In the end of installation, reboot the virtual machine.
Shared Folders and Clipboard
In order to configure shared folders, go to Machine > Settings and select the Shared Folders section. Hit the Add Share icon (a folder with a green plus), then enter the path of the folder you want shared on your host machine, and define the folder name. You can make a shared folder read-only and enable auto mount. In the current example, C:\Virtual\VirtualBox\shared_folder01 is used as a shared folder and the auto-mount option is enabled. Hit OK twice to apply changes.
Now the shared folder is shown as a disk Z: in your list of disks in This PC (My Computer). If you enabled the auto-mount option when configuring a shared folder, you don’t need to map a network drive manually, as it has already been mounted automatically (the first free disk letter is used for the disk mapping in this case). Now your shared folder is ready to copy files between the host and guest operating systems.
Shared Clipboard is a useful feature that allows you to copy a fragment of text, image, multiple files etc. on a guest OS and paste these items on a host OS (and vice versa), much as you can do inside your host OS between multiple applications.
Drag & Drop allows you to copy files and folders from guest OS windows to host OS windows (and inversely), much like you can do between two windows of Windows File Explorer.
In order to enable Shared Clipboard and Drag & Drop in VirtualBox, open VM settings, and in the General section, go to the Advanced tab. Select the Bidirectional option for shared clipboard and Drag & Drop features.
Making a VM Copy
One of the advantages of VMs is the ease of copying virtual machines and making machine clones. You can clone a VM by using built-in VirtualBox options and manually.
Go to Machine > Clone for using a built-in cloning tool.
Select the Expert mode.
Enter the new machine name (by default the “clone” word is appended to the original VM name). Choose the clone type (full clone or linked clone), snapshot options (current machine state or everything). In the case of VM cloning, unique identifiers of the operating system and virtual disks are changed.
If you select Full clone, a full copy of the source VM (including all virtual disk files) is created. All VM files are copied independently to the destination folder. A source VM is not needed for VM-clone operating.
If the Linked clone option is selected, all files of the source VM are not copied. A new VM is created, a snapshot of the parent virtual disk of the source VM is taken for creating differencing disks.
Reinitialize the MAC address of all network cards. Select this option if the MAC address on a source VM and VM clone must be different (for preventing network conflicts).
Copying a VM folder with all VM files can be considered manual backup of the virtual machine. Unique identifiers and other VM components remain the same, as the VM copy is an exact copy of a source VM. You can open a folder of the virtual machine by clicking Machine > Show in folder in the main VirtualBox window.
Using Snapshots
Snapshots allow you to save the working state of a VM and roll back to that state later after changes have been made in a VM. Using snapshots is recommended for testing, for example, when you need to install some applications and see how they work without any risk of harming the entire system. If applications work incorrectly or you need to try another version of software, just revert the VM state by using a snapshot that has been already created. This approach is convenient and helps you save a lot of time. Using snapshots is not, however, equal to making backups.
How to use VirtualBox for taking VM snapshots? Select your VM, click Machine Tools and select Snapshots to open a section with snapshot options. Hit the Take icon to create a new snapshot, then enter a snapshot name and description.
After taking a snapshot, a new differencing virtual disk will be created in the Snapshots subfolder of your VM folder. The file format is the same as for your original virtual disk (VDI in this case). All new changes made inside a VM after creating a snapshot are written to that differencing virtual disk. If you create a second snapshot, the second differencing virtual disk is created, and so on.
When you need to restore the virtual machine state from the snapshot, right click the snapshot name and in the context menu, select Restore. Check the box if you need to create a snapshot of the current virtual machine state. The VM must be in the powered off state. If the snapshot is not needed any more, it can be deleted.
When a snapshot located before the current VM state is being deleted, it is deleted by merging a differencing disk related to the snapshot with the parent virtual disk or differencing disk. If your current VM state is represented by a snapshot in the middle of the snapshot chain, deleting a snapshot in the end of the snapshot chain causes deletion of the differencing virtual disk file related to that snapshot without merging. Now you know how to set up VirtualBox, run and manage VMs as well as use VM snapshots.
Recording Video
This section tells you how to use VirtualBox for recording a video about everything that can be seen in the user interface of the virtual machine. When using physical machines, you cannot install software for recording a video of operating system installation, or console usage in the operating systems without GUI. VirtualBox helps you resolve this issue and has a built-in feature for video recording of everything you see in the virtual monitor (VirtualBox VM window).
In order to record a video, open Machine > Settings, go to the Video Capture tab, enable video capture and configure parameters of video recording (see the screenshot below).
Conclusion
Virtualbox how to use
Table of Contents
This chapter provides detailed steps for configuring an Oracle VM VirtualBox virtual machine (VM). For an introduction to Oracle VM VirtualBox and steps to get your first virtual machine running, see Chapter 1, First Steps.
You have considerable latitude when deciding what virtual hardware to provide to the guest. Use virtual hardware to communicate with the host system or with other guests. For example, you can use virtual hardware in the following ways:
Have Oracle VM VirtualBox present an ISO CD-ROM image to a guest system as if it were a physical CD-ROM.
Provide a guest system access to the physical network through its virtual network card.
Provide the host system, other guests, and computers on the Internet access to the guest system.
3.1. Supported Guest Operating Systems
Because Oracle VM VirtualBox is designed to provide a generic virtualization environment for x86 systems, it can run guest operating systems (OSes) of any kind.
The following guest OS platforms are supported:
Platforms With Full Support. These guest OS platforms qualify for Oracle Premier Support. See Table 3.1, “Guest Operating Systems With Full Support”.
Platforms With Limited Support. These legacy guest OS platforms can be used with Oracle VM VirtualBox, but only qualify for best effort support. Therefore, resolution of customer issues is not guaranteed. See Table 3.2, “Legacy Guest Operating Systems With Limited Support”.
Table 3.1. Guest Operating Systems With Full Support
Operating System
Comments
Windows 10 (32-bit and 64-bit)
Insider preview builds are not supported
Windows 8 and 8.1 (32-bit and 64-bit)
Windows Server 2019 (64-bit)
Windows Server 2016 (64-bit)
Windows Server 2012 and 2012 R2 (64-bit)
Solaris 11 (32-bit and 64-bit)
Solaris 10 8/11 Update 10 and later (32-bit and 64-bit)
Oracle Linux 8 (64-bit)
Includes Red Hat Enterprise Linux 8, CentOS 8
Oracle Linux 7 (64-bit)
Includes Red Hat Enterprise Linux 7, CentOS 7
Oracle Linux 6 (32-bit and 64-bit)
Includes Red Hat Enterprise Linux 6, CentOS 6
Ubuntu 16.04 LTS (Xenial Xerus) (32-bit and 64-bit)
Ubuntu 18.04 LTS (Bionic Beaver) (64-bit)
Ubuntu 20.04 LTS (Focal Fossa) (64-bit)
SUSE Linux Enterprise Server 15 (64-bit)
SUSE Linux Enterprise Server 12 (64-bit)
Table 3.2. Legacy Guest Operating Systems With Limited Support
Operating System
Comments
Windows 7 (32-bit and 64-bit)
Windows Vista SP2 and later (32-bit and 64-bit)
Windows XP (32-bit)
Windows Vista (32-bit)
Windows Server 2008 and 2008 R2 (32-bit and 64-bit)
Windows Server 2003 (32-bit and 64-bit)
Oracle Linux 5 (32-bit and 64-bit)
Includes Red Hat Enterprise Linux 5, CentOS 5
Ubuntu 14.04.5 LTS (Trusty Tahr) (32-bit and 64-bit)
3.1.1. Mac OS X Guests
Oracle VM VirtualBox enables you to install and execute unmodified versions of Mac OS X guests on supported host hardware. Note that this feature is experimental and thus unsupported.
Oracle VM VirtualBox is the first product to provide the modern PC architecture expected by OS X without requiring any of the modifications used by competing virtualization solutions. For example, some competing solutions perform modifications to the Mac OS X install DVDs, such as a different boot loader and replaced files.
Be aware of the following important issues before you attempt to install a Mac OS X guest:
Mac OS X is commercial, licensed software and contains both license and technical restrictions that limit its use to certain hardware and usage scenarios. You must understand and comply with these restrictions.
In particular, Apple prohibits the installation of most versions of Mac OS X on non-Apple hardware.
These license restrictions are also enforced on a technical level. Mac OS X verifies that it is running on Apple hardware. Most DVDs that accompany Apple hardware check for the exact model. These restrictions are not circumvented by Oracle VM VirtualBox and continue to apply.
Only CPUs that are known and tested by Apple are supported. As a result, if your Intel CPU is newer than the Mac OS X build, or if you have a non-Intel CPU, you will likely encounter a panic during bootup with an «Unsupported CPU» exception.
Ensure that you use the Mac OS X DVD that comes with your Apple hardware.
In addition, Mac OS X support in Oracle VM VirtualBox is an experimental feature. See Chapter 14, Known Limitations.
3.1.2. 64-bit Guests
Warning
Be sure to enable I/O APIC for virtual machines that you intend to use in 64-bit mode. This is especially true for 64-bit Windows VMs. See Section 3.4.2, “Advanced Tab”. For 64-bit Windows guests, ensure that the VM uses the Intel networking device because there is no 64-bit driver support for the AMD PCNet card. See Section 6.1, “Virtual Networking Hardware”.
If you use the Create VM wizard of the VirtualBox Manager, Oracle VM VirtualBox automatically uses the correct settings for each selected 64-bit OS type. See Section 1.7, “Creating Your First Virtual Machine”.
3.2. Unattended Guest Installation
Oracle VM VirtualBox can install a guest OS automatically. You only need to provide the installation medium and a few other parameters, such as the name of the default user.
Performing an unattended guest installation involves the following steps:
Create a new VM. Use one of the following methods:
For the new VM, choose the guest OS type and accept the default settings for that OS. The following sections in this chapter describe how to change the settings for a VM.
Prepare the VM for unattended guest installation. Use the VBoxManage unattended command, see Section 8.37, “VBoxManage unattended”.
During this step, Oracle VM VirtualBox scans the installation medium and changes certain parameters to ensure a seamless installation as a guest running on Oracle VM VirtualBox.
Start the VM. Use the VirtualBox Manager or the VBoxManage startvm command.
When you start the VM, the unattended installation is performed automatically.
The installation operation changes the boot device order to boot the virtual hard disk first and then the virtual DVD drive. If the virtual hard disk is empty prior to the automatic installation, the VM boots from the virtual DVD drive and begins the installation.
If the virtual hard disk contains a bootable OS, the installation operation exits. In this case, change the boot device order manually by pressing F12 during the BIOS splash screen.
Section 3.2.1, “An Example of Unattended Guest Installation” describes how to perform an unattended guest installation for an Oracle Linux guest.
3.2.1. An Example of Unattended Guest Installation
The following example shows how to perform an unattended guest installation for an Oracle Linux VM. The example uses various VBoxManage commands to prepare the guest VM. The VBoxManage unattended install command is then used to install and configure the guest OS.
Create the virtual machine.
Note the following:
The VBoxManage list ostypes command lists the guest OSes supported by Oracle VM VirtualBox, including the name used for each OS in the VBoxManage commands.
A 64-bit Oracle Linux 7 VM is created and registered with Oracle VM VirtualBox.
The VM has a unique UUID.
An XML settings file is generated.
Create a virtual hard disk and storage devices for the VM.
The previous commands do the following:
Create a 32768 MB virtual hard disk.
Create a SATA storage controller and attach the virtual hard disk.
Create an IDE storage controller for a virtual DVD drive and attach an Oracle Linux installation ISO.
(Optional) Configure some settings for the VM.
The previous commands do the following:
Enable I/O APIC for the motherboard of the VM.
Configure the boot device order for the VM.
Allocate 8192 MB of RAM and 128 MB of video RAM to the VM.
Perform an unattended install of the OS.
The previous command does the following:
Specifies an Oracle Linux ISO as the installation ISO.
Specifies a login name, full name, and login password for a default user on the guest OS.
Note that the specified password is also used for the root user account on the guest.
Installs the Guest Additions on the VM.
Sets the time zone for the guest OS to Central European Time (CET).
Start the virtual machine.
This step completes the unattended installation process.
The VM starts in headless mode, which means that the VirtualBox Manager window does not open.
(Optional) Update the guest OS to use the latest Oracle Linux packages.
On the guest VM, run the following command:
3.3. Emulated Hardware
Oracle VM VirtualBox virtualizes nearly all hardware of the host. Depending on a VM’s configuration, the guest will see the following virtual hardware:
Input devices. Oracle VM VirtualBox can emulate a standard PS/2 keyboard and mouse. These devices are supported by most guest OSes.
In addition, Oracle VM VirtualBox can provide virtual USB input devices to avoid having to capture mouse and keyboard, as described in Section 1.8.2, “Capturing and Releasing Keyboard and Mouse”.
Graphics. The default Oracle VM VirtualBox graphics device for Windows guests is an SVGA device. For Linux guests, the default graphics device emulates a VMware SVGA graphics device. See Section 3.6.1, “Screen Tab”.
For legacy guest OSes, a VGA-compatible graphics device is available.
Storage. Oracle VM VirtualBox emulates the most common types of hard disk controllers. See Section 5.1, “Hard Disk Controllers”. Whereas supporting only one of these controllers would be enough for Oracle VM VirtualBox by itself, this multitude of storage adapters is required for compatibility with other hypervisors. Windows is very selective about its boot devices, and migrating VMs between hypervisors is very difficult or impossible if the storage controllers are different.
USB. Oracle VM VirtualBox emulates these types of USB host controllers: xHCI, EHCI, and OHCI. While xHCI handles all USB transfer speeds, some legacy guest OSes may not support xHCI. Note that for some legacy Windows guests, third party drivers must be installed for xHCI support.
Legacy guest OSes typically support OHCI and EHCI. These two controllers are needed because OHCI only handles USB low-speed and full-speed devices (both USB 1.x and 2.0), while EHCI only handles high-speed devices (USB 2.0 only).
The emulated USB controllers do not communicate directly with devices on the host. Instead they communicate with a virtual USB layer which abstracts the USB protocol and enables the use of remote USB devices.
3.4. General Settings
3.4.1. Basic Tab
In the Basic tab of the General settings category, you can find these settings:
Name: The name of the the VM, as shown in the list of VMs in the main VirtualBox Manager window. Using this name, Oracle VM VirtualBox also saves the VM’s configuration files. If you change the name, Oracle VM VirtualBox renames these files as well. As a result, you can only use characters which are allowed for file names on your host OS.
Note that internally, Oracle VM VirtualBox uses unique identifiers (UUIDs) to identify virtual machines. You can display these using the VBoxManage commands.
Type: The type of the guest OS for the VM. This is the same setting that is specified in the New Virtual Machine wizard. See Section 1.7, “Creating Your First Virtual Machine”.
Whereas the default settings of a newly created VM depend on the selected OS type, changing the type later has no effect on VM settings. This value is purely informational and decorative.
Version: The version of the guest OS for the VM. This is the same setting that is specified in the New Virtual Machine wizard. See Section 1.7, “Creating Your First Virtual Machine”.
3.4.2. Advanced Tab
The following settings are available in the Advanced tab:
Snapshot Folder: By default, Oracle VM VirtualBox saves snapshot data together with your other Oracle VM VirtualBox configuration data. See Section 10.1, “Where Oracle VM VirtualBox Stores its Files”. With this setting, you can specify any other folder for each VM.
Clipboard sharing requires that the Oracle VM VirtualBox Guest Additions be installed. In such a case, this setting has no effect. See Chapter 4, Guest Additions.
For security reasons, the shared clipboard is disabled by default. This setting can be changed at any time using the Shared Clipboard menu item in the Devices menu of the virtual machine.
Drag and Drop: This setting enables support for drag and drop. Select an object, such as a file, from the host or guest and directly copy or open it on the guest or host. Multiple drag and drop modes for a VM enable restricting of access in either direction.
For drag and drop to work the Guest Additions need to be installed on the guest.
Drag and drop is disabled by default. This setting can be changed at any time using the Drag and Drop menu item in the Devices menu of the virtual machine.
3.4.3. Description Tab
On the Description tab you can enter a description for your virtual machine. This has no effect on the functionality of the machine, but you may find this space useful to note down things such as the configuration of a virtual machine and the software that has been installed into it.
To insert a line break into the Description text field, press Shift+Enter.
3.4.4. Disk Encryption Tab
The Disk Encryption tab enables you to encrypt disks that are attached to the virtual machine.
To enable disk encryption, select the Enable Disk Encryption check box.
Settings are available to configure the cipher used for encryption and the encryption password.
All files related to the virtual machine except disk images are stored unencrypted.
3.5. System Settings
The System category groups various settings that are related to the basic hardware that is presented to the virtual machine.
As the activation mechanism of Microsoft Windows is sensitive to hardware changes, if you are changing hardware settings for a Windows guest, some of these changes may trigger a request for another activation with Microsoft.
The following tabs are available.
3.5.1. Motherboard Tab
On the Motherboard tab, you can configure virtual hardware that would normally be on the motherboard of a real computer.
Base Memory: Sets the amount of RAM that is allocated and given to the VM when it is running. The specified amount of memory will be requested from the host OS, so it must be available or made available as free memory on the host when attempting to start the VM and will not be available to the host while the VM is running. This is the same setting that was specified in the New Virtual Machine wizard, as described in Section 1.7, “Creating Your First Virtual Machine”.
Generally, it is possible to change the memory size after installing the guest OS. But you must not reduce the memory to an amount where the OS would no longer boot.
Boot Order: Determines the order in which the guest OS will attempt to boot from the various virtual boot devices. Analogous to a real PC’s BIOS setting, Oracle VM VirtualBox can tell a guest OS to start from the virtual floppy, the virtual CD/DVD drive, the virtual hard drive (each of these as defined by the other VM settings), the network, or none of these.
Chipset: You can select which chipset will be presented to the virtual machine. PIIX3 is the default chipset for most guests. For some guest OSes such as Mac OS X, the PIIX3 chipset is not well supported. As a result, Oracle VM VirtualBox supports an emulation of the ICH9 chipset, which supports PCI express, three PCI buses, PCI-to-PCI bridges and Message Signaled Interrupts (MSI). This enables modern OSes to address more PCI devices and no longer requires IRQ sharing. Using the ICH9 chipset it is also possible to configure up to 36 network cards, compared to a maximum of eight network adapters with PIIX3. Note that ICH9 support is experimental and not recommended for guest OSes which do not require it.
Using the virtual USB tablet has the advantage that movements are reported in absolute coordinates, instead of as relative position changes. This enables Oracle VM VirtualBox to translate mouse events over the VM window into tablet events without having to «capture» the mouse in the guest as described in Section 1.8.2, “Capturing and Releasing Keyboard and Mouse”. This makes using the VM less tedious even if Guest Additions are not installed.
Enable I/O APIC: Advanced Programmable Interrupt Controllers (APICs) are an x86 hardware feature that have replaced Programmable Interrupt Controllers (PICs). With an I/O APIC, OSes can use more than 16 interrupt requests (IRQs) and therefore avoid IRQ sharing for improved reliability.
However, software support for I/O APICs has been unreliable with some OSes other than Windows. Also, the use of an I/O APIC slightly increases the overhead of virtualization and therefore slows down the guest OS a little.
Warning
All Windows OSes install different kernels, depending on whether an I/O APIC is available. As with ACPI, the I/O APIC therefore must not be turned off after installation of a Windows guest OS. Turning it on after installation will have no effect however.
Enable EFI: Enables Extensible Firmware Interface (EFI), which replaces the legacy BIOS and may be useful for certain advanced use cases. See Section 3.14, “Alternative Firmware (EFI)”.
Hardware Clock in UTC Time: If selected, Oracle VM VirtualBox will report the system time in UTC format to the guest instead of the local (host) time. This affects how the virtual real-time clock (RTC) operates and may be useful for UNIX-like guest OSes, which typically expect the hardware clock to be set to UTC.
In addition, you can turn off the Advanced Configuration and Power Interface (ACPI) which Oracle VM VirtualBox presents to the guest OS by default.
ACPI is the current industry standard to allow OSes to recognize hardware, configure motherboards and other devices and manage power. As most computers contain this feature and Windows and Linux support ACPI, it is also enabled by default in Oracle VM VirtualBox. ACPI can only be turned off using the command line. See Section 8.8, “VBoxManage modifyvm”.
Warning
All Windows OSes install different kernels, depending on whether ACPI is available. This means that ACPI must not be turned off after installation of a Windows guest OS. However, turning it on after installation will have no effect.
3.5.2. Processor Tab
On the Processor tab, you can configure settings for the CPU used by the virtual machine.
Processor(s): Sets the number of virtual CPU cores the guest OSes can see. Oracle VM VirtualBox supports symmetrical multiprocessing (SMP) and can present up to 32 virtual CPU cores to each virtual machine.
You should not configure virtual machines to use more CPU cores than are available physically. This includes real cores, with no hyperthreads.
Execution Cap: Configures the CPU execution cap. This limits the amount of time a host CPU spends to emulate a virtual CPU. The default setting is 100%, meaning that there is no limitation. A setting of 50% implies a single virtual CPU can use up to 50% of a single host CPU. Note that limiting the execution time of the virtual CPUs may cause guest timing problems.
A warning is displayed at the bottom of the Processor tab if an Execution Cap setting is made that may affect system performance.
Enable PAE/NX: Determines whether the PAE and NX capabilities of the host CPU will be exposed to the virtual machine.
PAE stands for Physical Address Extension. Normally, if enabled and supported by the OS, then even a 32-bit x86 CPU can access more than 4 GB of RAM. This is made possible by adding another 4 bits to memory addresses, so that with 36 bits, up to 64 GB can be addressed. Some OSes, such as Ubuntu Server, require PAE support from the CPU and cannot be run in a virtual machine without it.
Enable Nested VT-x/AMD-V : Enables nested virtualization, with passthrough of hardware virtualization functions to the guest VM.
With virtual machines running modern server OSes, Oracle VM VirtualBox also supports CPU hot-plugging. For details, see Section 9.4, “CPU Hot-Plugging”.
3.5.3. Acceleration Tab
On this tab, you can configure Oracle VM VirtualBox to use hardware virtualization extensions that your host CPU supports.
Hardware Virtualization: You can configure hardware virtualization features for each virtual machine.
Enable Nested Paging: If the host CPU supports the nested paging (AMD-V) or EPT (Intel VT-x) features, then you can expect a significant performance increase by enabling nested paging in addition to hardware virtualization. For technical details, see Section 10.6, “Nested Paging and VPIDs”. For Intel EPT security recommendations, see Section 13.4.1, “CVE-2018-3646”.
Advanced users may be interested in technical details about hardware virtualization. See Section 10.3, “Hardware Virtualization”.
In most cases, the default settings on the Acceleration tab will work well. Oracle VM VirtualBox selects sensible defaults, depending on the OS that you selected when you created the virtual machine. In certain situations, however, you may want to change the preconfigured defaults.
3.6. Display Settings
The following tabs are available for configuring the display for a virtual machine.
3.6.1. Screen Tab
Video Memory: Sets the size of the memory provided by the virtual graphics card available to the guest, in MB. As with the main memory, the specified amount will be allocated from the host’s resident memory. Based on the amount of video memory, higher resolutions and color depths may be available.
Monitor Count: With this setting, Oracle VM VirtualBox can provide more than one virtual monitor to a virtual machine. If a guest OS supports multiple attached monitors, Oracle VM VirtualBox can pretend that multiple virtual monitors are present. Up to eight such virtual monitors are supported.
The output of the multiple monitors are displayed on the host in multiple VM windows which are running side by side. However, in full screen and seamless mode, they use the available physical monitors attached to the host. As a result, for full screen and seamless modes to work with multiple monitors, you will need at least as many physical monitors as you have virtual monitors configured, or Oracle VM VirtualBox will report an error.
You can configure the relationship between guest and host monitors using the View menu by pressing Host key + Home when you are in full screen or seamless mode.
Scale Factor: Enables scaling of the display size. For multiple monitor displays, you can set the scale factor for individual monitors, or globally for all of the monitors. Use the slider to select a scaling factor up to 200%.
You can set a default scale factor for all VMs. Use the Display tab in the Global Settings dialogs.
Graphics Controller: Specifies the graphics adapter type used by the guest VM. Note that you must install the Guest Additions on the guest VM to specify the VBoxSVGA or VMSVGA graphics controller. The following options are available:
VBoxSVGA: The default graphics controller for new VMs that use Windows 7 or later.
This graphics controller improves performance and 3D support when compared to the legacy VBoxVGA option.
VBoxVGA: Use this graphics controller for legacy guest OSes. This is the default graphics controller for Windows versions before Windows 7 and for Oracle Solaris.
3D acceleration is not supported for this graphics controller.
VMSVGA: Use this graphics controller to emulate a VMware SVGA graphics device. This is the default graphics controller for Linux guests.
None: Does not emulate a graphics adapter type.
Enable 3D Acceleration: If a virtual machine has Guest Additions installed, you can select here whether the guest should support accelerated 3D graphics. See Section 4.5.1, “Hardware 3D Acceleration (OpenGL and Direct3D 8/9)”.
Enable 2D Video Acceleration: If a virtual machine with Microsoft Windows has Guest Additions installed, you can select here whether the guest should support accelerated 2D video graphics. See Section 4.5.2, “Hardware 2D Video Acceleration for Windows Guests”.
3.6.2. Remote Display Tab
On the Remote Display tab, if the VirtualBox Remote Display Extension (VRDE) is installed, you can enable the VRDP server that is built into Oracle VM VirtualBox. This enables you to connect to the console of the virtual machine remotely with any standard RDP viewer, such as mstsc.exe that comes with Microsoft Windows. On Linux and Oracle Solaris systems you can use the standard open source rdesktop program. These features are described in Section 7.1, “Remote Display (VRDP Support)”.
Enable Server: Select this check box and configure settings for the remote display connection.
3.6.3. Recording Tab
On the Recording tab you can enable video and audio recording for a virtual machine and change related settings. Note that these features can be enabled and disabled while a VM is running.
Enable Recording: Select this check box and select a Recording Mode option.
Recording Mode: You can choose to record video, audio, or both video and audio.
Some settings on the Recording tab may be grayed out, depending on the Recording Mode setting.
File Path: The file where the recording is saved.
Frame Size: The video resolution of the recorded video, in pixels. The drop-down list enables you to select from common frame sizes.
Frame Rate: Use the slider to set the maximum number of video frames per second (FPS) to record. Frames that have a higher frequency are skipped. Increasing this value reduces the number of skipped frames and increases the file size.
Video Quality: Use the slider to set the the bit rate of the video in kilobits per second. Increasing this value improves the appearance of the video at the cost of an increased file size.
Audio Quality: Use the slider to set the quality of the audio recording. Increasing this value improves the audio quality at the cost of an increased file size.
Screens: For a multiple monitor display, you can select which screens to record video from.
As you adjust the video and audio recording settings, the approximate output file size for a five minute video is shown.
3.7. Storage Settings
The Storage category in the VM settings enables you to connect virtual hard disk, CD/DVD, and floppy images and drives to your virtual machine.
In a real computer, so-called storage controllers connect physical disk drives to the rest of the computer. Similarly, Oracle VM VirtualBox presents virtual storage controllers to a virtual machine. Under each controller, the virtual devices, such as hard disks, CD/DVD or floppy drives, attached to the controller are shown.
This section gives a quick introduction to the Oracle VM VirtualBox storage settings. See Chapter 5, Virtual Storage for a full description of the available storage settings in Oracle VM VirtualBox.
If you have used the Create VM wizard to create a machine, you will normally see something like the following:
Figure 3.1. Storage Settings for a Virtual Machine
Depending on the guest OS type that you selected when you created the VM, a new VM includes the following storage devices:
IDE controller. A virtual CD/DVD drive is attached to device 0 on the secondary channel of the IDE controller.
SATA controller. This is a modern type of storage controller for higher hard disk data throughput, to which the virtual hard disks are attached. Initially you will normally have one such virtual disk, but as shown in the previous screenshot, you can have more than one. Each is represented by a disk image file, such as a VDI file in this example.
If you created your VM with an older version of Oracle VM VirtualBox, the default storage layout may differ. You might then only have an IDE controller to which both the CD/DVD drive and the hard disks have been attached. This might also apply if you selected an older OS type when you created the VM. Since older OSes do not support SATA without additional drivers, Oracle VM VirtualBox will make sure that no such devices are present initially. See Section 5.1, “Hard Disk Controllers”.
You can modify these media attachments freely. For example, if you wish to copy some files from another virtual disk that you created, you can connect that disk as a second hard disk, as in the above screenshot. You could also add a second virtual CD/DVD drive, or change where these items are attached. The following options are available:
See Section 5.2, “Disk Image Files (VDI, VMDK, VHD, HDD)” for information on the image file types that are supported by Oracle VM VirtualBox.
For virtual CD/DVD drives, the image files will typically be in the standard ISO format instead. Most commonly, you will select this option when installing an OS from an ISO file that you have obtained from the Internet. For example, most Linux distributions are available in this way.
Depending on the type of disk image, you can set the following Attributes for the disk image in the right part of the Storage settings page:
The device slot of the controller that the virtual disk is connected to. IDE controllers have four slots: primary device 0, primary device 1, secondary device 0, and secondary device 1. By contrast, SATA and SCSI controllers offer you up to 30 slots for attaching virtual devices.
Solid-state Drive presents a virtual disk to the guest as a solid-state device.
Hot-pluggable presents a virtual disk to the guest as a hot-pluggable device.
Removable media, such as CD/DVDs and floppies, can be changed while the guest is running. Since the Settings dialog is not available at that time, you can also access these settings from the Devices menu of your virtual machine window.
3.8. Audio Settings
The Audio section in a virtual machine’s Settings window determines whether the VM will detect a connected sound card, and if the audio output should be played on the host system.
To enable audio for a guest, select the Enable Audio check box. The following settings are available:
Host Audio Driver: The audio driver that Oracle VM VirtualBox uses on the host. On a Linux host, depending on your host configuration, you can select between the OSS, ALSA, or the PulseAudio subsystem. On newer Linux distributions, the PulseAudio subsystem is preferred.
Only OSS is supported on Oracle Solaris hosts. The Oracle Solaris Audio audio backend is no longer supported on Oracle Solaris hosts.
Audio Controller: You can choose between the emulation of an Intel AC’97 controller, an Intel HD Audio controller, or a SoundBlaster 16 card.
Enable Audio Output: Enables audio output only for the VM.
Enable Audio Input: Enables audio input only for the VM.
3.9. Network Settings
The Network section in a virtual machine’s Settings window enables you to configure how Oracle VM VirtualBox presents virtual network cards to your VM, and how they operate.
When you first create a virtual machine, Oracle VM VirtualBox by default enables one virtual network card and selects the Network Address Translation (NAT) mode for it. This way the guest can connect to the outside world using the host’s networking and the outside world can connect to services on the guest which you choose to make visible outside of the virtual machine.
This default setup is good for the majority of Oracle VM VirtualBox users. However, Oracle VM VirtualBox is extremely flexible in how it can virtualize networking. It supports many virtual network cards per virtual machine. The first four virtual network cards can be configured in detail in the VirtualBox Manager window. Additional network cards can be configured using the VBoxManage command.
Many networking options are available. See Chapter 6, Virtual Networking for more information.
3.10. Serial Ports
Oracle VM VirtualBox supports the use of virtual serial ports in a virtual machine.
Ever since the original IBM PC, personal computers have been equipped with one or two serial ports, also called COM ports by DOS and Windows. Serial ports were commonly used with modems, and some computer mice used to be connected to serial ports before USB became commonplace.
While serial ports are no longer as common as they used to be, there are still some important uses left for them. For example, serial ports can be used to set up a primitive network over a null-modem cable, in case Ethernet is not available. Also, serial ports are indispensable for system programmers needing to do kernel debugging, since kernel debugging software usually interacts with developers over a serial port. With virtual serial ports, system programmers can do kernel debugging on a virtual machine instead of needing a real computer to connect to.
If a virtual serial port is enabled, the guest OS sees a standard 16550A compatible UART device. Other UART types can be configured using the VBoxManage modifyvm command. Both receiving and transmitting data is supported. How this virtual serial port is then connected to the host is configurable, and the details depend on your host OS.
You can configure up to four virtual serial ports per virtual machine. For each device, you must set the following:
Port Number: This determines the serial port that the virtual machine should see. For best results, use the traditional values as follows:
COM1: I/O base 0x3F8, IRQ 4
COM2: I/O base 0x2F8, IRQ 3
COM3: I/O base 0x3E8, IRQ 4
COM4: I/O base 0x2E8, IRQ 3
You can also configure a user-defined serial port. Enter an I/O base address and interrupt (IRQ).
Port Mode: What the virtual port is connected to. For each virtual serial port, you have the following options:
Disconnected: The guest will see the device, but it will behave as if no cable had been connected to it.
Host Pipe: Configure Oracle VM VirtualBox to connect the virtual serial port to a software pipe on the host. This depends on your host OS, as follows:
On a Windows host, data will be sent and received through a named pipe. The pipe name must be in the format \\.\pipe\ name where name should identify the virtual machine but may be freely chosen.
On a Mac OS, Linux, or Oracle Solaris host, a local domain socket is used instead. The socket filename must be chosen such that the user running Oracle VM VirtualBox has sufficient privileges to create and write to it. The /tmp directory is often a good candidate.
On Linux there are various tools which can connect to a local domain socket or create one in server mode. The most flexible tool is socat and is available as part of many distributions.
In this case, you can configure whether Oracle VM VirtualBox should create the named pipe, or the local domain socket non-Windows hosts, itself or whether Oracle VM VirtualBox should assume that the pipe or socket exists already. With the VBoxManage command-line options, this is referred to as server mode or client mode, respectively.
For a direct connection between two virtual machines, corresponding to a null-modem cable, simply configure one VM to create a pipe or socket and another to attach to it.
Raw File: Send the virtual serial port output to a file. This option is very useful for capturing diagnostic output from a guest. Any file may be used for this purpose, as long as the user running Oracle VM VirtualBox has sufficient privileges to create and write to the file.
TCP Socket: Useful for forwarding serial traffic over TCP/IP, acting as a server, or it can act as a TCP client connecting to other servers. This option enables a remote machine to directly connect to the guest’s serial port using TCP.
TCP Server: Deselect the Connect to Existing Pipe/Socket check box and specify the port number in the Path/Address field. This is typically 23 or 2023. Note that on UNIX-like systems you will have to use a port a number greater than 1024 for regular users.
The client can use software such as PuTTY or the telnet command line tool to access the TCP Server.
TCP Client: To create a virtual null-modem cable over the Internet or LAN, the other side can connect using TCP by specifying hostname : port in the Path/Address field. The TCP socket will act in client mode if you select the Connect to Existing Pipe/Socket check box.
Up to four serial ports can be configured per virtual machine, but you can pick any port numbers out of the above. However, serial ports cannot reliably share interrupts. If both ports are to be used at the same time, they must use different interrupt levels, for example COM1 and COM2, but not COM1 and COM3.
Virtualbox how to use
For the various versions of Linux that are supported as host operating systems, see Section 1.4, “Supported Host Operating Systems”.
You may need to install the following packages on your Linux system before starting the installation. Some systems will do this for you automatically when you install Oracle VM VirtualBox.
Qt 5.3.2 or later. Qt 5.6.2 or later is recommended.
SDL 1.2.7 or later. This graphics library is typically called libsdl or similar.
2.3.2. The Oracle VM VirtualBox Kernel Modules
In order to run other operating systems in virtual machines alongside your main operating system, Oracle VM VirtualBox needs to integrate very tightly with your system. To do this it installs a driver module called vboxdrv into the system kernel. The kernel is the part of the operating system which controls your processor and physical hardware. Without this kernel module, you can still use the VirtualBox Manager to configure virtual machines, but they will not start.
Network drivers called vboxnetflt and vboxnetadp are also installed. They enable virtual machines to make more use of your computer’s network capabilities and are needed for any virtual machine networking beyond the basic NAT mode.
Since distributing driver modules separately from the kernel is not something which Linux supports well, the Oracle VM VirtualBox install process creates the modules on the system where they will be used. This means that you may need to install some software packages from the distribution which are needed for the build process. Required packages may include the following:
GNU compiler (GCC)
Kernel header files
Also ensure that all system updates have been installed and that your system is running the most up-to-date kernel for the distribution.
The running kernel and the kernel header files must be updated to matching versions.
On some SUSE and openSUSE Linux versions, you may need to install the kernel-source and kernel-syms packages.
If you suspect that something has gone wrong with module installation, check that your system is set up as described above and try running the following command, as root:
2.3.2.1. Kernel Modules and UEFI Secure Boot
If you are running on a system using UEFI (Unified Extensible Firmware Interface) Secure Boot, you may need to sign the following kernel modules before you can load them:
See your system documentation for details of the kernel module signing process.
2.3.3. Performing the Installation
Oracle VM VirtualBox is available in a number of package formats native to various common Linux distributions. See Section 1.4, “Supported Host Operating Systems”. In addition, there is an alternative generic installer (.run) which you can use on supported Linux distributions.
2.3.3.1. Installing Oracle VM VirtualBox from a Debian or Ubuntu Package
Download the appropriate package for your distribution. The following example assumes that you are installing to a 64-bit Ubuntu Xenial system. Use dpkg to install the Debian package,as follows:
The installer will also try to build kernel modules suitable for the current running kernel. If the build process is not successful you will be shown a warning and the package will be left unconfigured. Look at /var/log/vbox-install.log to find out why the compilation failed. You may have to install the appropriate Linux kernel headers, see Section 2.3.2, “The Oracle VM VirtualBox Kernel Modules”. After correcting any problems, run the following command:
This will start a second attempt to build the module.
If a suitable kernel module was found in the package or the module was successfully built, the installation script will attempt to load that module. If this fails, please see Section 12.7.1, “Linux Kernel Module Refuses to Load” for further information.
Once Oracle VM VirtualBox has been successfully installed and configured, you can start it by clicking VirtualBox in your Start menu or from the command line. See Section 2.3.5, “Starting Oracle VM VirtualBox on Linux”.
2.3.3.2. Using the Alternative Generic Installer (VirtualBox.run)
The alternative generic installer performs the following steps:
The installer must be executed as root with either install or uninstall as the first parameter. For example:
Or if you do not have the sudo command available, run the following as root instead:
2.3.3.3. Performing a Manual Installation
If you cannot use the shell script installer described in Section 2.3.3.2, “Using the Alternative Generic Installer (VirtualBox.run)”, you can perform a manual installation. Run the installer as follows:
This will unpack all the files needed for installation in the directory install under the current directory. The Oracle VM VirtualBox application files are contained in VirtualBox.tar.bz2 which you can unpack to any directory on your system. For example:
To run the same example as root, use the following commands:
The sources for Oracle VM VirtualBox’s kernel module are provided in the src directory. To build the module, change to the directory and use the following command:
If everything builds correctly, run the following command to install the module to the appropriate module directory:
In case you do not have sudo, switch the user account to root and run the following command:
On certain Linux distributions, you might experience difficulties building the module. You will have to analyze the error messages from the build system to diagnose the cause of the problems. In general, make sure that the correct Linux kernel sources are used for the build process.
Note that the /dev/vboxdrv kernel module device node must be owned by root:root and must be read/writable only for the user.
Next, you install the system initialization script for the kernel module and activate the initialization script using the right method for your distribution, as follows:
This example assumes you installed Oracle VM VirtualBox to the /opt/VirtualBox directory.
Create a configuration file for Oracle VM VirtualBox, as follows:
Create the following symbolic links:
2.3.3.4. Updating and Uninstalling Oracle VM VirtualBox
Before updating or uninstalling Oracle VM VirtualBox, you must terminate any virtual machines which are currently running and exit the Oracle VM VirtualBox or VBoxSVC applications. To update Oracle VM VirtualBox, simply run the installer of the updated version. To uninstall Oracle VM VirtualBox, run the installer as follows:
As root, you can use the following command:
To manually uninstall Oracle VM VirtualBox, perform the manual installation steps in reverse order.
2.3.3.5. Automatic Installation of Debian Packages
The Debian packages will request some user feedback when installed for the first time. The debconf system is used to perform this task. To prevent any user interaction during installation, default values can be defined. A file vboxconf can contain the following debconf settings:
The first line enables compilation of the vboxdrv kernel module if no module was found for the current kernel. The second line enables the package to delete any old vboxdrv kernel modules compiled by previous installations.
These default settings can be applied prior to the installation of the Oracle VM VirtualBox Debian package, as follows:
In addition there are some common configuration options that can be set prior to the installation. See Section 2.3.3.7, “Automatic Installation Options”.
2.3.3.6. Automatic Installation of RPM Packages
The RPM format does not provide a configuration system comparable to the debconf system. See Section 2.3.3.7, “Automatic Installation Options” for how to set some common installation options provided by Oracle VM VirtualBox.
2.3.3.7. Automatic Installation Options
The creation of the group vboxusers can be prevented as follows:
If the following line is specified, the package installer will not try to build the vboxdrv kernel module if no module fitting the current kernel was found.
2.3.4. The vboxusers Group
The Linux installers create the system user group vboxusers during installation. Any system user who is going to use USB devices from Oracle VM VirtualBox guests must be a member of that group. A user can be made a member of the group vboxusers either by using the desktop user and group tools, or with the following command:
2.3.5. Starting Oracle VM VirtualBox on Linux
2.4. Installing on Oracle Solaris Hosts
For the specific versions of Oracle Solaris that are supported as host operating systems, see Section 1.4, “Supported Host Operating Systems”.
If you have a previously installed instance of Oracle VM VirtualBox on your Oracle Solaris host, please uninstall it first before installing a new instance. See Section 2.4.4, “Uninstallation” for uninstall instructions.
2.4.1. Performing the Installation
To start installation, run the following commands:
The Oracle VM VirtualBox kernel package is integrated into the main package. Install the Oracle VM VirtualBox package as follows:
The installer will then prompt you to enter the package you wish to install. Choose 1 or all and proceed. Next the installer will ask you if you want to allow the postinstall script to be executed. Choose y and proceed, as it is essential to execute this script which installs the Oracle VM VirtualBox kernel module. Following this confirmation the installer will install Oracle VM VirtualBox and execute the postinstall setup script.
If you need to use Oracle VM VirtualBox from non-global zones, see Section 2.4.6, “Configuring a Zone for Running Oracle VM VirtualBox”.
2.4.2. The vboxuser Group
The installer creates the system user group vboxuser during installation for Oracle Solaris hosts that support the USB features required by Oracle VM VirtualBox. Any system user who is going to use USB devices from Oracle VM VirtualBox guests must be a member of this group. A user can be made a member of this group either by using the desktop user and group tools or by running the following command as root:
Note that adding an active user to the vboxuser group will require the user to log out and then log in again. This should be done manually after successful installation of the package.
2.4.3. Starting Oracle VM VirtualBox on Oracle Solaris
You can configure some elements of the VirtualBox Qt GUI, such as fonts and colours, by running VBoxQtconfig from the terminal.
2.4.4. Uninstallation
Uninstallation of Oracle VM VirtualBox on Oracle Solaris requires root permissions. To perform the uninstallation, start a root terminal session and run the following command:
After confirmation, this will remove Oracle VM VirtualBox from your system.
2.4.5. Unattended Installation
Extract the tar.gz package as described in Section 2.4.1, “Performing the Installation”. Then open a root terminal session and run the following command:
To perform a non-interactive uninstallation, open a root terminal session and run the following command:
2.4.6. Configuring a Zone for Running Oracle VM VirtualBox
Assuming that Oracle VM VirtualBox has already been installed into your zone, you need to give the zone access to Oracle VM VirtualBox’s device node. This is done by performing the following steps. Start a root terminal and run the following command:
Replace vboxzone with the name of the zone where you intend to run Oracle VM VirtualBox.
Use zonecfg to add the device resource and match properties to the zone, as follows:
If you are not using sparse root zones, you will need to loopback mount /opt/VirtualBox from the global zone into the non-global zone at the same path. This is specified below using the dir attribute and the special attribute. For example:
Reboot the zone using zoneadm and you should be able to run Oracle VM VirtualBox from within the configured zone.