https://www.theroboticsspace.com/blog/How-To-Install-ROS-2-in-Ubuntu-22-04-On-M1-Mac/
How To Install ROS 2 in Ubuntu 22.04 On M1/M2 Mac
Table of Contents
The first step is more of a reminder. The Macbooks with M1/M2 Chip are ARM-based platforms compared to older MacBooks and Windows which are AMD/Intel x86-based platforms. Different virtual desktops are available like Parallels Desktop, Oracle’s Virtual Box, and UTM each having its pros and cons.
In this guide, we will use free UTM virtualization software. UTM allows Ubuntu to run with OpenGL, Hardware acceleration providing a highly efficient with near-native speed performance.
Prerequisites
- MacOS 13 or later
- 50GB of free space
1. Install UTM
Go to GetUTM and click the Download button. A UTM.dmg
file will start downloading.
Once the download is complete, double click on the UTM.dmg
file to open it. Drag the UTM icon to the Applications folder.
2. Download Ubuntu 22.04
Go to Ubuntu releases and download the latest Ubuntu 22.04 image for ARMv8/AArch64 architecture.
3. Create a new virtual machine
Open UTM and click on the + icon to create a new virtual machine.
4. Configure the virtual machine
Use Virtualize to simulate the virtual machine with arm64 CPU architecture.
Select Linux as the Guest OS and then the .iso file downloaded for Ubuntu 22.04.
Continue with the default settings for CPU, RAM, Storage, and Network.
5. Install Ubuntu 22.04
Click on the Play button to start the virtual machine. Then in the next screen, select Try or Install Ubuntu.
Install Ubuntu following the on-screen instructions.
Eject the Ubuntu 22.04 iso file from the virtual machine.
Restart the virtual machine and login with your user account.
Since the available version of Ubuntu is for servers, you need to run the following commands to install the desktop environment:
sudo apt update
sudo apt install ubuntu-desktop-minimal
You have successfully installed Ubuntu 22.04 on your M1/M2 Mac.