Last active
January 15, 2022 21:56
-
-
Save chris-kobrzak/17a337618cc091d51f7f4e2250fa1c8a to your computer and use it in GitHub Desktop.
Basic Multipass commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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