当前位置:网站首页>推荐一款M1电脑可用的虚拟机软件
推荐一款M1电脑可用的虚拟机软件
2022-06-25 11:27:00 【蝉 沐 风】
目录

虚拟机软件太多了,出名的莫过于VMware
,VirutlaBox
以及Parallels Desktop
。
我们使用虚拟机软件一般有两种用途:
- 安装不同于宿主机系统的拥有用户界面的操作系统,比如Windows安装桌面版
Ubuntu
,Mac安装Windows
等,用于日常工作和生活的使用;
这一需求我目前使用Parallels Desktop
来解决,在我本机上安装了Windows
和Ubuntu
的桌面版。Parallels Desktop
除了贵,没有其他问题!
- 另一种是便于开发者快速创建和部署虚拟化开发环境(集群环境),本文推荐的虚拟软件就是这个作用。
之前我在Windows上都是使用VirtualBox
+Vagrant
的方式快速创建和销毁虚拟机。现在我的工作主机换成了M1芯片的Mac,而VirtualBox
并没有给予适配。
最近发现了一款叫做Multipass
的虚拟机软件,重点是,我的M1电脑可以使用!接下来给大家分享一下使用心得。
下载安装Multipass
Mac下推荐使用brew
安装Multipass
,免去了点击下载,解压以及安装的步骤
brew install --cask multipass
安装之后,查看是否安装成功
* ~ multipass version
multipass 1.9.2+mac
multipassd 1.9.2+mac
查看Multipass支持的镜像
* ~ multipass find
Image Aliases Version Description
18.04 bionic 20220615 Ubuntu 18.04 LTS
20.04 focal,lts 20220615 Ubuntu 20.04 LTS
21.10 impish 20220609 Ubuntu 21.10
22.04 jammy 20220609 Ubuntu 22.04 LTS
anbox-cloud-appliance latest Anbox Cloud Appliance
charm-dev latest A development and testing environment for charmers
docker latest A Docker environment with Portainer and related tools
minikube latest minikube is local Kubernetes
注意:
Multipass
只提供了Ubuntu
的发行版镜像,这对于开发人员开说并不算什么缺点,至少对我是这样的
创建虚拟机
接下来我们选择需要的镜像版本来安装Ubuntu
实例,这里以jammy
(镜像列表的Aliases
一列)为例
* ~ multipass launch jammy
Launched: boss-wallaroo
其中,boss-wallaroo
是Multipass
给jammy
镜像实例随机起的名字,你也可以使用--name
来指定实例名称。
~ multipass launch jammy --name chanmufeng-ubuntu
Launched: chanmufeng-ubuntu
操作虚拟机
查看虚拟机列表
使用multipass info --all
查看安装的所有虚拟机
* ~ multipass info --all
Name: chanmufeng-ubuntu
State: Running
IPv4: 192.168.64.3
Release: Ubuntu 22.04 LTS
Image hash: 746fd17e2944 (Ubuntu 22.04 LTS)
Load: 0.02 0.02 0.00
Disk usage: 1.3G out of 4.7G
Memory usage: 162.4M out of 961.9M
Mounts: --
Name: lucky-dog
State: Stopped
IPv4: --
Release: --
Image hash: 746fd17e2944 (Ubuntu 22.04 LTS)
Load: --
Disk usage: --
Memory usage: --
Mounts: --
执行结果表明,我电脑上有了2个实例,分别是chanmufeng-ubuntu
(运行中)、lucky-dog
(停止状态)。
进入虚拟机,执行命令
执行multipass shell 实例名
进入实例,如果实例未启动,则会自动启动
* ~ multipass shell lucky-dog
Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-37-generic aarch64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Sun Jun 19 21:06:43 CST 2022
System load: 0.3203125
Usage of /: 29.8% of 4.77GB
Memory usage: 20%
Swap usage: 0%
Processes: 100
Users logged in: 0
IPv4 address for enp0s1: 192.168.64.2
IPv6 address for enp0s1: fd96:8c7d:a0ba:459d:5054:ff:fea5:1ea3
0 updates can be applied immediately.
Last login: Tue Jun 14 13:41:27 2022 from 192.168.64.1
[email protected]:~$ ~
然后就可以在lucky-dog
中自由地玩耍了。
停止/重启虚拟机
# 暂停
* ~ multipass stop lucky-dog
# 启动
* ~ multipass start lucky-dog
移除实例到“回收站”
使用如下命令删除实例
* ~ multipass delete chanmufeng-ubuntu
delete
命令只是将chanmufeng-ubuntu
实例标记为DELETED
状态而已,相当于放到了回收站,但是本身依然存在。
使用list
命令看一下
* ~ multipass list
Name State IPv4 Image
chanmufeng-ubuntu Deleted -- Not Available
lucky-dog Running 192.168.64.2 Ubuntu 22.04 LTS
如果后悔了,可以使用recover
命令进行撤销
* ~ multipass recover chanmufeng-ubuntu
再次使用list
命令看一下
* ~ multipass list
Name State IPv4 Image
chanmufeng-ubuntu Stopped -- Not Available
lucky-dog Running 192.168.64.2 Ubuntu 22.04 LTS
彻底删除实例
这一步相当于从“回收站”彻底删除,当然了,前提是实例必须已经被放在了“回收站”。
* ~ multipass delete chanmufeng-ubuntu
* ~ multipass purge
* ~ multipass list
Name State IPv4 Image
lucky-dog Running 192.168.64.2 Ubuntu 22.04 LTS
其他进阶功能
除了以上基本功能,Multipass
还提供其他进阶功能,本文只是提一嘴,更多细节,大家访问官网查看一下文档即可。
自定义硬件配置
可以自定义CPU核心数、硬盘大小以及内存大小等参数
自定义网卡配置和DNS配置
快速配置环境
虚拟机功能给我们带来的好处就是对于实例,我们想建就建,想删就删。
可是删了之后重新建立,难免很多软件和工具需要重新进行配置,Mutipass
提供了--cloud-init
对容器进行初始化配置。
* ~ multipass launch --name ubuntu --cloud-init config.yaml
config.yaml
是初始化配置文件,内容如下:
runcmd:
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
- sudo apt-get install -y nodejs
runcmd
可以指定容器首次启动时运行的命令
搭配VirtualBox
当然,这个功能不适合M1,但是在其他平台上搭配VirtualBox
可以实现和Vagrant
同样的效果。
通过VirtualBox
对Multipass
虚拟机进行可视化操作。
还有其他的一些功能需要读者朋友们自己发掘一下了,更多细节参见官网。
边栏推荐
- Handler、Message、Looper、MessageQueue
- 16 enterprise architecture strategies
- Arrays.asList()
- Free access to the global human settlements layer (ghsl) dataset from Gee
- 龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书
- Spannable and editable, spannablestring and spannablestring
- 2022 PMP project management examination agile knowledge points (2)
- 某APP中模拟器检测分析
- Multiple environment variables
- relu与sigmod的比较
猜你喜欢
RPC typical framework
Introduction to JVM principle
Network remote access using raspberry pie
SystemVerilog (XIII) - enumerate data types
Double buffer transparent encryption and decryption driven course paper + project source code based on minifilter framework
Shichuang energy rushes to the scientific innovation board: it plans to raise 1.1 billion yuan, with an annual revenue of 700million yuan and a 36% decrease in net profit
开源社邀请您参加OpenSSF开源安全线上研讨会
Writing wechat applet with uni app
SQL注入漏洞(繞過篇)
Ladder Side-Tuning:预训练模型的“过墙梯”
随机推荐
GaussDB 如何统计用户sql的响应时间
Double tampon transparent cryptage et décryptage basé sur le cadre minifilter
Shen Ying, China Academy of communications and communications: font open source protocol -- Introduction to ofl v1.1 and analysis of key points of compliance
Leetcode 1249. 移除无效的括号(牛逼,终于做出来了)
SQL注入漏洞(繞過篇)
Query method and interrupt method to realize USART communication
Some assembly instructions specific to arm64
Socket communication principle
Golden sun education listed in the U.S.: a small cap medium cap stock with a market value of USD 360million
Spark tuning tool -- detailed explanation of sparklens
翌圣生物冲刺科创板:25%收入来自新冠产品销售 拟募资11亿
Jincang database kingbasees plug-in force_ view
开源社邀请您参加OpenSSF开源安全线上研讨会
Apache ShenYu 入門
Spark Tuning common configuration parameters
Daily 3 questions (3) - check whether integers and their multiples exist
网易开源的分布式存储系统 Curve 正式成为 CNCF 沙箱项目
2022年PMP项目管理考试敏捷知识点(2)
MySQL and Oracle processing CLOB and blob fields
RPC typical framework