厌倦 VMware,试试更轻量级的虚拟机!
互联网架构师后台回复 2T 有特别礼包
Multipass
安装之后,查看自己安装的版本
$ multipass version
$ multipass find
Image Aliases Version Description
snapcraft:core18 20201111 Snapcraft builder for Core 18
snapcraft:core20 20201111 Snapcraft builder for Core 20
core core16 20200818 Ubuntu Core 16
core18 20200812 Ubuntu Core 18
16.04 xenial 20210128 Ubuntu 16.04 LTS
18.04 bionic 20210129 Ubuntu 18.04 LTS
20.04 focal,lts 20210223 Ubuntu 20.04 LTS
20.10 groovy 20210209 Ubuntu 20.10
appliance:adguard-home 20200812 Ubuntu AdGuard Home Appliance
appliance:mosquitto 20200812 Ubuntu Mosquitto Appliance
appliance:nextcloud 20200812 Ubuntu Nextcloud Appliance
appliance:openhab 20200812 Ubuntu openHAB Home Appliance
appliance:plexmediaserver 20200812 Ubuntu Plex Media Server Appliance
新建一个容器,
$ multipass launch --name dg
Launched: dg
$ multipass exec dg -- lsb_release -d
Description: Ubuntu 18.04.4 LTS
查看虚拟机列表
Name State IPv4 Image
dg Running 192.168.24.5 Ubuntu 18.04 LTS
现在有一台 Ubuntu 18.04 版本的虚拟机在运行,对应的 IP 地址是:192.168.24.5 。
查看虚拟机信息
$ multipass info --all
Name: dg
State: Running
IPv4: 192.168.24.5
Release: Ubuntu 18.04.4 LTS
Image hash: fe3030933742 (Ubuntu 18.04 LTS)
Load: 0.00 0.00 0.00
Disk usage: 1.5G out of 4.7G
Memory usage: 112.1M out of 985.7M
进入虚拟机
$ multipass shell dg
# 暂停
$ multipass stop dg
# 启动
$ multipass start dg
删除/释放虚拟机
# 删除
$ multipass delete dg
# 释放
$ multipass purge dg
配置自动化
$ multipass launch --name ubuntu --cloud-init config.yaml
#cloud-config
runcmd:
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
- sudo apt-get install -y nodejs
- wget https://releases.leanapp.cn/leancloud/lean-cli/releases/download/v0.21.0/lean-cli-x64.deb
- sudo dpkg -i lean-cli-x64.deb
runcmd 可以指定容器首次启动时运行的命令
相关链接
文档:https://multipass.run/docs/
正文结束
1.心态崩了!税前2万4,到手1万4,年终奖扣税方式1月1日起施行~
评论