Multipass 是 Ubuntu 推出的一个跨平台的虚拟机管理工具,支持:Windows, macOS 和 Linux 操作系统。

官方网站: Multipass orchestrates virtual Ubuntu instancesMultipass is a CLI to launch and manage VMs on Windows, Mac and Linux that simulates a cloud environment with support for cloud-init. Get Ubuntu on-demand with clean integration to your IDE and version control on your native platform.https://multipass.run/

在 Windows 平台上,底层依赖 Hyper-V 提供的虚拟化环境。

本次尝鲜在 Windows 10 操作系统上进行。

下载安装包: multipass-1.8.0+win-win64.exe  ( 21M 大小 )

安装完成后,显示如下文件:

PS X:\...\Multipass\bin> dir


    Directory: X:\xxx\Multipass\bin



Mode                 LastWriteTime         Length Name

----                 -------------         ------ ----

d-----         6/12/2021  12:02 PM                platforms

-a----        18/10/2021   9:35 PM         316816 concrt140.dll

-a----        26/10/2021  12:38 AM        1199296 dbghelp.dll

-a----        26/03/2021   5:34 AM        3410432 libcrypto-1_1-x64.dll

-a----        26/10/2021  12:38 AM          86528 libgcc_s_sjlj-1.dll

-a----        26/10/2021  12:38 AM        2584872 libglib-2.0-0.dll

-a----        26/10/2021  12:38 AM          79707 libgthread-2.0-0.dll

-a----        26/10/2021  12:38 AM        1475928 libiconv-2.dll

-a----        26/10/2021  12:38 AM         464017 libintl-8.dll

-a----        26/03/2021   5:34 AM         683008 libssl-1_1-x64.dll

-a----        26/10/2021  12:38 AM          18944 libssp-0.dll

-a----        18/10/2021   9:35 PM         565648 msvcp140.dll

-a----        18/10/2021   9:35 PM          23952 msvcp140_1.dll

-a----        18/10/2021   9:35 PM         185720 msvcp140_2.dll

-a----        18/10/2021   9:35 PM          56208 msvcp140_atomic_wait.dll

-a----        18/10/2021   9:35 PM          20368 msvcp140_codecvt_ids.dll

-a----        26/10/2021  12:29 AM       12233728 multipass.exe

-a----        26/10/2021  12:29 AM       12237312 multipass.gui.exe

-a----        26/10/2021  12:29 AM       12897792 multipassd.exe

-a----        25/10/2021  11:59 PM          18886 multipass_wt.ico

-a----        26/10/2021  12:38 AM        2474496 PocoFoundation.dll

-a----        26/10/2021  12:38 AM         437760 PocoZip.dll

-a----        17/06/2015   2:37 AM        5615492 qemu-img.exe

-a----        26/10/2021  12:38 AM        6023664 Qt5Core.dll

-a----        26/10/2021  12:38 AM        7008240 Qt5Gui.dll

-a----        26/10/2021  12:38 AM        1340400 Qt5Network.dll

-a----        26/10/2021  12:38 AM        5498352 Qt5Widgets.dll

-a----        26/10/2021  12:38 AM         472576 ssh.dll

-a----        26/10/2021  12:29 AM        2576384 sshfs_server.exe

-a----        18/10/2021   9:35 PM          97168 vcruntime140.dll

-a----        18/10/2021   9:35 PM          37240 vcruntime140_1.dll

上述文件中比较关键的文件包含: ssh 、qemu 等文件。

 

默认 Multipass 会安装在 C 盘的系统目录中,如果系统空间不足,会出现以下提示信息:

PS C:\Users\xxxx> multipass launch --name  foo

launch failed: Conversion of image to vhdx failed with error: SetEndOfFile error: 112

qemu-img.exe: error while writing sector 2523136: Input/output error

在安装 VM 虚拟机的过程中,加入了收集用户使用信息的步骤:

PS C:\Users\xxxx> multipass launch --name  foo

One quick question before we launch … Would you like to help

the Multipass developers, by sending anonymous usage data?

This includes your operating system, which images you use,

the number of instances, their properties and how long you use them.

We’d also like to measure Multipass’s speed.


Send usage data (yes/no/Later)?

为支持 ssh 登陆的密钥保存目录:

C:\Users\xxx\AppData\Roaming\multipass\client-certificate


 

    Directory: C:\Users\xxx\AppData\Roaming\multipass\client-certificate



Mode                 LastWriteTime         Length Name

----                 -------------         ------ ----

-a----         6/12/2021  12:02 PM            595 multipass_cert.pem

-ar---         6/12/2021  12:02 PM            241 multipass_cert_key.pem
PS C:\Users\xxx> multipass launch --name  ubuntu_0001

launch failed: Invalid arguments supplied

Invalid instance name supplied: ubuntu_0001



PS C:\Users\xxx> multipass launch --name  foo

launch failed: Conversion of image to vhdx failed with error: SetEndOfFile error: 112

qemu-img.exe: error while writing sector 2523136: Input/output error




 

PS C:\Users\xxx> multipass launch --name  foo

Waiting for initialization to complete -




 

 

PS C:\Users\xxx> multipass launch --name  foo

Launched: foo


 

PS C:\Users\xxx> multipass exec foo -- lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description:    Ubuntu 20.04.3 LTS

Release:        20.04

Codename:       focal




 

PS C:\Users\xxx> multipass list

Name                    State             IPv4             Image

foo                     Running           172.26.167.168   Ubuntu 20.04 LTS




PS C:\Users\xxx> multipass delete foo



PS C:\Users\xxx> multipass purge


 

PS C:\Users\xxx> multipass find

Image                       Aliases           Version          Description

core                        core16            20200818         Ubuntu Core 16

core18                                        20200812         Ubuntu Core 18

18.04                       bionic            20211129         Ubuntu 18.04 LTS

20.04                       focal,lts         20211129         Ubuntu 20.04 LTS

21.04                       hirsute           20211130         Ubuntu 21.04

21.10                       impish            20211103         Ubuntu 21.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

anbox-cloud-appliance                         latest           Anbox Cloud Appliance

minikube                                      latest           minikube is local Kubernetes

虚拟机文件的存储路径:

C:\Windows\System32\config\systemprofile\AppData\Roaming\multipassd\vault

 

 

从测试过程来看 Multipass 整体上和 windows 集成的操作流程很顺畅,可以作为一个备选的开发环境。

在 Windows 系统中 C 盘一般是各种软件默认存储配置和临时信息的地方,像 VM 这样较大的文件,如果可以指定存储到其他硬盘分区会更好一点。Multipass 在实际工作环境中还有很多小的毛刺需要改进。
 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐