Skip to content

Instantly share code, notes, and snippets.

@chris-kobrzak
Last active January 15, 2022 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-kobrzak/17a337618cc091d51f7f4e2250fa1c8a to your computer and use it in GitHub Desktop.
Save chris-kobrzak/17a337618cc091d51f7f4e2250fa1c8a to your computer and use it in GitHub Desktop.
Basic Multipass commands
sudo multipass set local.driver=virtualbox # errors on my work laptop
# Default driver
sudo multipass set local.driver=hyperkit
# Create a VM
multipass launch --name ubuntu2004
# Create a VM with custom parameters
multipass launch \
--cpus 3 \
--disk 15G \
--mem 5G \
--name ubuntu
# Open Shell session
multipass shell ubuntu2004
# List all instances
multipass list
# Drop a VM
multipass delete <name>
# In case of issues with network access
# Add a public Google DNS IP to /etc/systemd/resolved.conf
# Install Docker
# https://docs.docker.com/engine/install/ubuntu/
# Add the ubuntu user to the docker group to access Docker without superuser permissions
sudo usermod -aG docker ubuntu
# Use Docker as if it was running locally
alias docker='multipass exec ubuntu2004 -- docker'
# E.g. access Postgres running inside of a Multipass VM:
docker exec -it postgres-test psql -U postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment