【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 登录过程:

参考

相关推荐
foo1st3 小时前
MySQL 8(Ubuntu 18.04.6 LTS)安装笔记
笔记·mysql·ubuntu
老兵发新帖17 小时前
Ubuntu 上安装 Conda
linux·ubuntu·conda
foo1st1 天前
Tomcat Web应用(Ubuntu 18.04.6 LTS)部署笔记
ubuntu·tomcat
cosX+sinY1 天前
ubuntu 20.04 编译运行lio-sam,并保存为pcd
linux·ubuntu·机器人
FREEDOM_X1 天前
ubuntu20.04 远程桌面Xrdp方式
ubuntu·vmware
꧁坚持很酷꧂1 天前
配置Ubuntu18.04中的Qt Creator为中文(图文详解)
开发语言·qt·ubuntu
Sapphire~1 天前
Linux-06 ubuntu 系统截图软件使用简单记录
linux·运维·ubuntu
biter00881 天前
ubuntu(28):ubuntu系统多版本conda和多版本cuda共存
linux·人工智能·ubuntu·conda
Hello.Reader1 天前
在 Ubuntu 环境为 Elasticsearch 引入 `icu_tokenizer
ubuntu·elasticsearch·jenkins
foo1st2 天前
JDK(Ubuntu 18.04.6 LTS)安装笔记
java·笔记·ubuntu