MSE Department – Faculty of Engineering - MSA
Spring 2022
Course ID: MSE462 Course Name: Robotics
Lab6
ROS On Virtual Machine
Step 1: Download and Install VirtualBox
1. Go to the website of Oracle VirtualBox and get the latest stable version
from here: https://www.virtualbox.org/
2. Click on Downloads
3. Click on Windows hosts to download the virtualbox.
4. Follow the instructions on the screen to finish setup.
-1-
Step 2: Download the Linux ISO
1. Next, you need to download the ISO file of the Linux distribution
(Ubuntu). You can get this image from the official website of the Linux
distribution.
2. Download ISO images for Ubuntu from the link below:
https://releases.ubuntu.com/focal/ubuntu-20.04.5-desktop-amd64.iso
Step 3: Install Linux using VirtualBox
1. You have installed VirtualBox and you have downloaded the ISO for
Linux. You are now set to install Linux in VirtualBox.
2. Start VirtualBox and click on (New). Give the virtual OS a name.
3. Allocate RAM to the virtual OS. The system which has 8GB of RAM, it
is preferable to allocate 2GB of it. You can use more RAM if your system
has enough extra.
4. Create a virtual disk. This serves as the hard disk of the virtual Linux
system. It is where the virtual system will store its files.
5. Once everything is in place, it’s time to click finish.
6. Power up ubuntu by double clicking on it.
7. It will need to install ubuntu as an operating system on the virtual
machine.
8. This will be done by selecting the ubuntu ISO from the location on your
PC.
9. Press on Mount and Retry Boot.
10.Soon you’ll find yourself inside Linux. You should be presented with the
option to install it.
11. Skip to continue.
12.Select ‘Erase disk and install Ubuntu’. Don’t worry. It won’t delete
anything on your Windows operating system. You are using the virtual
disk space of 15-20GB that we created in previous steps. It won’t impact
the real operating system.
13.Click on continue.
14.Choose your Country.
15.Then Choose the language and the password.
16.It will take few minutes to complete installation.
17.Restart the virtual system.
18.If you face this error while using the virtual machine, this means that
virtualization is blocked on your system. You’ll have to activate it in your
BIOS settings first.
19.Reboot your system and as soon as it powers up, press F2/F10/F12 to
access BIOS settings. You must look for the virtualization option in the
BIOS and enable it.
Step 4: Install ROS on Linux
1. Firstly, you must know the version of installed Linux (Ubuntu) in order to
know which version of ROS related to it.
2. Open Terminal using ctrl+alt+t.
3. Write lsb_release -a in terminal to Know the Linux Version
4. The related version to Ubuntu 20.04.5 is ROS noetic.
5. Setup your computer to accept software from packages.ros.org.
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc)
main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.as
c | sudo apt-key add -
6. First, make sure your Debian package index is up-to-date:
sudo apt update
7. Install ROS→Desktop-Full Install: (Recommended): Everything
in Desktop plus 2D/3D simulators and 2D/3D perception packages.
sudo apt install ros-noetic-desktop-full
8. Setup Environment →You must source this script in every bash terminal
you use ROS in.
source /opt/ros/noetic/setup.bash
9. Dependencies for building packages→ To install this tool and other
dependencies for building ROS packages, run:
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-gen
erator python3-wstool build-essential
10.Before you can use many ROS tools, you will need to
initialize rosdep→enables you to easily install system dependencies for
source you want to compile and is required to run some core components
in ROS. If you have not yet installed rosdep, do so as follows.
sudo apt install python3-rosdep
11.With the following, you can initialize rosdep.
sudo rosdep init
rosdep update