UTM - Run Ubuntu Virtual Machine on Mac
This blog is a step by step guide on how to run a Ubuntu (Linux) Virtual Machine on MacOS using UTM (Open Source Virtual Machine Tool). Also the settings needed to share Clipboard and Directory between Ubuntu and MacOS.
Download UTM
Download Ubuntu ISO file
Download Intel or AMD 64-bit architecture Ubuntu LTS iso file from
Create Ubuntu Virtual Machine
- Open UTM
- File Menu -> New
- Select Virtualize
- Select Linux
- Set Memory as 12288 MiB
- Set CPU Cores as 3 or higher
- Check Enable display output
- Uncheck Enable hardware OpenGL acceleration
- Click Continue
- Uncheck Use Apple Virtualization
- Select Boot Image Type as Boot from ISO image
- Click Browse and select the download Ubuntu LTS iso image
- Click Continue
- Set size of the drive as 64 GiB or higher
- Click Continue
- Do not set any shared directory at this point, we will setup the shared directory once Ubuntu installation is completed. Skip this step for now and click Continue
- In Summary, set Name as Ubuntu-Linux
Install Ubuntu
- Click the Play button next to Ubuntu-Linux to begin installation
- Using Keyboard, select Try or Install Ubuntu option and press Enter key
- Choose Language as English and click Next
- Skip Accessibility and click Next
- Select keyboard layout as English (UK) or English (US) or Indian and click Next
- For Internet, select Use wired connection
- Skip Update and click Next
- Select Install Ubuntu and click Next
- Select Interactive Install and click Next
- Select Extended selection and click Next
- Check Install third party software
- Check Install support for additional media formats
- Click Next
- Select Erase disk and install Ubuntu
- Click Next
- Set Your Name as ubuntu
- Set Computer Name as ubuntu-utm
- Set Your username as ubuntu
- Type password and confirm password
- Check Require my password to log in
- Uncheck use active directory
- Click Next
- Select your timezone and Click Next
- Click Install
- Once installation is complete, click Restart now
- When you see the message 'Please remove the installation medium', click 'Drive image options' icon on the top right corner, then hover on 'CD/DVD' and select 'Eject'. And then press Enter key
- Now the installation is complete and wait for the restart
Change Ubuntu Settings
The following settings or changes are optional, but doing it makes the experience with Ubuntu smoother
- Show Apps -> Settings -> Mouse & Touchpad:
- Uncheck Mouse Acceleration
- Set Scroll Direction as Natural
- Show Apps -> Settings -> System -> Date & Time -> Clock & Calendar:
- Check Seconds
- Show Apps -> Settings -> Ubuntu Desktop
- Uncheck Show Home Folder
- In Dock -> Show on, select All displays
Clipboard and Directory Sharing
The following settings or changes are very important to enable clipboard and directory sharing between Ubuntu and MacOS
- Show Apps -> Terminal and execute sudo apt install spice-vdagent spice-webdavd
- After installing the packages Power Off Ubuntu Machine
- In the UTM app, right click Ubuntu-Linux and select Edit
- Go to sharing secting
- Tick Enable clipboard sharing
- Set Directory Share Mode as 'SPICE WebDAV'
- Click Browse and choose any directory (eg Downloads) on MacOS
- Untick Read Only
- Click Save
- Start Ubuntu-Linux
Access the shared directory in browser at http://127.0.0.1:9843/
Or by executing the command in terminal
firefox http://127.0.0.1:9843/
Connect the shared directory in Files explorer
Files -> + Other Locations -> Click Enter server address (input box at the bottom) and type
dav//127.0.0.1:9843
Click Connect
Access the shared directory in Terminal by navigating to
cd /run/user/$UID/gvfs/dav:host=127.0.0.1,port=9843,ssl=false
Access the shared directory in Filex explored by running the command
open /run/user/$UID/gvfs/dav:host=127.0.0.1,port=9843,ssl=false
Adding multiple displays
Perform the following steps to add additional displays (monitor) for Ubuntu
- In the UTM app, right click Ubuntu-Linux and select Edit
- Click + New option and select Display
- Click the newly created Display section
- Select Emulated Display Card as virtio-gpu-pci
- Tick Resize display to window size automatically
- Click Save
- Restart the Ubuntu-Linux vm to see the addtional display (monitor)
Comments
Post a Comment