2023-01-19 16:27:47 -08:00

100 lines
3.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
layout: docs
page_title: Install Vagrant
description: |-
Vagrant is available for most platforms. Install the Vagrant
package using standard procedures for your operating system.
---
# Install Vagrant
To get started with Vagrant, download the appropriate installer or
package for your platform from our
[Vagrant downloads page](/vagrant/downloads). Install the package with the standard procedures for
your operating system.
The installer automatically adds `vagrant` to your system path
so that it is available in terminals. If it is not found,
log out and back into your system; this is a common issue for Windows.
~> **Rubygem installation is unsupported** Vagrant 1.0.x has the option to
be installed as a [RubyGem](https://en.wikipedia.org/wiki/RubyGems).
However, this installation method is no longer supported. If you have an old version
of Vagrant installed via Rubygems, remove it prior to installing newer
versions of Vagrant.
## First development environment
If you are new to Vagrant, the next step to set up a development environment is to install
a [box](/vagrant/tutorials/getting-started/getting-started-boxes).
## How to use multiple hypervisors
Hypervisors often do not allow you to bring up virtual machines if you have more than one hypervisor in use.
Below are a couple of examples to allow you
to use Vagrant and VirtualBox if another hypervisor is present.
### Linux, VirtualBox, and KVM
If you encounter the following error message, it is because another hypervisor, like KVM, is in use.
```shell-session
There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", <ID of the VM>, "--type", "headless"]
Stderr: VBoxManage: error: VT-x is being used by another hypervisor (VERR_VMX_IN_VMX_ROOT_MODE).
VBoxManage: error: VirtualBox can't operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot
(VERR_VMX_IN_VMX_ROOT_MODE)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
```
You must add the additional hypervisors to the deny list in order for VirtualBox to run correctly.
First, find out the name of the hypervisor.
```shell-session
$ lsmod | grep kvm
kvm_intel 204800 6
kvm 593920 1 kvm_intel
irqbypass 16384 1 kvm
```
Use the `blacklist` command to add the hypervisor to your denylist.
```shell-session
$ echo 'blacklist kvm-intel' >> /etc/modprobe.d/blacklist.conf
```
Restart your machine and try the `vagrant` command again.
### Windows, VirtualBox, and Hyper-V
If you encounter an issue with Windows, you will get a blue screen if you attempt to bring up
a VirtualBox VM with Hyper-V enabled.
If you wish to use VirtualBox on Windows, you must ensure that Hyper-V is not enabled
on Windows. You can turn off the feature with the following Powershell command for Windows 10.
```powershell
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
```
For Windows 11, you can use an elevated Powershell.
```powershell
bcdedit /set hypervisorlaunchtype off
```
You can also disable Hyper-V in the Windows system settings.
- Right click on the Windows button and select Apps and Features.
- Select Turn Windows Features on or off.
- Unselect Hyper-V and click OK.
You might have to reboot your machine for the changes to take effect. More information
about Hyper-V can be read [here](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v).