【Mac M2 pro】Linux虚拟机轻装上阵—multipass 尝试

multipass 简介

Multipass 是一款轻量级的虚拟机管理工具,它可以在 Windows、macOS 和 Linux 上快速创建和管理虚拟机。使用 Multipass 可以轻松地构建和测试多种操作系统和应用程序,同时保持计算机的干净和安全。它还提供了一些方便的命令行工具,可以帮助您管理虚拟机的生命周期。

安装

总的来说两种安装方式

  • brew 安装
  • github 安装包

参考:https://blog.csdn.net/sinat_41870148/article/details/125213841

常用命令

bash 复制代码
multipass info --all # 显示所有详细实例信息
multipass list # 列出所有实例
multipass delete instance_name # 删除实例,改变状态为 delete
multipass purge # 将 delete 的实例彻底删除
multipass find # 显示所有可用的 vm 代号

# 本机传文件到虚拟机
multipass transfer /Users/xxx/.ssh/id_rsa.pub ubuntu2204:/home/ubuntu/.ssh/id_rsa.pub  

# 虚拟机传文件到本机
multipass transfer ubuntu2204:/home/ubuntu/.ssh/id_rsa.pub  /Users/xxx/.ssh/id_rsa.pub 

文件路径

gui 安装的文件路径

bash 复制代码
/Users/xxx/Library/Application Support/multipass-gui
/Users/xxx/Library/Application Support/multipass-client-certificate

gui 可执行文件路径

bash 复制代码
/Library/Application Support/com.canonical.multipass

实例文件路径
注意 private 路径,需要sudo超户进入

bash 复制代码
/System/Volumes/Data/private/var/root/Library/Application Support/multipassd
/System/Volumes/Data/private/var/root/Library/Preferences/multipassd
/System/Volumes/Data/private/var/root/Library/Caches/multipassd

Mac 中 /System/Volumes/Data/private 其实等效于 /

bash 复制代码
/System/Volumes/Data/private/var/root/Library/Application Support/multipassd
/System/Volumes/Data/private/var/root/Library/Preferences/multipassd
/System/Volumes/Data/private/var/root/Library/Caches/multipassd

参考:https://askubuntu.com/questions/1383548/cant-find-multipass-ubuntu-files-on-mac-m1-finder

SSH 登录multipass实例环境

总的来说 SSH 两种登录方式

  1. 用户名和口令
  2. 密钥(不需要输入密码:将本机的公钥放到服务器的 .ssh/authority_keys 文件中 即可

首先需要在 Ubuntu 环境中安装 ssh server 端,默认 22 端口,具体命令网上搜一搜

附一个 ssh 登录过程:

参考

相关推荐
南方以南_7 小时前
Ubuntu操作合集
linux·运维·ubuntu
追赶sun11 小时前
Ubuntu 添加系统调用
linux·ubuntu·操作系统·系统调用
Snasph13 小时前
Ubnutu ADB 无法识别设备的解决方法
ubuntu·adb
Mapleay13 小时前
ubuntu 更新华为源
运维·服务器·ubuntu
Jerry&Louis16 小时前
【Ubuntu】Waydroid-Linux安卓模拟器安装
linux·ubuntu
yangpan01116 小时前
ubuntu 24.04安装ros1 noetic
linux·运维·ubuntu
星卯教育tony16 小时前
ubuntu 20.04 更改国内镜像源-阿里源 确保可用
linux·运维·ubuntu
77tian19 小时前
VMware中快速安装与优化Ubuntu全攻略
开发语言·ubuntu
小猪写代码20 小时前
在 Ubuntu 20.04.6 LTS 中将 SCons 从 3.1.2 升级到 4.9.1
chrome·ubuntu·pip
南棱笑笑生21 小时前
20250517让NanoPi NEO core开发板在Ubuntu core16.04.2下支持TF卡的热插拔
linux·运维·ubuntu