---
title: ROS development on Linux, Windows and macOS
description: In this blog post, we will see how to set up a ROS development workflow
  on your computer, no matter if you are running Linux, Windows or macOS.
url: https://canonical.com/blog/ros-development-on-linux-windows-and-macos?format=md
---

1. [Blog](https://canonical.com/blog)
2. Article

---

[Jeremie Deray](https://canonical.com/blog/author/artivis "More about Jeremie Deray")

5 May 2023

# ROS development on Linux, Windows and macOS

[Multipass](https://canonical.com/blog/tag/multipass)
[robotics](https://canonical.com/blog/tag/robotics)
[ROS](https://canonical.com/blog/tag/ros)
[ROS 2](https://canonical.com/blog/tag/ros-2)

---

Share the article

Historically ROS has been developed on top of Ubuntu, relying on the distribution as a stable base providing tools (like GCC, CMake, Python to name a few) and libraries (such as Boost, Eigen, PCL) and following its release cycle (a distribution per year, an LTS every two years). This synergy has worked great for more than 15 years and saw the project and the community behind it vastly grow.

However, being tied to a specific Linux distribution raises all kinds of difficulties. Developing for several ROS distributions can be challenging since they each are tied to an Ubuntu distribution. This challenge increases in particular for ROS newcomers that might not even be familiar with Linux. Similarly, developing ROS on Windows or macOS is anything but a pleasant experience.

In this blog post, we will cover how to set up a ROS development environment regardless of the operating system used. Using [Multipass](https://canonical.com/multipass), an Ubuntu virtual machines’ manager, it’s easier than ever to quickly spawn a full-fledged VM rocking Ubuntu. We made it so easy that spawning a VM with ROS pre-installed only takes a single command line. Shall we?

## Multipass

The first step in our journey is the installation of Multipass. While we summarise hereafter the installation instructions on [Linux](https://documentation.ubuntu.com/multipass/en/latest/how-to-guides/install-multipass/), you can find the equivalent instructions for [Windows](https://documentation.ubuntu.com/multipass/en/latest/how-to-guides/install-multipass/) and [macOS](https://documentation.ubuntu.com/multipass/en/latest/how-to-guides/install-multipass/) on the documentation.

On Linux, Multipass ships as a [snap package](https://snapcraft.io/docs/robotics) allowing it to be installed on dozens of Linux distributions. To install it, hit the following in a terminal:

```
sudo snap install multipass
```

And that’s just about it, we’re done.

```
$ multipass version
multipass   1.11.0
multipassd  1.11.0
```

## Spawning a first VM

Now that Multipass is installed, we can launch our first VM. And while the installation procedure differs depending on the host OS, the following should run wherever you are.

As a practical case, we will place ourselves in the scenario of developing for ROS 2 Humble, therefore using Ubuntu 22.04. To do so, we will enter:

```
multipass launch 22.04 --name humble-vm
```

After hitting enter, the command will spin a little while the VM is being provisioned. A few moments later, a message such as ‘Launched: humble-vm’ will appear. Our Ubuntu VM is ready, let’s make use of it.

To connect to our fresh VM, it is once again pretty straightforward. In a terminal enter:

```
$ multipass shell humble-vm
ubuntu@humble-vm:~$
```

Forthwith, here we are!

```
ubuntu@humble-vm:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
```

We are indeed rocking an Ubuntu 22.04 VM after just three command lines. However, mind that by default Multipass VMs are pretty constrained. They only use a single core together with a single gig of memory and five gigs of disk space. This will be very limiting for a proper ROS 2 development environment. Of course, we can change all of that either when initially launching the VM as [shown in the documentation](https://documentation.ubuntu.com/multipass/en/latest/how-to-guides/manage-instances/create-an-instance/#create-an-instance-with-custom-cpu-number-disk-and-ram) or even after the fact by running the following commands:

```
$ multipass stop humble-vm
$ multipass set local.humble-vm.cpus=4
$ multipass set local.humble-vm.disk=50G
$ multipass set local.humble-vm.memory=8G
$ multipass start humble-vm
```

At this point, we can follow the [ROS 2 Humble installation guide](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html) as usual and start developing for ROS 2. But while we could keep on going, through the installation hassle of ROS 2 Humble, I promised you a one-liner to set up a fresh ROS development environment, didn’t I?

## One-liner to a ROS development environment

Multipass in itself is already pretty handy as it is. Three command lines and we find ourselves in a fresh Ubuntu VM. But let’s take it a notch further, shall we? How about three command lines and we find ourselves in a fresh ROS development environment?

### Multipass blueprints

To do so, we developed a [Multipass blueprint](https://documentation.ubuntu.com/multipass/en/latest/explanation/blueprint/) for ROS 2 Humble. A blueprint is a configuration file detailing a set of parameters and instructions that drive the setup of a customised environment. All Multipass environments can be listed as follows:

```
$ multipass find
 Image             Aliases           Version      Description
 …
 core22                              20230119     Ubuntu Core 22
 …
 22.04             jammy,lts         20230302     Ubuntu 22.04 LTS
 …
 docker                              0.4          A Docker environment with Portainer and related tools
 …
 ros-noetic                          0.1          A development and testing environment for ROS Noetic.
 ros2-humble                         0.1          A development and testing environment for ROS 2 Humble.
```

Among other things, we will find a [Core 22 image](https://ubuntu.com/core), the 22.04 image we used above, but also a Docker-ready environment and what’s of interest to us now, a ROS Noetic and a ROS 2 Humble environments. Let us see what this is about.

In the first place, let’s cleanup a bit. We will stop, delete and purge our previous VM:

```
$ multipass stop humble-vm
$ multipass delete --purge humble-vm
```

### ROS blueprints

From a clean sheet, we will now launch our ROS 2 Humble VM making use of a predefined environment:

```
multipass launch ros2-humble --name humble-vm
```

Again this will take a little while. A little more than previously since this time, not only are we spawning an Ubuntu VM but also installing ROS 2 Humble automatically.

> You may see the following message,
>
> *launch failed: The following errors occurred:
> timed out waiting for initialization to complete*
>
> It simply indicates that a Multipass internal timeout expired. The VM does actually continue its setup in the background and you will be able to use it. To get rid of this message, set a larger timer, e.g. `–timeout 600

Once completed, we can connect to the VM as previously mentioned,

```
$ multipass shell humble-vm
ubuntu@humble-vm:~$
```

What’s neat is that, not only is ROS 2 installed, the ROS 2 environment is also preconfigured. Upon connecting to the VM, we can issue e.g.:

```
ubuntu@humble-vm:~$ echo $ROS_DISTRO
humble
```

ROS 2 Humble is installed, together with common ROS 2 tools, the ROS 2 environment is sourced, rosdep is initialised and updated, colcon’s autocompletion is enabled etc. Furthermore, the VM is set to use 2 cores, 4 gigs of memory and 40 gigs of disk space. Ready to go!

In case you didn’t switch yet to ROS 2, we’ve seen in the list of available customised environments a ROS Noetic one. Similarly to what we’ve just did, you can launch a ROS Noetic VM with a single command line and be ready to develop in no time.

## Pro tips

Before letting you explore your new development workflow, I’d like to share a couple tips that will make your daily driving for VMs smooth.

### Mounting a local folder

As part of our development workflow, we may want to mount a local folder inside our VM. To do so, nothing simpler:

```
multipass mount /some/local/path humble-vm:/some/remote/path
```

We can also do that directly at launch:

```
multipass launch ros2-humble --name humble-vm --mount /some/local/path:/some/instance/path
```

### Adding an SSH key

The second tip is to add our SSH key to the VM so that we can SSH to it. To do so, we will copy our public key to the VM:

```
multipass exec humble-vm -- bash -c "echo `cat ~/.ssh/<key>.pub` >> ~/.ssh/authorized_keys"
```

Note that we could also retrieve the key from GitHub:

```
multipass exec humble-vm -- bash -c “curl https://github.com/<username>.keys | tee -a ~/.ssh/authorized_keys”
```

In order to remote connect, let’s first find out the VM’s IP address:

```
$ multipass info humble-vm
Name:           humble-vm
State:          Running
IPv4:           10.87.167.28
Release:        Ubuntu 22.04.2 LTS
Image hash:     345fbbb6ec82 (Ubuntu 22.04 LTS)
CPU(s):         2
Load:           0.00 0.06 0.09
Disk usage:     6.5GiB out of 38.6GiB
Memory usage:   243.4MiB out of 3.8GiB
Mounts:         --
```

With that, let us connect:

```
$ ssh ubuntu@10.87.167.28
ubuntu@humble-vm:~$
```

We could also make this a one liner:

```
$ ssh ubuntu@$(multipass list --format csv | awk -F, '$1=="humble-vm"{print $3}')
ubuntu@humble-vm:~$
```

Note that enabling SSH is the basis for the next tips.

### Running graphical applications

Since both Linux and macOS run X by default, in order to launch a graphical application from the VM, all we need to do is to establish an X forwarding SSH session:

```
ssh -X ubuntu@10.87.167.28
```

Let’s try that. Running the following command:

```
ubuntu@humble-vm:~$ ign gazebo
```

should start (Ignition) Gazebo and display the following assistant:

For the reader on Windows, you will need to install an X server and export the ‘DISPLAY’ environment variable. All of this is detailed in the [online documentation](https://documentation.ubuntu.com/multipass/en/latest/how-to-guides/customise-multipass/set-up-a-graphical-interface/).

### VSCode remote-ssh

If your IDE of choice is [VSCode](https://snapcraft.io/code), you’re in luck. Indeed, among the many plugins it offers, VSCode has a ‘remote-ssh’ plugin that allows us to, as its name suggests, [do some remote development](https://code.visualstudio.com/docs/remote/ssh). We can then code from the comfort of our IDE directly into the virtual environment.

Firstly, make sure you have installed the plugin, either from VSCode’s extension tab,

or using the following command in a terminal:

```
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
```

We can now launch VSCode and open a remote connection as [described in the documentation](https://code.visualstudio.com/docs/remote/ssh#_connect-to-a-remote-host) or do both at the same time directly from the terminal:

```
code --folder-uri vscode-remote://ssh-remote+ubuntu@10.87.167.28/home/ubuntu
```

We should see a VSCode window opening and pointing to the VM’s $HOME,

## Conclusion

We have seen in this blog that no matter the operating system your machine is running on, you can easily install Multipass and use it to launch, not only an Ubuntu virtual machine but a ROS-ready virtual machine. This kind of development workflow offers a great deal of flexibility enabling you to work on several ROS distributions at once. It also allows for isolated and reproducible workflow, which in the face of complex software development is so valuable.

In the case you are running Linux, you may also be interested in containers rather than full blown virtual machines. Have a look at our previous post that details how you can set up a ROS 2 development container using [LXD](https://linuxcontainers.org/lxd/introduction/): “[Install ROS 2 Humble in Ubuntu 20.04 or 18.04 using LXD containers](https://ubuntu.com/blog/install-ros-2-humble-in-ubuntu-20-04-or-18-04-using-lxd-containers)”.

And pay us a visit at [ubuntu.com/robotics](https://ubuntu.com/robotics) to discover all of our robotics activities.

*This post initially appeared on* [artivis.github.io](https://artivis.github.io/).

[Get in touch

Interested in running Ubuntu in your organization?](https://ubuntu.com/about/contact-us/form)

## Sign up for our newsletter

Get the latest Canonical news and updates in your inbox.

Work email:

\*I agree to receive information about Canonical's
products and services.

By submitting this form, I confirm that I have read and agree to [Canonical's Privacy Policy](https://canonical.com/legal/dataprivacy).

Sign up

## Share on

---

## Related posts

[### Canonical is now a platinum member in the Open Source Robotics Alliance](https://canonical.com/blog/osra-membership)

Ubuntu is the home of ROS. The very first ROS distribution, Box Turtle, launched on Ubuntu 8.04 LTS, Hardy Heron, and since then, Ubuntu and ROS have grown hand in hand. With...

[Gabriel Aguiar Noury](https://canonical.com/blog/author/g-aguiar-noury)

20 August 2025

[### ROS Noetic is EOL – take action to maintain fleet security](https://canonical.com/blog/ros-noetic-is-eol-take-action-to-maintain-fleet-security)

As of May 2025, the Robot Operating System (ROS) Noetic Ninjemys officially reached its end of life (EOL). First released in 2020 as the final ROS (1) distribution, ROS Noetic...

[Florencia Cabral Berenfus](https://canonical.com/blog/author/flor-cabral)

8 August 2025

[### TurtleBot3 OpenCR firmware update from a snap](https://canonical.com/blog/turtlebot3-opencr-firmware-update-from-a-snap)

The TurtleBot3 robot is a standard platform robot in the ROS community, and it’s a reference that Canonical knows well, since we’ve used it in our tutorials. As a matter of...

[gbeuzeboc](https://canonical.com/blog/author/gbeuzeboc)

25 September 2024

[### Extending ROS Noetic Support with ESM-Enabled Content Snaps](https://canonical.com/blog/extending-ros-noetic-support-with-esm-enabled-content-snaps)

Canonical has now extended its ESM (Expanded Security Maintenance) for ROS coverage to ROS Noetic content-sharing snaps. With ESM for ROS now available in both deb and snap...

[Florencia Cabral Berenfus](https://canonical.com/blog/author/flor-cabral)

17 December 2025
