1. Information
2. Linux
2.1. Installation
-
Enter the following commands at a Command Line.
wget -O- --quiet https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \ https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list sudo apt-get update sudo apt-get install vagrant vagrant --version # Vagrant 2.4.9
2.2. Configuration for WSL
-
Note: Vagrant must be installed within the Linux distribution used with WSL. While the vagrant.exe executable provided by the Vagrant Windows installation is accessible from within the WSL, it will not function as expected.
-
Enter the following commands at a Command Line.
export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1" export PATH="$PATH:/mnt/c/Program Files/Oracle/VirtualBox" echo $VAGRANT_HOME
3. Windows
3.1. Installation
-
Install VirtualBox.
-
Run the vagrant_2.4.9_windows_amd64.msi file.
-
Click Next.
-
Check I accept the terms in the License Agreement.
-
Click Next.
C:\HashiCorp\Vagrant
-
Click Next.
-
Click Install.
-
Click Finish.
-
Click No to skip restarting the computer.
-
Restart the computer.
4. Usage
-
Enter the following commands at a Command Prompt.
cd D:\Vagrant vagrant box listvagrant init endian/community; vagrant up --provider virtualbox
-
Common Commands.
vagrant box list vagrant box add <box_name> # Downloads a base image. vagrant init # Creates a Vagrantfile in your directory. vagrant up # Launches the VirtualBox VM. vagrant ssh # Connects to the machine.
which powershell
sudo ln -s /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe /usr/local/bin/powershell
which powershell
# See https://portal.cloud.hashicorp.com/vagrant/discover/debian
cd "/mnt/c/VirtualBox/VirtualBox VMs"
vagrant box list
vagrant box add debian/bookworm64
# Type 2 for the VirtualBox provider and press Enter.
# See https://portal.cloud.hashicorp.com/vagrant/discover/hashicorp
vagrant box add hashicorp/precise64
# Type 2 for the virtualbox provider and press Enter.
vagrant box list
ls -al /mnt/c/Users/Douwe/.vagrant.d
ls -al /mnt/c/Users/Douwe/.vagrant.d/boxes/debian-VAGRANTSLASH-bookworm64/12.20250126.1/amd64/virtualbox
vagrant init debian/bookworm64 --box-version 12.20250126.1
vagrant up
vagrant ssh -- -v
vagrant ssh-config
ls -al /mnt/c/Users/Douwe/.vagrant.d/insecure_private_keys/vagrant.key.rsa
ssh -i /mnt/c/Users/Douwe/.vagrant.d/insecure_private_keys/vagrant.key.rsa -p 2222 debian@127.0.0.1
+
Permissions 0777 for '/mnt/c/Users/Douwe/.vagrant.d/insecure_private_keys/vagrant.key.rsa' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored.
How to use this box with Vagrant Step 1
Option 1: Create a Vagrantfile and initiate the box
vagrant init debian/trixie64 --box-version 13.20260121.1
Option 2: Open the Vagrantfile and replace the contents with the following
Vagrant.configure("2") do |config| config.vm.box = "debian/trixie64" config.vm.box_version = "13.20260121.1" end
Step 2
Bring up your virtual machine
vagrant up