Logo

dev-resources.site

for different kinds of informations.

Run an Ubuntu VM on Apple Silicon

Published at
1/25/2023
Categories
linux
apple
ubuntu
arm64
Author
santisbon
Categories
4 categories in total
linux
open
apple
open
ubuntu
open
arm64
open
Author
9 person written this
santisbon
open
Run an Ubuntu VM on Apple Silicon

VirtualBox does not support ARM-based architectures like the Apple silicon on these Macs yet so we'll need another option. Multipass from Canonical can launch and run virtual machines (instances) and configure them with cloud-init like a public cloud. In fact it's my preferred way to launch Ubuntu instances regardless of whether VirtualBox is available for my system.

Get it with Homebrew:

brew install multipass
Enter fullscreen mode Exit fullscreen mode

See the list of images available:

multipass find
Enter fullscreen mode Exit fullscreen mode

Useful commands when managing instances.
multipass help
multipass list
multipass start
multipass restart
multipass mount /Volumes/USB primary
multipass stop
multipass delete --all
multipass purge
Enter fullscreen mode Exit fullscreen mode

We will:

  • Create an instance from the Ubuntu 22.04 LTS (Jammy Jellyfish) image.
  • Specify the number of CPUs, disk space, and amount of memory to allocate.
  • Give it a name. If the name is primary the user's home directory is mounted inside the newly launched instance, in Home. Without any arguments, commands for managing instances will apply to the primary instance.
  • Install a desktop environment and a Remote Desktop server.

Launch the instance

You can do this with cloud-init or without it (manual configuration).

With cloud-init

Create a configuration file. It will update/upgrade the system, install the packages we need, and create a new user (cloudy) with a password for us to log in with Remote Desktop. This example uses a plain text password for simplicity but adjust it to your environment's security needs.

cat << EOF > cloud-config.yaml
package_upgrade: true
packages:
  - ubuntu-desktop
  - xrdp
  - xsel
users:
  - default
  - name: cloudy
    sudo: ALL=(ALL) NOPASSWD:ALL
    shell: /bin/bash
    lock_passwd: false
    plain_text_passwd: 'supersecretpwd'
EOF
Enter fullscreen mode Exit fullscreen mode

Launch the instance using the configuration file we created:

multipass launch jammy --cloud-init cloud-config.yaml --name primary --cpus 4 --disk 15G --memory 8G
Enter fullscreen mode Exit fullscreen mode

Without cloud-init

You could also configure the instance manually instead. In this case we don't need to create a new user, we'll just manually set a password for the default user and use that one.

multipass launch lts --name primary --cpus 4 --disk 15G --memory 8G
Enter fullscreen mode Exit fullscreen mode

Connect to the instance to install a desktop environment and a Remote Desktop server.

multipass shell
Enter fullscreen mode Exit fullscreen mode
sudo apt update && sudo apt upgrade -y
sudo apt install ubuntu-desktop xrdp -y
Enter fullscreen mode Exit fullscreen mode

Set a password for the default ubuntu OS user.

sudo passwd ubuntu
Enter fullscreen mode Exit fullscreen mode

Access the instance's desktop

To access the newly-installed desktop we need the IP address of the instance. Find it either by running the ip addr command within the Ubuntu shell or by running multipass list on your Mac host.

Then use that IP address to connect with an RDP client like Microsoft Remote Desktop (available on the App Store). You can use the default user ubuntu if you manually set its password or the user cloud-init created with the password you specified.

arm64 Article's
30 articles in total
Favicon
What I learned about the "best price" in retail and how it applies to AI
Favicon
Five Months in the making, multi-architecture builder
Favicon
GKE multi-arch guide
Favicon
Building Multi-Arch Images for Arm and x86
Favicon
Running Redis on Ampere Processors- getting better performance by moving from a legacy architecture
Favicon
Ampere Server Tuning Guides
Favicon
How Vandebron helps balancing the Dutch energy grid together with OnLogic & Talos Linux
Favicon
FOSSY '23 CfP Open
Favicon
Ship It on ARM64! Or Is It AARCH64?
Favicon
Run an Ubuntu VM on Apple Silicon
Favicon
Teamwork makes the dream work for this multi-architecture builder.
Favicon
Cloud Native Buildpack for ARM64 and AMD64
Favicon
A new builder for Spring Boot 3 RC1 on ARM64
Favicon
Deploying ARM64 workloads to AKS
Favicon
Building an arm64 container for Apache Druid for your Apple Silicon
Favicon
How to Read Multiple Barcode and QR Code with Dynamsoft Java Barcode SDK
Favicon
Create docker image on your new MacBook Pro M1 version
Favicon
Install Elm for Linux arm64
Favicon
MongoDB for arm64 at Alibaba Cloud
Favicon
Rodando projetos x86_64 no Mac M1 (arm64) com UTM
Favicon
12th weekly post, empty string is everywhere. Also, AWS Lambda goes Arm.
Favicon
Installing K8 on ARM64 [4 cpu, 24Gb RAM]
Favicon
Install mongodb 4.4 to arm64 amazon Linux 2
Favicon
Converting dev environments to Apple Silicon
Favicon
Running Vagrant on an M1 Apple Silicon using Docker
Favicon
M1 기반 Mac에서 안드로이드 에뮬레이터 사용하기
Favicon
Check which apps on your Mac don't support Arm64
Favicon
Homebrew M1 (ARM64)
Favicon
FusionAuth on Arm64
Favicon
Running OpenFaaS and MongoDB on Raspbian 64bit

Featured ones: