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:
| Problem | In a virtual machine | Effect on the lessons |
|---|---|---|
| Graphics | The 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. |
| Speed | Gazebo 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, CPU | Shared with the Windows system running outside. | Gazebo + RViz + Nav2 run short of resources and the machine freezes easily. |
| Network | By 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. |
| USB | Each 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
msinfo32and look at the BIOS Mode line. Almost all recent computers use UEFI — this lesson is written for 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.

① 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
- Right-click the Start button → Disk Management.
- Right-click drive C: (or the drive with the most free space) → Shrink Volume.

① Right-click the C: block in the disk bar at the bottom · ② Shrink Volume... - Enter the amount to free up in MB: 100 GB =
102400→ Shrink.
① Enter the amount in MB (102400 = 100 GB) · ② Shrink. - When an Unallocated area (shown in black) appears, you are done. Do not create a partition in it — leave it empty for Ubuntu.

① 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
- Download Ubuntu 22.04 LTS Desktop (the
.isofile) from the official pagereleases.ubuntu.com/22.04. It must be 22.04 — ROS 2 Humble only officially supports this release. - Download Rufus (rufus.ie) or balenaEtcher.
- 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).

① Pick the right USB drive · ② SELECT the Ubuntu 22.04 ISO · ③ GPT + UEFI (non CSM) · ④ START. Leave the other fields at their defaults. 
① 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:
| Manufacturer | Boot menu key (common) |
|---|---|
| Dell, Lenovo, Acer | F12 (some Lenovo models use a small Novo button on the side) |
| HP | F9 (or Esc, then choose) |
| ASUS | F8 or Esc |
| MSI | F11 |
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.


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

6. Install Ubuntu
- Choose a language (English is recommended — error messages are easier to look up) → Install Ubuntu.

① Language English · ② Install Ubuntu. - Keyboard: English (US).
- Connect to Wi-Fi. Choose Normal installation and tick Install third-party software for graphics and Wi-Fi hardware (graphics and Wi-Fi drivers).

① 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. - 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).
- 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.
① Install Ubuntu alongside Windows Boot Manager → Continue · ② Something else only if option ① is missing · ✕ Never choose Erase disk — it wipes Windows. 
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. - 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.

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.

① 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.

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

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
timedatectl set-local-rtc 1 --adjust-system-clockCheck 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.