Skip to content

User_Inst_UbuntuOnOracleVM

Mehmet Emre Çakal edited this page Oct 10, 2024 · 11 revisions

1.2 Ubuntu on Virtual Machine

If you already have Ubuntu (virtual or not) compatible with your ROS distribution, feel free to skip this tutorial. There are many ways to install Ubuntu VM on a Windows PC, here are some:

1. Windows Subsystem for Linux: WSL (Recommended)

  • Finally with the UI support, WSL is the most powerful, easy to install, and convenient option in this list. We cannot recommend more. Please follow Microsoft's official instructions. Don't forget to install Ubuntu 22 for ROS2 Humble, and Ubuntu 20 for ROS Noetic. Unity Scripting Configuration

2. Docker

  • You can use ROS on a Ubuntu Docker container with additional benefits, but there is a small learning curve. We recommend WSL if you have time constraints. On Windows, Docker also uses the WSL or Hyper-V backend for Linux containers. Each backend has its own advantages and disadvantages, but we recommend the WSL backend. First, follow the official Docker Installation Guide for Windows.
  • After installing Docker, please follow this highly practical ROS & Docker video series by @joshnewans.
  • In a nutshell, with Docker, you can pull and run a pre-installed ROS (humble) container as follows:
    docker image pull ros:humble
    docker run -it ros:humble

You can also use VS Code's new Dev Container feature. Basically, it allows you to open a ROS Docker container with a single click without leaving your VS Code window. However, if you are new to ROS and/or Linux, I don't recommend it.

For Windows 10 users, Ubuntu VM can also be set up in Hyper-V. Please see 3. header.

  1. Follow this tutorial to download Oracle VM VirtualBox and create a new VM.

  2. Setting up the Network: In Oracle VirtualBox, make sure the Ubuntu VM is powered off. Then open the settings for the Ubuntu VM. In the Network tab, add two new network adapters:

    1. Host-only Adapter
      Host-only Adapter

    2. Network Bridge
      Bridged Adapter

    • In both set the Promiscuous mode to allow VMs and set the Cable Connected tag.

    • In Ubuntu type $ ifconfig to check the network configuration and to verify your Ethernet connection to the Windows OS.

    • The IP address (enp0s8) of the Ubuntu system will be used by rosbridge_suite and RosBridgeClient as mentioned later in tutorial 2.1 tutorial.

    • These settings are needed so that the RosBridgeClient running in Windows, and the ROSBridge Server running on Ubuntu can communicate.

4. Hyper-V

Hyper-V offers native integration with Windows and efficient resource management for multiple OSs, but it's limited to Windows environments. VirtualBox provides cross-platform virtualization with flexibility, but it may have performance overhead compared to Hyper-V and lacks some advanced features for enterprise use cases.

  1. Pre-requisites

    • To check if your machine supports Hyper-V, fire up the Command Prompt (cmd.exe) and enter systeminfo.exe

    • At the end of the output, you will see an entry named Hyper-V Requirements.

    • If all you see are No, you need to enable hardware virtualization in BIOS. Otherwise, proceed

  2. Enable Hyper-V

    • Open Windows Features (you can search for it in search box), check Hyper-V.

    • Click OK and wait for reboot.

  3. Get Ubuntu image

    • You can find and download your compatible Ubuntu release from here.
  4. Create Virtual Machine by following this (or any) YouTube tutorial.

Next tutorial: ROS on Ubuntu

© Siemens AG, 2017-2024

Clone this wiki locally