Table of Contents
Navigate to VirtualBox installation location
In some cases, you have installed your VirtualBox virtualization software on a Windows host and are about to start managing it from PowerShell or the command line.
But when you run the VBoxManage command from the command line such as PowerShell or Windows Command Prompt. You got the below error.
PS C:\Users\admin> VBoxManage
VBoxManage : The term ‘VBoxManage’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ VBoxManage
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (VBoxManage:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
If you get the error message VBoxManage is not recognized, the VirtualBox installation is not added to your Windows PATH. The quick way to run the command successfully is to go to the VirtualBox install location, typically as shown below:
cd 'C:\Program Files\Oracle\VirtualBox\'
PS C:\Users\admin> cd 'C:\Program Files\Oracle\VirtualBox\'
PS C:\Program Files\Oracle\VirtualBox> .\VBoxManage.exe
Oracle VM VirtualBox Command Line Management Interface Version 6.1.38
(C) 2005-2022 Oracle Corporation
All rights reserved.
Usage:
VBoxManage [<general option>] <command>
...
Add VirtualBox installation location to Env:
Alternatively, you can use the below commands to check then add the VirtualBox installation location into the Windows Environments Variables.
Add VirtualBox installation location to User Environment Path:
if ((Get-Command VBoxManage.exe -ErrorAction SilentlyContinue) -eq $null) {
$env:path="C:\Program Files\Oracle\VirtualBox;$env:path"
}
Add VirtualBox installation location to System Environment Path:
if ((Get-Command VBoxManage.exe -ErrorAction SilentlyContinue) -eq $null) {
[Environment]::SetEnvironmentVariable("PATH", $Env:PATH + ";C:\Program Files\Oracle\VirtualBox", [EnvironmentVariableTarget]::Machine)
}
Not a reader? Watch this related video tutorial: