什么是Multipass?
Multipass 是一个轻量级 VM 管理器,支持 Linux、Windows 与 macOS,这是为希望使用单个命令提供全新 Ubuntu 环境的开发人员而设计的。
- 查看multipass版本
multipass version
...
multipass 1.8.0+win
multipassd 1.8.0+win
- 查看列表
multipass list
- 启动一个默认实例
multipass launch lts --name master --memory 4G --disk 60G --cpus 2
- 启动和停止
# 启动
multipass start master
# 停止
multipass stop master
# 重启
multipass restart master
- 进入容器
multipass shell master
- 设置root密码
sudo passwd
- 外部连接,修改配置文件
vim /etc/ssh/sshd_config
# sshd_config
#开启登录
PermitRootLogin yes
# 开启使用密码登录
PasswordAuthentication yes
# 重启
/etc/init.d/ssh restart
- 删除实例
multipass delete master
- 清除缓存实例
multipass purge
更多命令使用
multipass --help
更新内容:扩容缩容命令
连接:https://multipass.run/docs/modify-an-instance#heading--set-the-cpu-ram-or-disk-of-an-instance
设置
multipass stop handsome-ling
multipass set local.handsome-ling.cpus=4
multipass set local.handsome-ling.disk=60G
multipass set local.handsome-ling.memory=7G
获取
multipass get local.handsome-ling.cpus
4
multipass get local.handsome-ling.disk
60.0GiB
multipass get local.handsome-ling.memory
7.0GiB
评论区