How to Run an Ubuntu VM on a Mac (M1 to M5)
Run Ubuntu 26.04 or 24.04 arm64 in a VM on an Apple silicon Mac: a server ready in a minute with SSH, or the full desktop, plus clipboard and shared folders.
GuideUpdated 10 min read
On this page
The fastest way to run an Ubuntu VM on an Apple silicon Mac is a cloud image that sets itself up. In Hermitbox, our virtual machine app, choose File ▸ New VM… (⌘N, Command-N), pick Linux, select Ubuntu Server 26.04 LTS under Ready in a Minute, and click Create. The VM starts with your user account and SSH access already set up.
For the full Ubuntu desktop, pick Ubuntu Desktop (26.04.1 LTS or 24.04.5 LTS) from the installer gallery, run Ubuntu's installer, and click Eject and Start when Hermitbox asks. The rest of this page covers what most guides skip: why the VM stops after installing, getting copy and paste to work, mounting a Mac folder at /mnt/mac, and connecting over SSH or VS Code.
Which Ubuntu should you run in a VM on an Apple silicon Mac?
Apple silicon Macs (M1 and later) run arm64 virtual machines, so you need the arm64 build of Ubuntu. The amd64 ISO that Ubuntu's download page usually offers is built for Intel and AMD processors and won't boot in an Apple silicon VM. Hermitbox's gallery only lists arm64 images, so picking from it avoids this mistake.
What Hermitbox offers for Ubuntu, as of November 2026:
| Method | Ubuntu versions | What you get | How you log in | Pick it if |
|---|---|---|---|---|
| Ready in a Minute | Ubuntu Server 26.04 LTS | No installer. User, SSH keys, time zone, clipboard agent and shared-folder mount are set up on first start. Optional desktop. | SSH with your Mac's key, or the password you set | You want a server or a test machine quickly |
| Ubuntu Desktop ISO | 26.04.1 LTS, 24.04.5 LTS | The standard Ubuntu desktop, installed with Ubuntu's own installer | The account you create in the installer | You want the stock desktop, or 24.04 with a desktop |
| Ubuntu Server ISO | 26.04.1 LTS, 24.04.5 LTS | A standard server install with Ubuntu's text installer | The account you create in the installer | You need Server 24.04, or want to choose your own partitioning |
Both versions are LTS releases. Choose 24.04 if you're matching a production server or a tool that hasn't been tested on 26.04 yet. Otherwise take 26.04, the newer of the two.
Before you start: you need an Apple silicon Mac with macOS 14 Sonoma or later, and enough free space. A Linux VM needs at least 16 GB of disk, and Hermitbox recommends 32 GB. The disk is sparse, so it only takes space on your Mac as Ubuntu fills it.
macOS has no built-in app for running Linux VMs. If you'd rather use a free app, UTM is free as of November 2026 and also runs Linux VMs. The steps below use Hermitbox.
The quick way: Ubuntu Server ready in a minute
This method uses Ubuntu's arm64 cloud image. Hermitbox verifies the download against Ubuntu's checksum and grows its disk to the size you pick. It then builds a small setup disc on your Mac that configures Ubuntu on its first start. No installer runs, and no outside service is involved in the setup.
- In Hermitbox, choose File ▸ New VM… (⌘N), or click + in the toolbar.
- Select the Linux card and click Continue.
- Under Ready in a Minute, select Ubuntu Server 26.04 LTS and click Continue.
- On Name and Size, enter a Name and check the Cores, Memory and Disk sliders. The recommended values (2 cores, 4 GB, 32 GB) are scaled down if your Mac is smaller.
- Check User. It defaults to your Mac's short user name.
- Set a Password. If you have SSH keys in
~/.ssh(files namedid_*.pub), the password is optional. Otherwise it's required. - Make sure Allow SSH with this Mac's key(s) is on if you want to SSH in without a password.
- Optionally turn on Add a desktop. The desktop installs on the first start, which then takes a few minutes longer. Hermitbox raises the memory when you turn it on.
- Click Create. When the box on the shelf is ready, double-click it to start it.


On first start, the setup disc creates your user with sudo rights and adds your SSH keys. It also sets the time zone, installs spice-vdagent for clipboard sharing, adds a /mnt/mac entry for shared folders, and sets up Rosetta if it's on. Your password is stored only as a SHA-512 hash on the setup disc, never as plain text.
Set a password if you want to log in from the VM's own window. With keys only, you log in over SSH.
If this is your first VM, the welcome sheet has an Or Get Linux Ready in a Minute button. It opens the same sheet with Ubuntu Server already selected.
The full desktop: install Ubuntu Desktop from the ISO
These steps are the same on an M1 Mac and on later chips.
- Choose File ▸ New VM… (⌘N), select Linux, and click Continue.
- Under Installers, select the Ubuntu Desktop card and choose 26.04.1 LTS or 24.04.5 LTS from its version menu. Click Continue.
- On Name and Size, set the name, cores, memory and disk. A desktop is more comfortable with extra memory if your Mac has it to spare.
- Optionally open Advanced to set Display (Fit to This Mac or a fixed resolution), Sound output, and Run Intel (x86-64) Linux programs with Rosetta.
- Click Create. Hermitbox downloads the ISO and checks it against Ubuntu's published checksum list. If the download is interrupted, it picks up where it stopped.
- When the download is done, start the VM if it isn't already running. It boots from the installer. Click inside the window to give it the keyboard, then follow Ubuntu's installer.
- When the installer asks how to install, erasing the disk is safe. The only disk it sees is the VM's own disk image, not your Mac's drive.
- When the installer finishes and restarts, the VM stops. Hermitbox asks Finished Installing? Click Eject and Start.
For Ubuntu Server from the ISO, follow the same steps with the Ubuntu Server card. Turn on the installer's OpenSSH server option so you can SSH in afterwards.
While the VM has your keyboard, ⌘ shortcuts and ⌘Tab (Command-Tab) go to Ubuntu. To give the keyboard back to your Mac, press and release ⌃⌥ (Control-Option) with no other key.
Downloaded ISOs stay in Hermitbox's cache (~/Library/Caches/Hermitbox/Images), so a second Ubuntu VM from the same version doesn't download it again. To free the space, click Downloads in the sidebar, then Remove Unused….
Why does the VM stop after installing?
Apple's Virtualization framework turns a restart from inside a Linux guest into a stop. Ubuntu's installer restarts at the end of setup, so the VM stops instead of rebooting.
Hermitbox notices that the VM stopped with the installer still attached and asks Finished Installing? You get three choices:
- Eject and Start: removes the installer disc and starts Ubuntu from its own disk. Choose this after a normal install.
- Start Installer Again: keeps the disc and boots the installer. Use this if setup failed or you quit it early.
- Not Now: leaves the VM stopped with the installer attached. Eject it from the VM window's toolbar before the next start, or you'll boot back into the installer.
This also happens after installation. Whenever Ubuntu restarts itself, for example after updates, the VM stops. Start it again from the shelf or with ⌘R. Nothing is wrong with the VM.
How do you get copy and paste working?
Clipboard sharing with a Linux VM needs spice-vdagent inside Ubuntu, and the VM's clipboard switch turned on. The switch is on by default for new Linux VMs.
- Ready in a Minute VMs get
spice-vdagentduring setup. If you added a desktop, copy and paste works once you're logged in. - Ubuntu Desktop from the ISO: most desktop installs include
spice-vdagentalready. - Ubuntu Server without a desktop has no graphical clipboard to share. Copying and pasting is easiest in a Terminal session over SSH (see below).
If pasting between your Mac and Ubuntu doesn't work:
Check the switch: in the VM window, click Sharing and make sure Clipboard is on. The same setting is in the inspector under Linux ▸ Clipboard sharing.
If
spice-vdagentis missing, open Set Up in Linux in the inspector's Linux section to see the install command. On Ubuntu it's:bash sudo apt install spice-vdagentThis installs the guest agent that carries the clipboard between Ubuntu and your Mac. To undo it, run
sudo apt remove spice-vdagent.Shut down the VM and start it again. Clipboard changes take effect at the next start.
There's one trade-off. On some macOS versions, a Linux VM with clipboard sharing on can't be suspended, and the Suspend tooltip tells you so. Turn sharing off, or use Shut Down instead. For more fixes, see Copy and Paste Not Working in a Mac VM.
How do you mount a Mac folder in Ubuntu?
Hermitbox shares Mac folders over virtio-fs. Every shared folder appears inside Ubuntu under /mnt/mac.
- Select the VM and open Shared Folders in the inspector, or click Sharing in the VM window.
- Click Add Folder… and choose a folder. You can also drag folders from Finder onto the list.
- Tick Read only if Ubuntu shouldn't be able to change the files.
If the VM is running and started with at least one shared folder, new folders appear right away. If it started with none, they appear after the next start.
Ready in a Minute VMs already have the mount set up, so your folders appear under /mnt/mac.
ISO installs need a mount command. To mount now, until the next shutdown:
sudo mkdir -p /mnt/mac && sudo mount -t virtiofs hermitbox /mnt/macThis creates the /mnt/mac folder and mounts the Mac share there.
To mount it at every start, run the command above first (it creates the folder), then add one line to /etc/fstab. Run this once, not twice:
echo 'hermitbox /mnt/mac virtiofs rw,nofail 0 0' | sudo tee -a /etc/fstabThe nofail option lets Ubuntu boot normally even when no folder is shared. To undo, open the file with sudo nano /etc/fstab and delete that line. Hermitbox also shows both commands, ready to copy, under Mount in Linux in the shared folders section.


How do you SSH in from Terminal or VS Code?
Every VM is on a private network shared with your Mac (NAT). Your Mac reaches Ubuntu by its IP address, with no port forwarding.
- Start the VM and select it in the library.
- In the inspector, open Connect. The IP Address row shows "Waiting for an address…" until Ubuntu has one, then offers Copy IP Address.
- Check SSH User. It defaults to your Mac's user name, which matches Ready in a Minute VMs. For an ISO install, enter the account you created in the installer.
- Open the Open SSH menu and choose Open in Terminal, Open in iTerm (if installed), Open in VS Code, or Copy SSH Command.
Open in VS Code opens a Remote-SSH link, so VS Code needs its Remote-SSH extension.
Ubuntu Desktop doesn't include an SSH server by default. Install one inside the VM first:
sudo apt install openssh-serverThis installs and starts the SSH server so your Mac can connect. To undo it, run sudo apt remove openssh-server.
You can also use Hermitbox's command-line tool. Install it in Hermitbox ▸ Settings ▸ Advanced ▸ Command line tool (with the default location, make sure ~/.local/bin is in your PATH), then run:
hermitbox ssh ubuntuThis connects to the VM named "Ubuntu". The name isn't case-sensitive, and a unique start of the name is enough. Use hermitbox ssh user@ubuntu to log in as a different account, or hermitbox ip ubuntu to print just the address. The menu bar menu also has Copy IP Address for each running VM.
If it doesn't work
- "Download Didn't Match": the ISO didn't match Ubuntu's checksum, so Hermitbox deleted it. Try again to download a fresh copy.
- "Download Interrupted": check your connection. The download picks up where it stopped.
- An ISO you chose with Other ISO File… won't boot: it's probably the amd64 build. Use an arm64 ISO, or pick Ubuntu from the gallery.
- The installer runs again after setup: the installer disc is still attached. Shut down, eject it from the VM window's toolbar, and start again.
- The VM stops when you restart Ubuntu: this is expected (see above). Start it again.
- You can't log in to a Ready in a Minute VM in its window: you created it without a password. Connect over SSH with your Mac's key, then set one with
passwd. - "No IP Address Yet": Ubuntu hasn't received an address. Wait a few seconds and try again.
/mnt/macis empty: the VM started with no shared folders. Shut it down and start it again after adding a folder, or run the mount command on an ISO install.- Suspend is grayed out: hover over it for the reason. With clipboard sharing or Rosetta on, some macOS versions can't save the VM's state. Turn that option off or use Shut Down.
The Hermitbox troubleshooting page lists every message the app can show.
FAQ
Can I run Intel (x86-64) Linux programs in the Ubuntu VM? Yes, with Rosetta. It's on by default for new Linux VMs when Rosetta is installed on your Mac, and Ready in a Minute VMs are set up for it automatically. ISO installs need a few commands, covered in Run x86-64 Linux Programs with Rosetta.
How do I protect the VM before a big upgrade? Take a snapshot with ⇧⌘S (Shift-Command-S). On an APFS disk it's instant and takes no space until the VM changes. Restore it from the inspector's Snapshots tab. See snapshots, clones and throwaway runs.
Can I make the VM's disk bigger later? Yes. Shut it down, raise Disk in VM Settings ▸ Hardware, then extend the partition inside Ubuntu to use the new space. Disks can only grow, not shrink.
Does this work on an Intel Mac? This guide covers Apple silicon. Every Ubuntu image in Hermitbox's gallery and Ready in a Minute list is arm64.
For other distributions, see How to Run Linux on a Mac. For every Ready in a Minute field, see the Linux in a minute docs. Hermitbox is part of MacSuite, and you can try it free for 7 days.