multipass 是由 ubuntu 推出的一款跨平台虚拟机管理工具,适用于 windows、macos 和 linux 操作系统。
官方网站:Multipass 旨在管理虚拟 Ubuntu 实例Multipass 是一个命令行界面工具,用于在 Windows、Mac 和 Linux 上启动和管理虚拟机,模拟云环境,并支持 cloud-init。通过在您的原生平台上与 IDE 和版本控制系统无缝集成,即时获取 Ubuntu。
https://www.php.cn/link/101d3ee2395bb1d1aca582263378d26a
在 Windows 平台上,Multipass 依赖于 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
在安装虚拟机的过程中,Multipass 加入了收集用户使用信息的步骤:
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 盘通常是各种软件默认存储配置和临时信息的地方,像虚拟机这样较大的文件,如果可以指定存储到其他硬盘分区会更好一些。Multipass 在实际工作环境中还有许多小的细节需要改进。
以上就是Ubuntu Multipass 尝鲜的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号