This guide provides step-by-step instructions to install ROS (Robot Operating System) on a virtual machine using VirtualBox and Ubuntu 20.04.
- Prerequisites
- Step 1: Download and Install VirtualBox
- Step 2: Download Ubuntu 20.04 Desktop Image
- Step 3: Create a New Virtual Machine in VirtualBox
- Step 4: Install Ubuntu 20.04
- Step 5: Install ROS on Ubuntu 20.04
- Step 6: Problems installing ROS and their solutions
- A computer with internet access.
- Basic knowledge of using the command line.
- Open your web browser and go to the [VirtualBox website] (https://www.virtualbox.org/).
2. Click on "Download VirtualBox". 3. Select the version appropriate for your operating system (Windows, macOS, Linux). 4. After downloading, open the installation file and follow the on-screen instructions to install VirtualBox.
- Open your web browser and go to the Ubuntu website.
- Select "Ubuntu 20.04 LTS" and click on "Download".
- Save the ISO file to your computer.
-
Open VirtualBox and click on "New" to create a new virtual machine.
-
Name the machine (e.g., "Ubuntu 20.04") and choose the type of operating system as "Linux" and the version as "Ubuntu (64-bit)".
-
Set the memory size (RAM) (at least 2 GB is recommended)(to green).
-
Set the size of the virtual hard disk (at least 25 GB is recommended) and click "Create".
-
After creating the virtual machine, select it from the list in VirtualBox and click "Start".
-
When prompted, choose the Ubuntu 20.04 ISO file you downloaded and click "Start".
-
Follow the on-screen instructions to install Ubuntu 20.04 on the virtual machine.
-
Choose the third option install Ubuntu
5.Important thing, turn off the “Download updates while installing Ubuntu” option so that it does not update Ubuntu 20.04
-
After installing and booting Ubuntu, open a terminal window.
-
Add the ROS repository to your system:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- Add the ROS key:
sudo apt install curl curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
- Update the package list:
sudo apt update
-
Install the full version of ROS (Noetic):
sudo apt install ros-noetic-desktop-full
- "If you get a problem like the one I have, go to step 6, solve the problem, and go back and complete the installation. If you don’t get a problem, complete the installation."
- Step 6: Problems installing ROS and their solutions -no error
- Set up the ROS environment:
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc
Congratulations! ROS is now successfully installed on Ubuntu 20.04 within VirtualBox. You can start using ROS to develop robotics applications.
-
Go to (Terminal) and place these commands in this order
sudo apt clean
sudo apt autoclean
sudo apt autoremove
sudo apt update
sudo dpkg --configure -a
sudo apt install -f
sudo apt upgrade