Install VirtualBox on Windows
| Before you start | |
| Download | |
| Install | |
| Missing Dependencies: Python Core / win32api | |
| Install with winget | |
| Check the installation | |
| Remove VirtualBox |
VirtualBox (Oracle VirtualBox) runs virtual machines on Windows, Linux, macOS and Solaris hosts. Inside them run Windows, Linux, FreeBSD, Solaris, DOS and other systems.
This page installs it on Windows 10 or 11, first with the installer and its screens, then in one command with winget. The screenshots show VirtualBox 7.0.6; newer versions ask the same questions. The install on Debian and Ubuntu, the Extension Pack and the Guest Additions are in Install VirtualBox.
Before you start
VirtualBox needs hardware virtualization: Intel VT-x or AMD-V. Open the Task Manager, tab Performance, then CPU: the line Virtualization must say Enabled. If it says Disabled, turn it on in the BIOS or UEFI setup of the computer; the option is called Intel Virtualization Technology, VT-x, SVM Mode or AMD-V depending on the vendor.
When Hyper-V, WSL 2 or the Windows memory integrity protection is on, VirtualBox runs its machines through the Windows hypervisor. That works, but slower; the status bar of such a machine shows a green turtle.
The installer needs the Microsoft Visual C++ 2015 or later Redistributable (x64). Most computers already have it; winget installs it by itself, as its output below shows.
Download
The installer is on virtualbox.org/wiki/Downloads. Choose Windows hosts:
The file name has the version and the build number:
VirtualBox-X.X.X-XXXXXX-Win.exe
In this example it was VirtualBox-7.0.6-155176-Win.exe.
Install
Run the downloaded file and click Next on the welcome screen:
Custom Setup lists the parts: the application with USB support, bridged and host-only networking, and Python support. Keep all of them unless you have a reason; the default folder is C:\Program Files\Oracle\VirtualBox\.
The networking part adds virtual network adapters. While it does so, Windows drops the network connection for a moment; save downloads and calls first, then click Yes:
Without Python on the computer the next screen is Missing Dependencies Python Core / win32api. Click Yes: VirtualBox installs and works without them. What the screen is about is explained in the next chapter.
Then click Install and confirm the Windows question whether the installer may make changes. Windows may also ask whether to install the device software of Oracle: allow it, it is the USB and network drivers. At the end leave the box ticked to start VirtualBox and click Finish:
Missing Dependencies: Python Core / win32api
VirtualBox has an API, and the Python Support part lets Python scripts use it. For that it needs Python and the pywin32 package. VirtualBox itself does not: the screen says that the bindings can be set up later.
If you clicked No, the installer asks whether to cancel
and after Yes it stops without changing anything:
To install with the Python bindings, prepare Python first and run the installer again. Install Python as shown in Install Python on Windows, then open PowerShell as administrator and update pip:
python.exe -m pip install --upgrade pip
Requirement already satisfied: pip in c:\users\andrei\appdata\local\programs\python\python311\lib\site-packages (22.3.1) Collecting pip Using cached pip-23.0.1-py3-none-any.whl (2.1 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 22.3.1 Uninstalling pip-22.3.1: Successfully uninstalled pip-22.3.1 Successfully installed pip-23.0.1
Install pywin32, which provides win32api:
python -m pip install pywin32
Collecting pywin32 Downloading pywin32-305-cp311-cp311-win_amd64.whl (12.1 MB) ---------------------------------------- 12.1/12.1 MB 21.1 MB/s eta 0:00:00 Installing collected packages: pywin32 Successfully installed pywin32-305
Now the installer finds both and skips the screen.
Install with winget
Windows 10 and 11 have the package manager winget. It downloads the current version, checks the hash of the installer and installs it without questions:
winget install --id Oracle.VirtualBox --exact --silent --accept-source-agreements --accept-package-agreements
The same as a PowerShell script that checks for administrator rights, updates the winget sources, installs and shows the result:
# Ensure script runs with admin privileges if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Write-Host "Please run PowerShell as Administrator." -ForegroundColor Red exit } # Update winget sources Write-Host "Updating winget sources..." winget source update # Install VirtualBox Write-Host "Installing Oracle VirtualBox..." winget install --id Oracle.VirtualBox --exact --silent --accept-source-agreements --accept-package-agreements # Confirm installation Write-Host "Checking installation..." winget list --id Oracle.VirtualBox
Updating winget sources... Updating all sources... Updating source: msstore... Done Updating source: winget... ██████████████████████████████ 100% Done Updating source: winget-font... ██████████████████████████████ 100% Done Installing Oracle VirtualBox... Found Oracle VirtualBox [Oracle.VirtualBox] Version 7.2.4 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. This package requires the following dependencies: - Packages Microsoft.VCRedist.2015+.x64 Downloading https://download.virtualbox.org/virtualbox/7.2.4/VirtualBox-7.2.4-170995-Win.exe ██████████████████████████████ 168 MB / 168 MB Successfully verified installer hash Starting package install... Successfully installed Checking installation... Name Id Version Source --------------------------------------------------------- Oracle VirtualBox 7.2.4 Oracle.VirtualBox 7.2.4 winget
winget answers the questions of the installer with the defaults: all parts, the default folder, and the network reset happens without asking. Later updates take one command:
winget upgrade --id Oracle.VirtualBox --exact
Check the installation
Start Oracle VirtualBox from the Start menu: the VirtualBox Manager opens with an empty list of machines. The command line tool VBoxManage prints the version and the build:
& "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version
For the installer VirtualBox-7.2.4-170995-Win.exe that is 7.2.4r170995. The & in front is needed in PowerShell because the path is in quotes; in the Command Prompt leave it out.
Remove VirtualBox
Remove it in Settings, Apps, Oracle VirtualBox, Uninstall, or with winget:
winget uninstall --id Oracle.VirtualBox --exact
The virtual machines stay: by default they are in the folder VirtualBox VMs of your user, for example
C:\Users\andrei\VirtualBox VMs
A new install of VirtualBox can add them again with Machine, Add.
Article authors: Andrei Olegovich, Klavdiya Kondakova
| Install VirtualBox | |
| VirtualBox | |
| VirtualBox errors | |
| Windows |