Skip to content

Multipass


snap install multipass
multipass find

multipass launch -c 2 -m 2G -d 20G -n ostechnix-instance
multipass info ostechnix-instance
multipass stop ostechnix-instance
multipass delete ostechnix-instance
multipass purge
# The size can be specified with suffix K (for KB), M (for MB), G (for GB).

#     Minimum number of allowed CPUs: 1
#     Minimum allowed Hard disk size: 512 MB
#     Minimum allowed Memory size: 128 MB

multipass launch --cpus 2 --mem 4G -d 20G --name ubuntu 20.04
multipass launch --cpus 4 --mem 8G --name ubuntu 20.04
multipass shell ubuntu

multipass stop ubuntu 
sleep 1
systemctl stop snap.multipass.multipassd.service
# https://www.convertunits.com/from/GB/to/byte
# https://www.atpeaz.com/change-multipass-instance-memory-and-cpu-allocation-after-launch/
vi /var/snap/multipass/common/data/multipassd/multipassd-vm-instances.json
# https://github.com/canonical/multipass/issues/1158
qemu-img resize /var/snap/multipass/common/data/multipassd/vault/instances/ubuntu/ubuntu-20.04-server-cloudimg-amd64.img +10G

systemctl start snap.multipass.multipassd.service
sleep 5
multipass start ubuntu 
sleep 1
multipass shell ubuntu

sudo apt update
sudo apt install -y wget


# https://www.cloudqubes.com/hands-on/linux/happy-virtualizing-with-multipass/
multipass mount /home/cloudqubes/data devstack:/home/ubuntu/devstack_data

# Unmounting is also easy.

multipass unmount cloudqubes
multipass launch 20.04 -n ubuntu20 -c 20 -m 10G -d 20G
multipass shell ubuntuC8M8D20
sudo ssh-copy-id -i /var/snap/multipass/common/data/multipassd/ssh-keys/id_rsa ubuntu@10.35.64.152
sudo cat /root/.ssh/id_rsa.pub | ssh -i /var/snap/multipass/common/data/multipassd/ssh-keys/id_rsa ubuntu@10.35.64.152 'cat >> .ssh/authorized_keys'
cat $HOME/.ssh/id_rsa.pub | ssh -i /var/snap/multipass/common/data/multipassd/ssh-keys/id_rsa ubuntu@10.35.64.152 'cat >> .ssh/authorized_keys'
ssh -i /var/snap/multipass/common/data/multipassd/ssh-keys/id_rsa ubuntu@10.35.64.152
ssh -L 192.168.9.242:1234:10.35.64.152:1234 -N 127.0.0.1
https://multipass.run/

https://github.com/canonical/multipass
#Linux
sudo snap install multipass --classic
sudo snap install multipass --classic --stable
sudo snap remove multipass
multipass --version
multipass  1.2.0
multipassd 1.2.0

#Mac
# Note, this may require you to enter your password for some sudo operations during install
brew cask install multipass
history |cut -c8- 
multipass list
multipass delete ubuntuC8M8D20
multipass delete primary
multipass list
multipass purge
multipass list
multipass help
multipass find
Image                   Aliases           Version          Description
snapcraft:core          core16            20200506         Snapcraft builder for Core 16
snapcraft:core18                          20200506         Snapcraft builder for Core 18
core                    core16            20200213         Ubuntu Core 16
core18                                    20200210         Ubuntu Core 18
16.04                   xenial            20200430         Ubuntu 16.04 LTS
18.04                   bionic,lts        20200506         Ubuntu 18.04 LTS
19.10                   eoan              20200429         Ubuntu 19.10
20.04                   focal             20200504         Ubuntu 20.04 LTS
daily:20.10             devel,groovy      20200514         Ubuntu 20.10
multipass launch daily:20.04 -n ubuntu20 -c 20 -m 100G -d 1000G
multipass launch 20.04 -n ubuntu20 -c 20 -m 100G -d 1000G
multipass shell ubuntu20
nproc 
free -h
sudo apt update
sudo apt upgrade
multipass mount $HOME ubuntu20

multipass launch 20.04 -n ubuntu20 -c 20 -m 100G -d 1000G
multipass mount $HOME ubuntu20 
multipass shell ubuntu20 

multipass launch 18.04 -n ubuntu18 -c 20 -m 100G -d 1000G
multipass mount $HOME ubuntu18 
multipass shell ubuntu18 

multipass launch 16.04 -n ubuntu16 -c 20 -m 100G -d 1000G
multipass mount $HOME ubuntu16 
multipass shell ubuntu16 
Published inLinux

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *