A (quick) setup for Ubuntu 22.04 VM desktop on ARM64 Mac

with Parallels Desktop

Recently, I started experimenting with ROS2, which requires Ubuntu 22.04. In the newest version of Parallels Desktop, the default Ubuntu installation provided is version 24.04. For ARM machines, you can only download Ubuntu 22.04 as a server version (i.e., without a nice GUI). And the most annoying part is the disk memory management in Parallels Desktop. I installed and uninstalled the VM several times because of that. Therefore, I documented the process of setting up an Ubuntu 22.04 VM desktop, mainly in case I need to reinstall it in the future (hopefully not… 🙃)

Disclaimer: I’m not a Linux expert, so I can only guarantee the following steps work for people who want to install an Ubuntu 22.04 Desktop VM on their ARM64 Mac with Parallels Desktop.

Download and Install Ubuntu Server

  1. Go to the 22.04 release page and download the ISO image.
  2. Create a new VM with the .iso image downloaded in step 1.
  3. Set up the language, username, and choose the packages you need (like docker).
  4. Log in to the ugly commond line system (press enter if you can’t, in most cases it solves the problem), then install the Ubuntu desktop and reboot:
sudo apt update
sudo apt upgrade -y
sudo apt install ubuntu-desktop -y
sudo systemctl set-default graphical.target
sudo reboot

Install Parallels Tools in Ubuntu

Since we didn’t use the default Parallels installation, we need to manually install Parallels Tools to enable copy & paste sharing between Ubuntu and Mac. This requires a purchased license for Parallels Desktop and the tool installed.

  1. Go to CD/DVD section in configurations of the VM
  2. Click choose an image file, in the Finder, go to Application/Parallels Desktop/Resources/Tools, choose the prl-tools-lin-arm.iso (or other image that suit your laptop architecture).
  3. Now in Ubuntu, you will also see the Parallels Tools mounted, click install-gui and wait to reboot.
  4. Now you can share the copy & paste between Mac and Ubuntu.

image

image

Increase Disk Space for Ubuntu

By default, Parallels allocates 64GB of disk space to the root filesystem, which is not enough for most use cases. There is an official tutorial on increasing disk space, but it didn’t work for me. After asking differetn LLMs, here’s what worked:

  1. Shut down the VM and allocate more disk space in the Parallels configuration.
  2. Start the VM and, in the terminal, type:
sudo apt update
sudo apt install cloud-guest-utils
lsblk

Here, you will see the disk partitions, then

  1. Enter sudo fdisk /dev/sda to open fdisk. Then:
    1. Enter n to create a new partition (accept defaults to use free space).
    2. Enter t to change the type of the new partition (e.g., /dev/sda5).
    3. Enter the partition number (e.g., 5).
    4. Enter 30 to set the type as LVM.
    5. Enter w to write changes and exit.
  2. Now allocate space from the new partition to the root filesystem:
sudo partprobe
sudo pvcreate /dev/sda5     # (Assuming the new partition is sda5)
sudo vgextend ubuntu-vg /dev/sda5
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
df -h /

Some Useful Packages/Tools for Ubuntu

VSCode

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
rm microsoft.gpg

sudo sh -c 'echo "deb [arch=arm64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'

sudo apt update
sudo apt install code -y

source ~/.bashrc

code

Firefox

sudo apt install firefox -y
sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /usr/bin/firefox 100

GitHub CLI (gh)

sudo apt install gh
ssh-keygen -t ed25519 -C "your email"
cat ~/.ssh/id_ed25519.pub 
# Go to https://github.com/settings/keys, add your SSH key, and authorize if needed.
gh auth login

git-lfs

sudo apt update
sudo apt install git-lfs
git lfs install

AWS CLI and aws-sso

If you want to use AWS SSO, do not use sudo apt install awscli (it installs v1, which won’t work for aws-sso).

  1. Go to the AWS CLI relsease page and replace the curl link below:
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
ls -l /usr/local/bin/aws
  1. Download the latest aws-sso binary release from the release page, move it to your $PATH (usually /usr/local/bin/), and rename it to aws-sso:
cd ~/Downloads
wget https://github.com/synfinatic/aws-sso-cli/releases/download/v2.0.1/aws-sso-2.0.1-linux-arm64
sudo mv ~/Downloads/aws-sso-2.0.1-linux-arm64 /usr/local/bin/aws-sso
cd /usr/local/bin/
sudo chmod +x aws-sso
  1. Now you can configure AWS with aws configure sso

  2. If you want to configure aws-sso and use aws-sso exec -p later:

mkdir ~/.aws-sso
aws-sso # configure again
nano ~/.aws-sso/config.yaml # change the ProfileFormat as you want

ROS2

Follow every step in the official tutorial.

Licensed under CC BY-NC-SA 4.0
最后更新于 May 21, 2025 15:26 UTC
Built with Hugo
主题 StackJimmy 设计
🎂 已诞生 :
👀 访问量 · 访客数
📝 发表文章 13 · 总字数 44.52k