Step 8: Set Up Development Environment in Ubuntu WSL
Last updated
Last updated
After installing the necessary tools and extensions, it's time to switch your development environment to Ubuntu on WSL and set up Rust, Cargo, and Solana. This step ensures you have all the necessary components for Solana blockchain development within a Linux environment.
Switch Visual Studio Code to Use Ubuntu WSL
Open Visual Studio Code:
Launch Visual Studio Code on your Windows system.
Open a New Terminal:
Open a new terminal in VS Code by going to Terminal
> New Terminal
or using the shortcut Ctrl+`
.
Select WSL: Ubuntu from the Terminal Dropdown:
In the new terminal window, you'll see a dropdown menu at the top right corner. Click on it and select "Select Default Profile".
Choose "WSL: Ubuntu" (or the specific version of Ubuntu you installed) from the list. This changes the terminal to use the Ubuntu environment within WSL for the current and future terminal sessions.
Navigate to Your Project Directory:
Use the cd
command to change to your project directory. For example:
Install Rust on WSL
Install Rust:
Execute the following command in the Ubuntu terminal to install Rust:
Follow the on-screen instructions to complete the Rust installation process.
Install Cargo on WSL
Verify Cargo Installation:
Installing Rust with rustup also installs Cargo. You can verify Cargo is installed by running:
This command should display the version of Cargo installed, confirming its availability.
Install Solana on WSL
Install Solana Toolkit:
To install the Solana toolkit, including the CLI tools, run:
This command downloads and installs the latest stable version of the Solana toolkit.
Verify Solana Installation:
Ensure the installation was successful by checking the Solana version with:
The command output should display the version of Solana installed, indicating that it is ready for use in your development projects.