Install Ubuntu using wsl2 on Windows
VOLTTRON requires a Linux system to run. For Windows users this will require a virtual machine (VM), a docker container, or a WSL2 environment. This document covers the details about setting up a Ubuntu environment using wsl2 on Windows 10 or Windows 11
Install/Enable WSL2
If you are running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11, wsl2 should already be enabled on your system and you can directly proceed to installing a linux environment using wsl2. If you are on a older Windows machine you will have first enable wsl. Please refer to this microsoft documentation to manually enable wsl and check if you have the required minimum build for enabling wsl2
Terminal Application
We highly recommend a good terminal emulator such as the latest version of Microsoft Terminal or Cmder or similar that provides features such as multiple tabs, search, etc. This would come handy for development of VOLTTRON code base.
Install Ubuntu 22.04 with WSL
The current version of Eclipse VOLTTRON has been tested on Ubuntu 22.04 so this document refers that specific distribution. You are free to use other Linux distributions but please note that there would minor changes in package names and available versions of dependency.
To install Ubuntu 22.04 with wsl2, open PowerShell or Windows Command Prompt or similar in administrator mode and run the following command
Note: You can find out the available linux environments that can be installed, use the command
wsl --list --online
Setup Ubuntu environment
Open installed Ubuntu environment by going to the start menu and typing Ubuntu and selecting Ubuntu-22.04. Or you could run the command
wsl -d Ubuntu-22.04from command prompt of your terminal emulatorWhen you open the distribution for the first time, you would be prompted to create a linux user name and password. This account will be your default user for the distribution and automatically sign-in on launch. THis account will also be considered admin account and will have sudo access
Update and upgrade packages using the command
sudo apt update && sudo apt upgrade
Install VOLTTRON pre-requisites
Once you login into your virtual machine, install VOLTTRON pre-requisite softwares in your linux environment. VOLTTRON requires the following software
python 3.10 (official version tested)
git
python3-venv
poetry >= 2.0.1
Ubuntu-22.04 comes with python 3.10 and git.
If not installed, use the command
sudo apt install python3.10to install python3.10If not installed, use the command
sudo apt install gitto install gitInstall python venv for python 3.10 using the command
sudo apt-get install python3.10-venvVOLTTRON uses poetry for dependency management. For development environments, it is required that you install poetry, and use poetry commands to create virtual environment and install volttron source packages
Run the command `` curl -sSL https://install.python-poetry.org | python3 -`` to install poetry on Ubuntu
Add poetry install directory to your PATH. Open .bashrc file in your home directory and add the following command with the correct path to your home directory
export PATH="<path to your home dir>/.local/bin:$PATH"Source .bashrc (only for the first time) -
source ~/.bashrcUpdate poetry configuration to set the default location of poetry virtual environments -
poetry config virtualenvs.in-project true