Install Ubuntu on MAC M1 powered by UTM

Jun OKAMURA
4 min readMay 14, 2023

--

Because of no official support on VirtualBox, I decided to use UTM for my M1 Mac.

Preparation:

Mac OSversion;

% sw_vers
ProductName: macOS
ProductVersion: 13.3.1
ProductVersionExtra: (a)
BuildVersion: 22E772610a

Download ARM version Ubuntu iso image from the official site.

Download UTM into Mac M1 from the official site.

Start UTM to install Ubuntu by “Create a New Virtual Machine”.

Select “Virtualize”.

Select “Linux”.

Mount the Ubuntu iso image on CD/DVD device then Start.

Install Ubuntu Server.

Select Language.

Select Option.

Configure Ethernet address.

Check all Disk and Device configurations.

Select option PKGs.

Start installer.

Done.

Once complete the Ubuntu installation close the terminal window then dismount CD/DVD and restart.

Got the terminal screen again.

How to mount the Shared directory

Mount the Shared directory on Mac by writing “VirtFs” capability into /etc/fstab and fixing the file permission error.

$ sudo mkdir /Shared_Directory

# Edit and add the mount point
$ sudo vi /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
/dev/disk/by-id/dm-uuid-LVM-LgTcmbgci0iy5FRG56KuEdy0IDVymzedXRlFgK1glu3wMNA6sxf0pSbGqsQji0yr / ext4 defaults 0 1
# /boot was on /dev/vda2 during curtin installation
/dev/disk/by-uuid/05b539cb-c914-436f-a0c7-db40e560b4d3 /boot ext4 defaults 0 1
# /boot/efi was on /dev/vda1 during curtin installation
/dev/disk/by-uuid/C024-11A7 /boot/efi vfat defaults 0 1
/swap.img none swap sw 0 0
share /Shared_Directory 9p trans=virtio,version=9p2000.L,rw,_netdev,nofail 0 0
# Change file permission
$ sudo chown -R $USER.$USER /Shared_Directory

Increase LVM partition

Since the LVM partition did not extend to the predetermined capacity on UTM settings, the following command needs to fix

$ sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

Install Ubuntu-desktop by apt

$ sudo apt install ubuntu-desktop

$ reboot

Done Enjoy!

--

--