ROS 2: Zero to MoveIt 2 › Module 0 › Windows
Set up ROS 2 on Windows
16 steps About 1.5 to 2.5 hours, mostly waiting Not tested on a real Windows PC yet
Your route: Ubuntu 24.04 inside Windows (WSL2), then ROS 2 Jazzy in it. Do one step at a time. Each step says what to do, how long it takes, what you should see, and what to do when you are stuck. You can stop after any step. Inside Ubuntu only one of your files changes (a settings file called ~/.bashrc); the course adds its own folders.
Parts A and B were written from Microsoft's own documents and have not been run on a real Windows PC yet. Part C was run on the course's Ubuntu PC. If a step does not match what you see, stop there, go on in the Browser Lab, and tell us (Contact, at the bottom of this page).
Company or school laptop? You need administrator rights (step B1) and permission to change the start-up settings (step A2). Without them, stop here and use the Browser Lab, or ask your IT team first.
Advanced: Ubuntu beside Windows (dual boot) instead of WSL
You can also install Ubuntu 24.04 on the PC itself and choose Windows or Ubuntu each time the PC starts. Graphics are fastest that way. But a wrong click while dividing the disk can delete your Windows files: back everything up first, and ask someone who has done it. Ubuntu's own guide: Install Ubuntu Desktop. Afterwards use the Ubuntu guide.
0 of 16 steps done Helper: not connected
What your PC has now
No PC, or stuck? Use the Browser Lab: nothing to install, and every lesson works there.
Part A: Before you install
Three small things first: check the PC, make sure it can run Ubuntu, and update its graphics driver.
-
A1 Check my PC (before anything is installed)
First find out whether this PC can run ROS 2 and Gazebo. The check only reads: it installs nothing, changes nothing and needs no password.
Open PowerShell: click the Start button, type
powershell, and press Enter. A dark blue or black window opens. (For this check you do not need "Run as administrator".)Press Copy on the line below. Click inside PowerShell, paste with Ctrl+V (or right-click), then press Enter.
irm https://www.ros2lab.com/install/check.ps1 | iex
Then come back here and press the button.
Your browser may ask "Allow this site to find devices on your local network?". Choose Allow: the page only reads the result from your own computer.
It does not appear? Paste the result instead
Answer by hand, or correct what the check found
What you should see
PowerShell ===== ROS2LAB PC CHECK 1 ===== system: windows os: Microsoft Windows 11 Home ... cores: 8 ram_gb: 7.8 disk_free_gb: 31.5 ... ===== END ===== Now go back to the ROS2Lab page and press "Read the result from my PC".
About 20 lines between two
=====lines. This is an example written for this guide (shortened), not a recording of your PC. After you press the button, a table appears on this page with a green, yellow or red mark for each line.Exactly what it reads, and where the result goes
- The Windows version and build number.
- The processor and its number of cores.
- The size of the memory.
- The free space of the Windows drive.
- The name of the graphics card and its driver version.
- Whether virtualization is on.
- Whether WSL and Ubuntu are already installed.
- How fast one file downloads from packages.ros.org (up to 8 seconds; the file is thrown away).
The result is printed in your PowerShell. It then waits on your own computer (address 127.0.0.1) for up to 10 minutes: that window stays busy meanwhile (Ctrl+C stops it early). This page reads it only when you press the button, and keeps it in this browser. It is not sent to ROS2Lab or anywhere else.
You can read the whole script first: https://www.ros2lab.com/install/check.ps1
What these words mean
- PowerShell
- The terminal that comes with Windows.
- Command
- One line of text that tells the computer to do one thing.
- Script
- A text file with commands. You can open its address in your browser and read every line before you run it.
- 127.0.0.1
- The address that always means "this computer itself". What goes there never leaves your PC.
- Build
- The exact version number of Windows, for example 22631.
- Cores
- The workers inside the processor. More cores do more things at the same time.
- Virtualization
- A feature of the processor that lets one computer run a second operating system inside the first. On many PCs it is switched off when new.
- BIOS / UEFI
- The PC's own start-up settings, shown before Windows starts.
- Graphics card (GPU)
- The part of the PC that draws 3D pictures. Gazebo is fast with it and slow without it.
- Driver
- The program that lets the computer use one of its parts, here the graphics card.
- WSL
- Windows Subsystem for Linux: a part of Windows, made by Microsoft, that runs Ubuntu inside Windows. Windows stays as it is; your files are not touched.
- Mbit/s
- How fast your internet is. A bigger number is faster.
Stuck? The 3 most common problems
- Red text:
irm : The remote name could not be resolved,(407) Proxy Authentication RequiredorCould not create SSL/TLS secure channel. No internet, a company proxy, or an old Windows 10. Check that other websites open and paste the line again. Still red? Use "Answer by hand" further up in this step. A company proxy will also block the install later: ask your IT team, or use the Browser Lab. - The button says it cannot read the result. Your browser may have asked "Allow this site to find devices on your local network?". If you pressed Block, allow it in the site settings (the icon left of the address). Or use "Paste the result" further up in this step. To copy in PowerShell: drag the mouse over the lines, then press Enter.
- My antivirus blocks the line, or I am afraid to paste a command I do not understand. Do not switch your antivirus off: use "Answer by hand" further up in this step instead. This line only reads; it changes nothing and needs no administrator ("Exactly what it reads" below lists every line). On a company laptop, ask IT before you run any script from the internet.
None of these? Show this step to your teacher, or to a friend who knows computers. You do not have to wait: every lesson also works in the Browser Lab.
-
A2 Switch on virtualization
Windows can only run Ubuntu when the processor's virtualization feature is on. If your PC check said "Virtualization: on", press I did this and go on.
Look it up: press Ctrl+Shift+Esc. The Task Manager opens (a small window with no tabs? Click More details). Click Performance, then CPU. Find the line Virtualization.
What you should see
Task Manager › Performance › CPU Cores:4Logical processors:8Virtualization:EnabledA drawing, not a photo of your screen.
Enabled: nothing to do. Disabled: switch it on, as below.
If it says Disabled:
BitLocker first. Many laptops lock their disk with BitLocker (or "Device encryption"). After a change in the start-up settings, Windows may ask for the BitLocker recovery key at the next start. To see whether it is on: Settings › Privacy & security › Device encryption, or type
BitLockerin Start. Find your key before you change anything: on your phone open aka.ms/myrecoverykey and sign in with this PC's Microsoft account, or ask your IT team. No key? Do not change these settings: use the Browser Lab.Before you restart: open this page on your phone, or take a photo of the five points below. Your PC's screen goes dark and you cannot read this page there. Your ticks are saved.
- Windows 11: open Settings › System › Recovery. Windows 10: Settings › Update & Security › Recovery. Beside Advanced startup press Restart now.
- On the blue screen choose Troubleshoot › Advanced options › UEFI Firmware Settings › Restart.
- The PC's own settings open. Find the line named Intel Virtualization Technology, VT-x, SVM Mode or AMD-V (often under "Advanced" or "CPU Configuration"). Set it to Enabled.
- Save and leave (often the F10 key). Windows starts again.
- Look in the Task Manager again: it must say Enabled. Then run the check of step A1 again: the red line turns green.
The names differ from maker to maker. Search the web for your PC's model with the words "enable virtualization" to see pictures of your own screen.
Source: Microsoft: Troubleshooting WSL (virtualization, error 0x80370102).
What these words mean
- Virtualization
- A feature of the processor that lets one computer run a second operating system inside the first. On many PCs it is switched off when new.
- BIOS / UEFI
- The PC's own start-up settings, shown before Windows starts.
Stuck? The 3 most common problems
- There is no "UEFI Firmware Settings" choice. Restart the PC and press the maker's key again and again while it starts: often F2, F10, Del or Esc.
- I cannot find the line in the settings. Look under "Advanced", "Security" or "CPU Configuration". If it is not there, your PC's maker's support page for your model says where.
- I am afraid to change these settings. Change only this one line. It does not change your files. On a BitLocker PC have the recovery key ready (see above). If you are unsure, use the Browser Lab: it needs none of this.
None of these? Show this step to your teacher, or to a friend who knows computers. You do not have to wait: every lesson also works in the Browser Lab.
-
A3 Update the graphics driver (you may skip it)
Gazebo draws 3D through your graphics card. With a current driver, Ubuntu inside Windows can use the card too. Get the driver from the maker of your graphics card (your PC check shows its name).
- Intel: Intel graphics driver for Windows
- AMD: AMD drivers and support
- NVIDIA: NVIDIA driver downloads
Download the installer, open it, and follow its questions (it needs administrator rights). The screen may flicker or go black for a few seconds while it works: that is normal. Restart Windows if it asks.
Not sure? Press Skip this step. The set-up works without it; come back if Gazebo is slow or its window stays black.
What you should see
The installer ends with a message that the driver is installed. Nothing else changes on your screen.
Source: Microsoft: Run Linux GUI apps with WSL (install the vGPU driver).
What these words mean
- Driver
- The program that lets the computer use one of its parts, here the graphics card.
- Graphics card (GPU)
- The part of the PC that draws 3D pictures. Gazebo is fast with it and slow without it.
Stuck? The 3 most common problems
- I do not know which graphics card I have. Look at the line "Graphics card" in your PC check above. Or open the Task Manager › Performance › GPU: the name is at the top right.
- The installer says my PC is not supported. Laptops sometimes need the driver from the laptop's maker (Dell, HP, Lenovo, ASUS, Acer). Use their support page for your model.
- I skipped this step. The set-up still works. If Gazebo is slow or its window is black later, come back and do it.
None of these? Show this step to your teacher, or to a friend who knows computers. You do not have to wait: every lesson also works in the Browser Lab.
Part B: Get Ubuntu 24.04 inside Windows
ROS 2 Jazzy is made for Ubuntu 24.04. Microsoft's WSL runs Ubuntu inside Windows. Windows stays as it is and your files are not touched. You can remove Ubuntu later like any app.
-
B1 Install Ubuntu
One line installs WSL and Ubuntu 24.04. This one needs PowerShell as administrator.
Company or school laptop? If Windows asks for an administrator password you do not have, or says that your organisation blocks WSL, stop here: ask your IT team, or use the Browser Lab.
Already use WSL? Your other Linux stays as it is. This course uses its own Ubuntu, named
Ubuntu-24.04. Everywhere this guide says "open Ubuntu", pick that one (the Start menu may call it Ubuntu 24.04 LTS). Not sure which one a window is? Typelsb_release -d: it must say 24.04.wsl --shutdownin the steps below stops every Linux in WSL: save your work in the others first.Click Start, type
powershell. On the right, click Run as administrator. Windows asks "Do you want to allow this app to make changes to your device?": click Yes.Start menu Search:powershellResult:Windows PowerShellOn the right:Run as administratorA drawing, not a photo of your screen.
Paste this line and press Enter:
wsl --install -d Ubuntu-24.04
Laptop: plug in the charger, and do not close the lid while this runs. If the laptop went to sleep and the step stopped with an error, paste the line again.
Before you restart: bookmark this page (Ctrl+D) so that you find it again. Your ticks are saved.
When it says a restart is needed: save your other work and restart Windows. After you log in again, a window named Ubuntu opens by itself and finishes the install. On some PCs no restart is needed: Ubuntu then starts right there in PowerShell. Either way, do step B2 in the window that asks for a new username. If no window asks, go on with B2.
What you should see
Lines that say what is being downloaded and installed, with a progress count. At the end it asks you to restart, or it goes straight on to B2.
Source: Microsoft: How to install Linux on Windows with WSL; Microsoft: Troubleshooting WSL; Microsoft: WSL in companies.
What these words mean
- WSL
- Windows Subsystem for Linux: a part of Windows, made by Microsoft, that runs Ubuntu inside Windows. Windows stays as it is; your files are not touched.
- Ubuntu 24.04
- A free operating system (like Windows or macOS). ROS 2 Jazzy is made for it.
- Administrator
- A mode in which a program may change Windows itself. Windows asks you to agree first.
It says there is no distribution with that name? Type
wsl --list --online: it prints the names you can use; take the one for Ubuntu 24.04. Nothing happened after the restart? Paste the same line again.Stuck? The 3 most common problems
- A message with the code
0x80370102or0x80070003. Virtualization is off. Do step A2, then paste the line again. WslRegisterDistribution failed with error 0x8007019eThe Windows part for Linux is switched off. Click Start, typeTurn Windows features on or off, tick Windows Subsystem for Linux and Virtual Machine Platform, press OK, restart, and paste the line again.- It stays at
0.0%for many minutes. Press Ctrl+C and paste this line instead:wsl --install --web-download -d Ubuntu-24.04
None of these? Show this step to your teacher, or to a friend who knows computers. You do not have to wait: every lesson also works in the Browser Lab.
-
B2 Start Ubuntu for the first time
Ubuntu asks you to make a user for yourself. This user is only for Ubuntu; it has nothing to do with your Windows login.
If no Ubuntu window is open: click Start, type
ubuntu, and open Ubuntu-24.04. No Ubuntu in the Start menu? Paste the line of step B1 again.- It asks for a username. Type a short name in small letters without spaces, for example
asha, and press Enter. - It asks for a password, twice. Choose one you will remember and write it down. Nothing shows while you type, not even dots: that is normal.
What you should see
Ubuntu-24.04 asha@my-laptop:~$
A line with your username, the PC's name and a
$at the end. This line is called the prompt: Ubuntu waits for a command. This is your Ubuntu window. You open it the same way every day: Start, typeubuntu.Source: Microsoft: Set up your Linux username and password.
What these words mean
- Terminal
- A window where you type commands instead of clicking. You type one line and press Enter; the computer answers with text.
Stuck? The 3 most common problems
- The keyboard seems dead while I type the password. It is not. Ubuntu hides passwords completely. Type it and press Enter.
- It does not accept my username. Use only small letters and digits, start with a letter, and no spaces.
- I forgot the password later. In PowerShell type
wsl -d Ubuntu-24.04 -u root passwd asha(with your own username) and set a new one.
None of these? Show this step to your teacher, or to a friend who knows computers. You do not have to wait: every lesson also works in the Browser Lab.
Good place to stop for today. Your ticks are saved in this browser. Next time: open this page again and go on with the next step. If you had started the helper, start it again with its line.
- It asks for a username. Type a short name in small letters without spaces, for example
Part C: Install ROS 2
Now everything happens inside Ubuntu. From here on, use the Ubuntu window, except where a step says PowerShell. Choose one of two ways. Both end with the same final check at the bottom of this page. Steps 1 to 10 have the helper's own numbers:
ros2lab setup --step 5is Step 5 here. Windows may warn that a pasted line has several lines: click Paste anyway.Guided: one line at a time
Best for your first time. You paste one line per step, and this page ticks each step from your PC. About 45 to 90 minutes, mostly waiting.
Do it all for me
Choose one way. While this line runs, do not paste the step lines below in another window: two installs at once block each other. Near the end Gazebo windows open and close by themselves (the test): do not click them.
One line runs steps 1 to 9 by itself, the speed test included (VS Code: when it ends, do step 7 yourself: 7a, 7b and 7c), and repairs what it can (for example the language setting, or an old ROS source, which it moves to a backup folder). About 45 to 90 minutes. Leave the window open until it ends. A Windows PC with 8 GB: if it stops at the build, type
MAKEFLAGS=-j1 ros2lab setup --step 6, thenros2lab setup --step 8andros2lab setup --step 9.wget --https-only -nv -O- https://www.ros2lab.com/install/setup.sh | bash
Why your password: It installs software for the whole PC. It asks once (nothing shows while you type the password: that is normal); then it runs the same password lines that the guided steps show.
When it ends:
- In that same window, paste the helper line from the step Start the helper. Leave it open.
- Open a new window and type
ros2lab sim. Gazebo and RViz open: leave them open. - Press Check my PC now in the final check. A light stays grey? Type
ros2lab setup --step 9in a new window: it says what failed.
Nothing happens, or a red line about the download? See Stuck in the step Start the helper.
-
Helper Start the helper
The helper is a small program that reads what is installed and tells this page. From now on the ticks on this page come from your PC. The line below puts the small ros2lab tool into the folder
~/.ros2lab, adds one line to~/.bashrcso that the commandros2labis found, and starts it. It needs no password. Started this way, the helper only looks: it changes nothing on your PC.In the Ubuntu window, paste with a right-click (or Ctrl+V) this line and press Enter:
wget --https-only -nv -O- https://www.ros2lab.com/install/setup.sh | bash -s guided
Leave that window open. Come back here and press:
Not connected yet.
Your browser may ask "Allow this site to find devices on your local network?". Choose Allow: it is the helper on your own PC.
What you should see
Ubuntu-24.04 ros2lab 0.6.28 installed. The helper is starting. LEAVE THIS WINDOW OPEN and go back to the ROS2Lab page: it now shows what your PC has. For the next commands open a second terminal. To stop the helper: Ctrl+C in this window. ros2lab helper on http://127.0.0.1:7777 Leave this window open. This helper only READS what is installed …
On this page: Connected, with a list of what your PC has now.
For every step below, use a second window: click the small ˅ beside the + at the top of the Ubuntu window and choose Ubuntu-24.04 (no + at the top? Click Start, type
ubuntu, and open Ubuntu-24.04 a second time). The helper keeps running in the first one.Two windows Window 1: helper
leave it openWindow 2: commands
paste the steps hereA drawing, not a photo of your screen.
What these words mean
- Helper
- A small program called
ros2lab. It reads what is installed on your PC and tells this page, so the ticks here are real. It talks only to 127.0.0.1. - 127.0.0.1
- The address that always means "this computer itself". What goes there never leaves your PC.
Stuck? The 3 most common problems
- This page stays "Not connected". Look at the helper window. One of its last lines must say
helper on http://127.0.0.1:7777. If you closed it, paste the line again. Still nothing? In PowerShell typewsl --shutdown(it stops every Linux in WSL), open Ubuntu again, and paste the helper line again. If the browser asked about your local network and you pressed Block, allow it in the site settings (the icon left of the address; in Brave: allow localhost access). Safari always blocks it: use Chrome, Edge or Firefox, or tick the steps by hand. - Nothing happens: the prompt comes back at once, or a line says
failed,unable to resolveorcertificate. Ubuntu could not download the helper. Check that Ubuntu has internet:ping -c 2 www.ros2lab.com(some networks never answer ping: if websites open in your browser, the internet is fine). A VPN or an antivirus that checks web traffic can block it (then you may see acertificateerror: never add--no-check-certificate): switch the VPN off for this, or use the Browser Lab. It saysCommand 'wget' not found? Typesudo apt-get update && sudo apt-get install -y wget, then paste the line again. OSError: [Errno 98] Address already in useA helper is already running in another window. Use that one, or close it with Ctrl+C and paste the line again.
None of these? Show this step to your teacher, or to a friend who knows computers. You do not have to wait: every lesson also works in the Browser Lab.
-
First Update the ROS2Lab tool
Your PC has ros2lab (older). This page needs ros2lab 0.6.28 or newer. With the older one, some lines below answer
unrecognized arguments. Updating takes one line and no password.1. In the helper's window, press Ctrl+C. The helper stops.
2. Paste this line and press Enter:
curl -fsSL https://www.ros2lab.com/install/setup.sh | ROS2LAB_NO_AUTO=1 bash
What you should see
Ubuntu-24.04 ros2lab 0.6.28 installed. Next: close this terminal and open a new one. …
3. Close that window and open a new one (click the small ˅ beside the + at the top of the Ubuntu window and choose Ubuntu-24.04 (no + at the top? Click Start, type
ubuntu, and open Ubuntu-24.04 a second time)). Start the helper again. Your second window can stay open.ros2lab connect --setup-only
Its last lines name the address
http://127.0.0.1:7777. This page sees the new version by itself within a few seconds, and this step disappears.Stuck? The 3 most common problems
Command 'curl' not foundUse this line instead:wget --https-only -nv -O- https://www.ros2lab.com/install/setup.sh | ROS2LAB_NO_AUTO=1 bash- The page still shows the old version. The helper that runs is the old one. Press Ctrl+C in its window and start it again with
ros2lab connect --setup-only. checksum mismatch: not installingThe download broke on the way. Paste the line again. Your old ros2lab is still there and still works.
None of these? Show this step to your teacher, or to a friend who knows computers. You do not have to wait: every lesson also works in the Browser Lab.
-
Step 1 Get Ubuntu ready (the 'universe' software list and curl)
This refreshes Ubuntu's list of software, installs three small tools, and switches on "universe".
The list "What your PC has now" says this is not Ubuntu 24.04? Do not paste the lines below: this course installs on Ubuntu 24.04 only. Use the Browser Lab.
In the second window, paste with a right-click (or Ctrl+V) this line and press Enter:
sudo apt-get update \ && sudo apt-get install -y locales software-properties-common curl \ && sudo add-apt-repository -y universe
Why your password: apt-get installs software for the whole PC, so Ubuntu asks for the administrator's password.
It asks
[sudo] password for …:. Type your Ubuntu password and press Enter. Nothing shows while you type, not even dots: that is normal.What you should see
Many lines scroll past. At the end your prompt (the line ending in
$) is back, and no line starts withE:. The tick on this page turns green by itself within a few seconds. A line withEXPKEYSIGorNO_PUBKEYandpackages.ros.org? An old ROS source from before 2025 is on this PC: step 2 removes it (see its Stuck list).What these words mean
- sudo
- "Do this as the administrator of this PC." That is why it asks for your password. Only you type sudo commands; the helper never does.
- apt-get
- Ubuntu's program that downloads and installs software.
- Package
- One piece of software that apt-get installs.
- universe
- A big list of free software kept by the Ubuntu community. ROS 2 needs some of it.
Stuck? The 3 most common problems
E: Could not get lock /var/lib/dpkg/lock-frontendUbuntu is updating itself in the background. Wait five minutes and paste the line again.… is not in the sudoers fileThis user may not install software. Log in as the user that was made when Ubuntu was installed. On a school, lab or company PC you cannot: use the Browser Lab.Temporary failure resolvingorCould not resolveUbuntu has no internet. Check the connection. On a company network a proxy may be in the way: ask your IT team for the apt proxy setting, or use the Browser Lab. On Windows: in PowerShell typewsl --shutdown, and open Ubuntu again. Start the helper again (its line is in the step "Start the helper"), then paste this step's line again.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 2 Add the official ROS 2 software source
This tells Ubuntu where ROS 2 lives. It downloads one small file from the ROS project, checks its fingerprint, installs it and refreshes the list.
Paste into the second window:
curl -fsSL --proto '=https' --tlsv1.2 -o /tmp/ros2-apt-source.deb \ https://github.com/ros-infrastructure/ros-apt-source/releases/download/1.3.0/ros2-apt-source_1.3.0.noble_all.deb \ && echo \ "f31d84adf5054c7d60ded0e82c0f776a77ea33af53d08f40b9ad7c94cca55296 /tmp/ros2-apt-source.deb" \ | sha256sum -c - \ && sudo dpkg -i /tmp/ros2-apt-source.deb \ && sudo apt-get update
Why your password: dpkg adds the ROS 2 software source to the list of the whole PC, so it needs the password.
What you should see
Terminal /tmp/ros2-apt-source.deb: OK
That line means the fingerprint matched. After it, the list is refreshed and some lines name
packages.ros.org.Source: ROS 2 Jazzy: Ubuntu (deb packages).
What these words mean
- Software source
- An address on the internet where apt-get looks for packages. ROS 2 lives at packages.ros.org.
- Fingerprint (sha256)
- A long number worked out from a file. If one letter of the file changes, the number changes. If the number is not the one this course tested, the file is wrong and the command stops.
Stuck? The 3 most common problems
/tmp/ros2-apt-source.deb: FAILEDThe download broke on the way. Paste the line again.EXPKEYSIG F42ED6FBAB17C654,NO_PUBKEYorConflicting values set for option Signed-ByAn old ROS source from before 2025 is on this PC. Remove it:sudo rm -f /etc/apt/sources.list.d/ros2.list /etc/apt/sources.list.d/ros2-latest.listthen paste the line again.curl: (6) Could not resolve host: github.comThe network blocks GitHub (some school and office networks do). Try another network, for example your phone's hotspot for this one small file. On a school or lab PC: ask the teacher to allow github.com, or use the Browser Lab.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 3 Install ROS 2 Jazzy, Gazebo Harmonic, ros2_control and MoveIt 2
The big one. It installs ROS 2 Jazzy, Gazebo Harmonic, ros2_control, MoveIt 2, colcon and the course's tools. The line lists 33 pieces of software (packages); Ubuntu adds the others they need.
Laptop: plug in the charger, and do not close the lid while this runs. If the laptop went to sleep and the step stopped with an error, paste the line again.
The ROS 2 install guide recommends bringing Ubuntu up to date first:
sudo apt-get update && sudo apt-get upgrade(it may take a while; then paste this step's line).Paste into the second window. You can leave it running:
sudo apt-get install -y ros-jazzy-desktop ros-dev-tools ros-jazzy-ros-gz \ ros-jazzy-ros2-control ros-jazzy-ros2-controllers ros-jazzy-gz-ros2-control \ ros-jazzy-xacro ros-jazzy-joint-state-publisher-gui ros-jazzy-twist-mux \ ros-jazzy-teleop-twist-keyboard ros-jazzy-moveit ros-jazzy-moveit-py \ ros-jazzy-demo-nodes-cpp ros-jazzy-demo-nodes-py python3-colcon-common-extensions \ python3-rosdep python3-vcstool git mesa-utils ros-jazzy-twist-stamper \ ros-jazzy-urdf-tutorial liburdfdom-tools ros-jazzy-tf2-tools ros-jazzy-tf-transformations \ ros-jazzy-teleop-twist-joy ros-jazzy-joy ros-jazzy-rqt-robot-steering \ ros-jazzy-plotjuggler-ros ros-jazzy-pilz-industrial-motion-planner \ ros-jazzy-moveit-planners-chomp ros-jazzy-moveit-planners-stomp python3-numpy \ python3-scipy
Why your password: ROS 2 goes into /opt/ros, a folder of the whole PC, so apt-get needs the password.
What you should see
On this page the line Course packages counts up (for example "21 of 33 installed"). In the window, hundreds of lines scroll past; at the end your prompt is back and no line starts with
E:.What these words mean
- ROS 2 Jazzy
- The Robot Operating System, version "Jazzy": the programs and tools robots are built with. It is free.
- Gazebo Harmonic
- A simulator: it shows a robot in a 3D world and works out how it moves.
- ros2_control
- The part of ROS 2 that drives a robot's motors (in the simulator, and on a real robot).
- MoveIt 2
- The part of ROS 2 that plans how a robot arm moves without hitting things.
- colcon
- The tool that turns ROS 2 source files into programs you can run. This is called "building".
Stuck? The 3 most common problems
E: Unable to locate package ros-jazzy-desktopStep 2 is not done, or this is not Ubuntu 24.04. Look at the list "What your PC has now" at the top of this page. In a virtual machine on a Mac (ARM), with step 2 done and only one package named: typeros2lab report, send the file to your teacher, and use the Browser Lab meanwhile.Hash Sum mismatch,Failed to fetch,unmet dependenciesorheld broken packagesA download broke, or Ubuntu is not up to date. Typesudo apt-get update && sudo apt-get upgrade, then paste the line again.No space left on deviceThe disk is full. Typesudo apt-get clean, free more space, then paste the line again.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab.Good place to stop for today. Your ticks are saved in this browser. Next time: open this page again and go on with the next step. If you had started the helper, start it again with its line.
-
Step 4 Start rosdep (it finds the system packages a workspace needs)
rosdep finds the system packages a workspace needs. The first line creates its list (it needs your password); the second downloads the list for you.
4a. Paste this line into the second window and press Enter. Type your password if it asks.
sudo rosdep init
4b. When the prompt is back, paste this line:
rosdep update
Why your password: The first line writes rosdep's list into /etc/ros, a folder of the whole PC (once per PC). The second line needs no password.
What you should see
The second line prints several lines that begin with
Hitand ends withupdated cache in /home/…/.ros/rosdep/sources.cache.What these words mean
- rosdep
- A tool that looks up which system packages a ROS 2 workspace needs.
Stuck? The 3 most common problems
ERROR: default sources list file already existsFine: someone ran the first line before. Go on with the second line.Command 'rosdep' not foundStep 3 did not finish. Do not install what Ubuntu suggests there. Paste the line of step 3 again.- The second line stops with
urlopen errorortimed outThe internet was slow for a moment. Typerosdep updateagain.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 5 Download the course workspace into ~/ws
This downloads the course's ready-made robots (a 5 MB file from ros2lab.com) into the folder
~/wsand checks its fingerprint. No password.Paste into the second window:
ros2lab setup --step 5
It answers
unrecognized arguments? The ros2lab on your PC is older than this page. Update it (no password):curl -fsSL https://www.ros2lab.com/install/setup.sh | ROS2LAB_NO_AUTO=1 bash, close the window, open a new one, and paste the line again.What you should see
Terminal ros2lab 0.6.28 · detected wsl-ubuntu-24.04 ros2lab step 5 of 10: Download the course workspace into ~/ws /tmp/ros2lab-ws.tar.gz: OK ✓ step 5 doneWhat these words mean
- Workspace
- A folder that holds ROS 2 packages. The course's ready-made robots live in
~/ws; your own work goes to~/ros2lab_ws. - ~
- Short for your home folder, for example
/home/asha.
Stuck? The 3 most common problems
Command 'ros2lab' not foundorros2lab: command not foundThis window was opened before the helper was installed. Close it and open a new one.… already holds other packages; ros2lab will not overwrite themYou already have a folder~/wswith other work. The lessons use~/ws, so move yours:mv ~/ws ~/my_ws, change~/wsto~/my_wsin your own lines of~/.bashrc, then runros2lab setup --step 5again. Your~/my_wshas the foldersbuild,installandlog? Delete those three and build it again (cd ~/my_ws && colcon build): they remember the old folder name./tmp/ros2lab-ws.tar.gz: FAILEDThe download broke. Run the step again.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 6 Build the course workspace with colcon
colcon now turns the course's source files into programs ROS 2 can run. The fan may get loud: that is normal.
Paste into the second window:
ros2lab setup --step 6
Only if your check showed 4 GB of memory or less: close your other programs first and use this line instead:
MAKEFLAGS=-j1 ros2lab setup --step 6Only if your Windows PC has 8 GB of memory (Ubuntu then gets about 4 GB): close your other programs first and use this line instead:
MAKEFLAGS=-j1 ros2lab setup --step 6It answers
unrecognized arguments? The ros2lab on your PC is older than this page. Update it (no password):curl -fsSL https://www.ros2lab.com/install/setup.sh | ROS2LAB_NO_AUTO=1 bash, close the window, open a new one, and paste the line again.What you should see
Terminal ros2lab 0.6.28 · detected wsl-ubuntu-24.04 ros2lab step 6 of 10: Build the course workspace with colcon Starting >>> … Finished <<< … Summary: 11 packages finished [13.3s] ✓ step 6 doneOne
Startingand oneFinishedline for each package, then the summary. (13 seconds on the course PC; your time will differ.)What these words mean
- colcon
- The tool that turns ROS 2 source files into programs you can run. This is called "building".
Stuck? The 3 most common problems
- It says
some system packages the workspace needs are missingand shows asudo apt-get installline. Paste that line (it needs your password), then run the step again. c++: fatal error: Killed signal terminated program cc1plusThe memory ran out. Close the browser's other tabs and runMAKEFLAGS=-j1 ros2lab setup --step 6: it builds one package and one file at a time.- One package ends with
Failed <<<. Run the step again. If the same package fails again, typeros2lab reportand send the file it makes to your teacher.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 7 VS Code and the five course extensions (optional)
VS Code is the editor the lessons use. On Windows you install it on Windows, not inside Ubuntu. You can skip this step now and do it later.
7a. This one line uses PowerShell again. Open it from Start (normal, not as administrator) and paste:
winget install -e --id Microsoft.VisualStudioCode
The first time, winget may ask whether you agree to the terms of its sources: type
Yand press Enter. PowerShell sayswingetis not recognized (some Windows 10 PCs)? Download VS Code from code.visualstudio.com/download and install it like any program.7b. Close the second Ubuntu window and open a new one. Paste this line. It opens VS Code once, and VS Code adds a small part of itself to Ubuntu. If VS Code asks whether you trust the folder, choose Yes, then close VS Code:
code .
7c. Back in the Ubuntu window, paste this line. It adds the five course extensions (add-ons for VS Code):
ros2lab setup --step 7
It answers
unrecognized arguments? The ros2lab on your PC is older than this page. Update it (no password):curl -fsSL https://www.ros2lab.com/install/setup.sh | ROS2LAB_NO_AUTO=1 bash, close the window, open a new one, and paste the line again.What you should see
The step ends with a line that begins
✓ VS Code extensions:and names five extensions: Python, ROS 2, URDF, YAML and XML.Source: Visual Studio Code on Linux; Developing in WSL.
What these words mean
- VS Code
- A free editor from Microsoft for writing program files. The lessons use it.
Stuck? The 3 most common problems
editor: missing extensions: …The internet dropped while it downloaded. Runros2lab setup --step 7again.Command 'code' not foundin the Ubuntu window Close the second Ubuntu window and open a new one after VS Code is installed on Windows. (Leave the helper's window open.)- I do not want VS Code. Press "Skip this step". The lessons also work with any text editor, and the Browser Lab has its own.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 8 Make every new terminal know ROS 2
This adds a few lines to the end of the file
~/.bashrc, between two marks that say# ros2lab. Every new terminal then knows ROS 2 and the course robots. No password, and nothing else to type here. Already setROS_DOMAIN_IDyourself, or use robots on your network? Open "For later" below first.For later: what else it sets
It sets
ROS_DOMAIN_IDto a number of its own and keeps ROS 2 on this PC only (ROS_AUTOMATIC_DISCOVERY_RANGE=LOCALHOST), so classmates on the same Wi-Fi do not see your robots. In new terminals these replace settings of your own. Your teacher gives you a number?ros2lab domain 7(with that number). Robots on your network:ros2lab domain --network.Paste into the second window:
ros2lab setup --step 8
Then close the second window and open a new one (click the small ˅ beside the + at the top of the Ubuntu window and choose Ubuntu-24.04 (no + at the top? Click Start, type
ubuntu, and open Ubuntu-24.04 a second time)). Only new windows read the new lines.It answers
unrecognized arguments? The ros2lab on your PC is older than this page. Update it (no password):curl -fsSL https://www.ros2lab.com/install/setup.sh | ROS2LAB_NO_AUTO=1 bash, close the window, open a new one, and paste the line again.What you should see
Terminal ros2lab 0.6.28 · detected wsl-ubuntu-24.04 ros2lab step 8 of 10: Make every new terminal know ROS 2 ✓ step 8 done
In the new window,
ros2 --helpnow answers with a list of commands.What these words mean
- ~/.bashrc
- A text file that Ubuntu reads every time you open a terminal.
- ROS_DOMAIN_ID
- A number from 0 to 101. ROS 2 programs with the same number can hear each other. Lesson 1.2 explains it.
Stuck? The 3 most common problems
- In the new window
Command 'ros2' not found. The window was open before this step. Close it and open another one. - I already had my own lines for ROS in
~/.bashrc. They stay. ros2lab only writes between its two marks. - I want to undo it.
ros2lab uninstallasks first, then deletes the whole~/wsfolder (copy your own work out before), the helper's state and its lines in~/.bashrc. ROS 2 itself stays; it prints how to remove the rest.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 9 Test ROS 2 and Gazebo on this PC
Now the PC tests itself, in two parts. First 15 checks of ROS 2 and Gazebo: during these a Gazebo window opens and closes by itself a few times (do not click it). Then a speed test: Gazebo runs 10 seconds of robot time with no window. A speed below 90 % still lights the speed lamp (yellow): it was measured, and the lessons work.
In the new window:
ros2lab setup --step 9
It answers
unrecognized arguments? The ros2lab on your PC is older than this page. Update it (no password):curl -fsSL https://www.ros2lab.com/install/setup.sh | ROS2LAB_NO_AUTO=1 bash, close the window, open a new one, and paste the line again.What you should see
Terminal ros2lab 0.6.28 · detected wsl-ubuntu-24.04 ros2lab step 9 of 10: Test ROS 2 and Gazebo on this PC ros2lab doctor 0.6.28 on ubuntu-24.04 (ROS 2 jazzy) ✓ ROS 2 Jazzy installed ✓ ros2 CLI answers … ros2lab speed test: Gazebo without a window, 10 seconds of simulated time (about 25 seconds) ✓ Gazebo runs at 100 % of real time (full speed) ✓ Gazebo draws with: … ros2lab step 9 done. Last step: ros2lab sim (the course robot opens in Gazebo and RViz)
A tick, a warning sign or a cross for each check. Skipped step 7? Then the VS Code check shows a cross: that is fine. On this page: your speed, and the graphics card Gazebo really used. Your speed can be below 100 %. On a small PC or in a virtual machine that is expected; it is not a failure.
Source: Gazebo Harmonic: troubleshooting (OpenGL, software rendering).
What these words mean
- OpenGL
- The language programs use to ask the graphics card for 3D pictures. Gazebo needs level 3.3 or higher.
- Graphics card (GPU)
- The part of the PC that draws 3D pictures. Gazebo is fast with it and slow without it.
Stuck? The 3 most common problems
- A cross at
rendering works (GUI). Gazebo could not draw, even with software drawing. Typeros2lab reportand send the file to your teacher; meanwhile every lesson works in the Browser Lab. - A cross at
ROS_DOMAIN_ID: "this terminal has nothing". This window is older than step 8. Close it, open a new one, and run the step again. - A cross at
display available. Windows could not show Linux windows. In PowerShell:wsl --update, thenwsl --shutdown. Open Ubuntu again, start the helper again, and run the step again.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. -
Step 10 Open the course robot in Gazebo and RViz
The last step: open the course robot, my_bot, in Gazebo (the simulator) and in RViz (the viewer).
ros2lab sim
What you should see
Gazebo and RViz Gazebo
a small robot on a grey floorRViz
the same robot on a gridA drawing, not a photo of your screen.
Two windows open. The first start can take up to a minute. This page ticks the step when it sees both: leave them open until this step shows ✓ (about 10 seconds). Close them with Ctrl+C in the window where you typed the command.
Source: Gazebo Harmonic: troubleshooting.
Stuck? The 3 most common problems
- The Gazebo window stays black or closes at once. Type
ROS2LAB_GPU=off ros2lab setup --step 9. When it ends, typeros2lab simagain. Gazebo then draws with the processor: slower, but it works. - No window opens at all. In PowerShell:
wsl --update, thenwsl --shutdown. Open Ubuntu again, start the helper again, and try again. - Gazebo and RViz are open, but this step gets no tick. The tick needs step 9 without a cross, and the helper running. Close the robot (Ctrl+C), run
ros2lab setup --step 9again and fix its cross, thenros2lab simagain. Only slow? That is software drawing or a small graphics card: the lessons still work.
None of these? Type
ros2lab reportand send the file it makes to your teacher. You do not have to wait: every lesson also works in the Browser Lab. - The Gazebo window stays black or closes at once. Type
Final check: is your PC ready for the course?
Your PC checks eight things itself. A light turns green only when your PC really has that thing. When all eight are on, this box says Your PC is ready for the course; then you can save the result and start lesson 1.1.
- ROS 2 Jazzynot checked yet
- Gazebo Harmonicnot checked yet
- ros2_controlnot checked yet
- MoveIt 2not checked yet
- colcon, the build toolnot checked yet
- Course workspace builtnot checked yet
- Course robot seen in Gazebo and RViznot checked yet
- Speed test of Gazebonot checked yet
The helper must be running (step "Start the helper").
For the lessons: press Ctrl+C in the helper window and close it. Open a new window and type ros2lab connect. Started this way, the helper can also run the lesson's own commands (a fixed list) and save your lesson files in ~/ros2lab_ws; it still never uses your password. Leave that window open, and on a lesson page choose My ROS 2 PC (in a virtual machine: open the lessons in Firefox inside Ubuntu). While it runs, the helper also answers web pages served from this PC itself, so do not open other local web pages (a dev server, a notebook) at the same time. On another day, ros2lab connect starts it again.
A light stays grey and the step's "Stuck?" does not help? Every lesson also works in the Browser Lab, with nothing to install.