Build Linux VMs

First published: Wednesday, May 28, 2025 | Last updated: Wednesday, May 28, 2025

Build Linux VMs using the SloopStash Linux starter-kit.


Configure environment variables

Supported environment variables

# Allowed values for $OS_NAME variable.
* centos-linux-7
* ubuntu-linux-18-04
* ubuntu-linux-22-04
* amazon-linux-2
* alma-linux-8
* alma-linux-9
* rocky-linux-8
* rocky-linux-9

# Allowed values for $OS_ARCHITECTURE variable.
* amd64
* arm64

# Allowed values for $OS_EDITION variable.
* server
* desktop

# Allowed values for $HYPERVISOR variable.
* virtualbox
* vmware

Set environment variables

# Store environment variables.
$ export OS_NAME=ubuntu-linux-22-04
$ export OS_ARCHITECTURE=amd64
$ export OS_EDITION=server
$ export HYPERVISOR=virtualbox
$ export VAGRANT_CONF_DIR=./vagrant/$OS_NAME/$HYPERVISOR/$OS_ARCHITECTURE/$OS_EDITION

Build and manage Linux VMs using Vagrant

Windows

You can use the below commands to build, automate, and manage Linux VMs on the Windows operating system using Vagrant.

  1. Open the Git Bash terminal in administrator mode.
  2. Execute the below commands in the Git Bash terminal to build, automate, and manage Linux VMs.
# Switch to SloopStash Linux starter-kit directory.
$ cd /opt/kickstart-linux

# Boot Linux VM using Vagrant.
$ VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant up

# SSH to Linux VM using Vagrant.
$ VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant ssh

# Exit from Linux VM.
$ exit

# Halt Linux VM using Vagrant.
$ VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant halt

# Destroy Linux VM using Vagrant.
$ VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant destroy

Mac and Linux

You can use the following commands to build, automate, and manage Linux VMs on a Mac or Linux operating system using Vagrant.

  1. Open the terminal.
  2. Execute the below commands in the terminal to build, automate, and manage Linux VMs.
# Switch to SloopStash Linux starter-kit directory.
$ cd /opt/kickstart-linux

# Boot Linux VM using Vagrant.
$ sudo VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant up

# SSH to Linux VM using Vagrant.
$ sudo VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant ssh

# Exit from Linux VM.
$ exit

# Halt Linux VM using Vagrant.
$ sudo VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant halt

# Destroy Linux VM using Vagrant.
$ sudo VAGRANT_CWD=$VAGRANT_CONF_DIR vagrant destroy