Atlas Robotics
Lesson 1/3 · about 30 min

Watch on YouTube ↗Watch on Facebook ↗

Installing Ubuntu alongside Windows (dual boot)

This course runs on Ubuntu 22.04. If your computer runs Windows, the best option is to install Ubuntu alongside it: when the computer starts you choose Windows or Ubuntu, and your Windows data stays untouched. If you already have Ubuntu 22.04, skip this lesson and go straight to Install & build.

After this lesson you will

  • Understand why virtual machines are a poor fit for Gazebo, RViz and Nav2
  • Have Ubuntu 22.04 installed alongside Windows, selectable at boot
  • Be able to check that Ubuntu uses your real graphics card rather than rendering on the CPU

1. Why not use a virtual machine

Virtual machines (VirtualBox, VMware) are handy for trying Linux commands, but this course runs Gazebo + RViz + Nav2 at the same time, and all three are heavy on graphics and real-time behaviour. In a virtual machine you will often hit these problems:

ProblemIn a virtual machineEffect on the lessons
GraphicsThe VM only sees a virtual graphics card with limited 3D support. Ubuntu often has to render on the CPU (the llvmpipe renderer).Gazebo and RViz stutter or fail to open. Atlas's LiDAR in Gazebo is a gpu_lidar sensor — its rays are computed on the graphics card — so CPU rendering makes scans very slow.
SpeedGazebo cannot keep up with real time (the real time factor drops well below 1).ROS time runs slow and jerky: SLAM stitches a skewed map, Nav2 reports timeouts, TF reports "extrapolation" errors — you end up chasing bugs that are not in your code.
RAM, CPUShared with the Windows system running outside.Gazebo + RViz + Nav2 run short of resources and the machine freezes easily.
NetworkBy default the VM sits behind NAT.When you connect a real robot, ROS 2 (DDS) finds other machines with multicast on the LAN — behind NAT it usually cannot see the robot until you switch to bridged networking.
USBEach device must be passed through to the VM, and connections drop.Gamepads, LiDARs and microcontrollers on USB often disconnect mid-session.

Dual boot does not "split" the machine: when you boot into Ubuntu, it uses all of the real CPU, RAM and graphics card. That is why the simulation runs far more smoothly than in a VM on the same computer.

What about WSL2? On Windows 11, WSL2 can open graphical apps and use the graphics card through a translation layer, so the early modules (ros2 commands, topics, TF) work. But Gazebo and RViz often hit graphics errors through that layer, and the default network is behind NAT just like a VM. To complete the whole course and later connect a real robot, install dual boot.

The pictures in this lesson are recreated screens so each step can be marked clearly (Windows 11, Rufus, the Ubuntu 22.04 installer): labels and button positions match the real ones, colours and sizes may differ slightly on your machine. The Terminal output in section 8 is real. Orange numbered circles show the order of actions; a red box with ✕ marks an option you must not choose. Click a picture to see it full size.

2. Before you install

  • Back up important data to an external drive or the cloud. Done correctly, the steps below do not erase Windows, but partitioning a disk always carries some risk.
  • An empty USB drive of 8 GB or more — it will be wiped to become the installer.
  • Free space: at least about 50 GB for Ubuntu, 100 GB if you can (ROS 2, Gazebo, your workspace, maps and recorded bags fill up over time).
  • Check whether the computer boots in UEFI or Legacy mode: press Win+R, type msinfo32 and look at the BIOS Mode line. Almost all recent computers use UEFI — this lesson is written for UEFI.
    System Information window, BIOS Mode row shows UEFI
    ① BIOS Mode = UEFI · ② If Secure Boot State = On, you will see the MOK screen in step 7.
  • BitLocker: if drive C is encrypted with BitLocker, get its Recovery Key ready (from your Microsoft account or Control Panel → BitLocker). After the boot order changes, Windows may ask for it.
  • Turn off Windows Fast Startup: Control Panel → Power Options → Choose what the power buttons do → Change settings that are currently unavailable → untick Turn on fast startup. With it on, Windows hibernates instead of shutting down fully, and Ubuntu can run into errors reading the Windows drive.
    Power Options System Settings page, Turn on fast startup unchecked
    ① Click the link with the shield icon to unlock the options · ② Uncheck Turn on fast startup · ③ Save changes.

3. Shrink the Windows drive to make free space

  1. Right-click the Start button → Disk Management.
  2. Right-click drive C: (or the drive with the most free space) → Shrink Volume.
    Disk Management, right-clicking drive C: and choosing Shrink Volume
    ① Right-click the C: block in the disk bar at the bottom · ② Shrink Volume...
  3. Enter the amount to free up in MB: 100 GB = 102400 → Shrink.
    Shrink C: dialog with 102400 MB entered
    ① Enter the amount in MB (102400 = 100 GB) · ② Shrink.
  4. When an Unallocated area (shown in black) appears, you are done. Do not create a partition in it — leave it empty for Ubuntu.
    Disk Management after shrinking, with 100 GB Unallocated
    ① The Unallocated area with a black bar on top — leave it as is, do not create a partition.

Do not delete or format any other partition in Disk Management — especially the EFI System Partition and Recovery partitions: without them Windows will not boot.

4. Create the Ubuntu USB installer

  1. Download Ubuntu 22.04 LTS Desktop (the .iso file) from the official page releases.ubuntu.com/22.04. It must be 22.04 — ROS 2 Humble only officially supports this release.
  2. Download Rufus (rufus.ie) or balenaEtcher.
  3. In Rufus: pick the USB drive and the ISO file, set Partition scheme = GPT, Target system = UEFI → Start. If it asks for a write mode, keep the default (ISO Image mode).
    Rufus with GPT and UEFI selected
    ① Pick the right USB drive · ② SELECT the Ubuntu 22.04 ISO · ③ GPT + UEFI (non CSM) · ④ START. Leave the other fields at their defaults.
    Rufus asks for the write mode, ISO Image mode selected
    ① Keep Write in ISO Image mode (Recommended) · ② OK. Rufus will warn that the USB data will be erased — accept.

5. Boot from the USB drive

Plug in the USB drive, restart, and repeatedly press the boot menu key as soon as the screen lights up. The key depends on the manufacturer; common ones are:

ManufacturerBoot menu key (common)
Dell, Lenovo, AcerF12 (some Lenovo models use a small Novo button on the side)
HPF9 (or Esc, then choose)
ASUSF8 or Esc
MSIF11

Choose the entry with your USB drive's name (usually prefixed with UEFI). Another way that needs no guessing: in Windows hold Shift and click Restart → Use a device → choose the USB drive.

Boot device menu, UEFI USB entry
① Pick the entry with UEFI + the USB name. This menu looks different on each brand, but the USB name is always there.
Windows Choose an option screen, Use a device
Hold Shift and click Restart to get this screen. ① Use a device → pick the USB drive.

In the USB's GRUB menu, choose Try or Install Ubuntu.

GRUB menu of the Ubuntu USB
① Try or Install Ubuntu · ② If ① gives a black or frozen screen, reboot and choose Ubuntu (safe graphics).

6. Install Ubuntu

  1. Choose a language (English is recommended — error messages are easier to look up) → Install Ubuntu.
    Ubuntu installer, Welcome screen
    ① Language English · ② Install Ubuntu.
  2. Keyboard: English (US).
  3. Connect to Wi-Fi. Choose Normal installation and tick Install third-party software for graphics and Wi-Fi hardware (graphics and Wi-Fi drivers).
    Ubuntu installer, Updates and other software screen
    ① Normal installation · ② Tick third-party software (graphics and Wi-Fi drivers) · ③ Only shown when Secure Boot is on: set a temporary password and remember it for step 7.
  4. If Secure Boot is enabled, the installer asks you to set a temporary password — remember it, you will need it at the next boot (step 7).
  5. On the Installation type screen, choose Install Ubuntu alongside Windows Boot Manager. The installer uses the free space from step 3.
    If that option is missing (the installer did not detect Windows), choose Something else: select the free space → + → Ext4, mount point / → OK; under Device for boot loader installation pick the disk that holds Windows. Do not tick Format on any existing partition.
    Ubuntu installer, Installation type screen
    ① Install Ubuntu alongside Windows Boot Manager → Continue · ② Something else only if option ① is missing · ✕ Never choose Erase disk — it wipes Windows.
    Ubuntu installer, Something else, creating a partition on free space
    Only with Something else: ① select the free space row (the size you freed in step 3) · ② click + · ③ Ext4, mount point / → OK · ④ the boot loader device is the whole disk (e.g. /dev/nvme0n1), not a partition. Do not tick Format? on any existing row.
  6. Choose your time zone, set a name and password → wait for the installation → Restart Now, and remove the USB drive when prompted.

Never choose Erase disk and install Ubuntu — it wipes Windows and all data on the disk.

7. First boot

  • Blue "Perform MOK management" screen (only when Secure Boot is on and you ticked the driver option in step 6): choose Enroll MOK → Continue → Yes → enter the temporary password → Reboot. Skip this and the NVIDIA driver will not load.
    Five steps on the blue Perform MOK management screen
    Use the arrow keys + Enter: ① Enroll MOK · ② Continue · ③ Yes · ④ type the temporary password from step 6 (nothing shows as you type) · ⑤ Reboot.
  • The GRUB menu appears: Ubuntu first, plus a Windows Boot Manager entry. From now on, choose the operating system here each time you start the computer.
    GRUB menu after installation, with Ubuntu and Windows Boot Manager
    ① Ubuntu (default after 10 seconds) · ② Windows Boot Manager to start Windows.

8. Check that Ubuntu uses the real graphics card

Open a terminal (Ctrl+Alt+T):

sudo apt update
sudo apt install -y mesa-utils
glxinfo -B | grep -E "OpenGL renderer|OpenGL version"

The OpenGL renderer line must name your real graphics card (Intel, AMD or NVIDIA). If it says llvmpipe, rendering is happening on the CPU — Gazebo will be very slow.

glxinfo output: top is a real NVIDIA card, bottom is llvmpipe
Real output on Ubuntu 22.04. ① Good: the real card name (here an NVIDIA GTX 1650) · ✕ Bad: llvmpipe = drawing with the CPU.

On an NVIDIA machine, also check the driver:

nvidia-smi                       # a table with the card's info means the driver is running
sudo ubuntu-drivers autoinstall  # if nvidia-smi fails: install the recommended driver, then reboot
nvidia-smi output with a working driver
Real output (process list shortened). ① The card name is shown · ② A driver version = the NVIDIA driver is running.

Laptops with both Intel and NVIDIA graphics: open NVIDIA X Server Settings → PRIME Profiles → choose NVIDIA (Performance Mode), then log out and back in so Gazebo uses the discrete card.

Common problems

The computer boots straight into Windows, no GRUB menuEnter the BIOS/UEFI setup (usually F2 or Del at power-on), open Boot and move ubuntu above Windows Boot Manager. Some machines move Windows back to the top after a Windows update — repeat this step.
The Windows clock is off by a few hours after using UbuntuThe two systems interpret the hardware clock differently. In Ubuntu run: timedatectl set-local-rtc 1 --adjust-system-clock
The installer does not see the diskThe disk is in Intel RST/RAID mode. Switching to AHCI in the BIOS must follow Microsoft's procedure for Windows, or Windows will not boot — search "switch RAID to AHCI Windows 11" before changing it.
Windows asks for the BitLocker keyEnter the recovery key you saved in step 2. This is BitLocker's normal reaction when the boot configuration changes.

Check yourself

Why is Gazebo usually much slower in a virtual machine than with dual boot on the same computer?

The VM only has a virtual graphics card with limited 3D support and often renders on the CPU (llvmpipe). Gazebo renders the scene and computes gpu_lidar rays on the graphics card, so it falls far below real time. On top of that, CPU and RAM are shared with Windows outside. With dual boot, Ubuntu uses all the real hardware.

How does a simulation running slower than real time affect Nav2 and SLAM?

Sensor data, TF and control commands arrive late and unevenly: SLAM stitches a skewed map, Nav2 reports timeouts or the controller cannot keep up, TF reports extrapolation errors. These are machine problems, not code problems — and telling them apart takes a lot of time.

On the "Installation type" screen, which option keeps Windows?

Install Ubuntu alongside Windows Boot Manager (or Something else, creating a partition only in the free space). Never choose Erase disk and install Ubuntu.

What does OpenGL renderer: llvmpipe from glxinfo -B mean?

Ubuntu is rendering graphics on the CPU, not the real graphics card — usually because the (NVIDIA) driver is missing or the MOK was not enrolled with Secure Boot on. Fix it before running Gazebo.

Installing Ubuntu alongside Windows (dual boot) · Module 0: Setting up the environment — Atlas Robotics