Ubuntu VMs Made Simple
1 Week - Complete Guide
Launch Ubuntu VMs on Windows, macOS, dan Linux dengan satu command
# Install via snap (recommended)
sudo snap install multipass
# Atau via apt
sudo apt update
sudo apt install multipass
sudo dnf install multipass
sudo yay -S multipass
choco install multipass
winget install Canonical.Multipass
# Install Homebrew jika belum ada
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Multipass
brew install --cask multipass
# Cek versi
multipass --version
# Cek status service
multipass info
# List semua VM
multipass list
# Launch VM dengan default specs
multipass launch
# Launch specific Ubuntu version
multipass launch 22.04
multipass launch 20.04
multipass launch 24.04
# Launch dengan custom specs
multipass launch -c 2 -m 4G -d 20G 22.04
# Start VM
multipass start my-vm
# Stop VM
multipass stop my-vm
# Delete VM
multipass delete my-vm
# Purge (hapus permanen yang sudah di-delete)
multipass purge
# Restart VM
multipass restart my-vm
# Info VM
multipass info my-vm
# Shell ke VM
multipass shell my-vm
# Mount local folder
multipass mount ~/projects my-vm:/home/ubuntu/projects
# -c = CPU cores
# -m = Memory
# -d = Disk size
multipass launch -c 4 -m 8G -d 50G 22.04
# Set CPU
multipass set my-vm.cpus=4
# Set Memory
multipass set my-vm.memory=8G
# Set Disk
multipass set my-vm.disk=50G
| Resource | Default |
|---|---|
| CPU | 1 core |
| Memory | 1GB |
| Disk | 5GB |
# Launch dengan nama custom
multipass launch --name web-server 22.04
multipass launch --name db-server 22.04
# Setiap VM dapat di-start/stop independently
# Buat alias
multipass alias web-server:web
# Menggunakan alias
multipass shell web # equivalent to: multipass shell web-server
# Hapus alias
multipass unalias web
# Mount folder
multipass mount ~/projects my-vm:/home/ubuntu/projects
# Mount dengan read-only
multipass mount -r ~/docs my-vm:/home/ubuntu/docs
# List mounts
multipass list my-vm
# Unmount
multipass umount my-vm:/home/ubuntu/projects
| Mode | Description |
|---|---|
| default | Bridged networking via dnsmasq |
| bridged | Langsung di network host |
| manual | Static IP configuration |
# List networks
multipass networks
# Launch dengan bridged network
multipass launch --network name=br0 22.04
# Set network mode
multipass set my-vm.network.mode=bridged
#cloud-config
users:
- name: ubuntu
primary_group: ubuntu
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa AAAAB3... your-key
packages:
- docker.io
- git
- curl
runcmd:
- sudo systemctl start docker
- sudo usermod -aG docker ubuntu
# Launch VM dengan cloud-init config
multipass launch -c 2 -m 2G 22.04 \
--name dev-vm \
--cloud-init cloud-config.yaml
# View cloud-init logs di VM
multipass exec dev-vm -- cat /var/log/cloud-init.log
# View user data
multipass exec dev-vm -- cat /var/lib/cloud/seed/user-data.cur
# Copy file
multipass transfer my-file.txt my-vm:/home/ubuntu/
# Copy directory
multipass transfer -r ./my-folder my-vm:/home/ubuntu/
# Copy file dari VM
multipass transfer my-vm:/home/ubuntu/result.txt ./
# Copy directory
multipass transfer -r my-vm:/home/ubuntu/data ./
# Jalankan single command
multipass exec my-vm -- uname -a
multipass exec my-vm -- ls -la
multipass exec my-vm -- df -h
# Run sebagai root
multipass exec my-vm -- sudo apt update
# Run sebagai user tertentu
multipass exec my-vm -- su - ubuntu -c "echo hello"
# List available images
multipass find
# Output contoh:
# ubuntu # Latest LTS
# 22.04 # Ubuntu 22.04 LTS
# 20.04 # Ubuntu 20.04 LTS
# 24.04 # Ubuntu 24.04 LTS
# docker # Ubuntu with Docker
# minikube # Ubuntu with Minikube
# Launch daily build
multipass launch daily:24.04
multipass get local.image untuk cek versi.| Issue | Solution |
|---|---|
| VM tidak start | multipass restart my-vm |
| Hypervisor error | Install VirtualBox atau enable Hyper-V |
| Disk penuh | multipass delete + purge |
| Permission denied | Jalankan sebagai admin |
# Enable debug logging
multipass set local.verbosity=debug
# View logs
multipass list -v
# Restart daemon
sudo systemctl restart multipass
# Tab completion (bash/zsh)
source /snap/multipass/current/completion.bash
# Export VM
multipass export my-vm my-vm.img
# Import VM
multipass import my-vm.img
Next Steps
1. Install Multipass di komputer Anda
2. Coba: multipass launch → multipass shell
3. Eksperimen dengan cloud-init
4. Build development environment
Apa itu Multipass?
Command apa untuk buat VM dengan Multipass?
Berapa default CPU untuk Multipass VM?