hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
276 stars 22 forks source link

MacOS: M1 Mac + VMware Pro + Ubuntu(ARM) #417

Open hhstore opened 5 months ago

hhstore commented 5 months ago

📖 Abstract:

💯 Related:

hhstore commented 5 months ago

M1 Mac 通过 VMware 虚拟机安装 Ubuntu(ARM)

背景:

  1. 因为使用 SwiftUI 的某些 API, 依赖 macOS > 13, 故升级当前 12.4最新系统(14.2), 失败, 导致系统挂了.(且无法降级, 尼玛)
  2. Apple 招了太多阿三, 软硬件的品质和可靠性, 直线下降. (M1 Mac 喇叭爆破音至今未解决)
  3. 以后, 再升级系统, 是狗🐶. (全部走虚拟机, 不再更新)
  4. 好在手里有多台 Mac, 不至于影响工作.

最近几年 Mac 有多烂?

厌倦:

言归正传: (全面拥抱虚拟机)

  1. 使用 VMware 安装 Ubuntu. 不使用 PD, 是考虑 VMware 的跨平台能力.
  2. 以后都基于 Ubuntu VM 搭建开发环境. macOS 只做裸机(不配开发环境), 这样 TM 备份+恢复 也简单/快速.(不再相信 Mac 的可靠性)

可行性:

好处:

  1. 虚拟机隔离安全(多账户, 彻底隔离)
  2. 开发环境统一. (一次配置, 到处使用)
  3. 只配置一个 Ubuntu 虚拟机环境, 然后打包快照. 分发快照. (这里还有个小问题. ARM 版本 和 Intel 不通用)

暂时不够完美的点:

  1. CPU 架构问题: ARM 和 Intel/AMD 的不通用. (暂时需要构建 2 套 虚拟机, 做不到 100% 无缝统一)
  2. 多台机器间的 VM 分发和同步, 没有特别好的方案. 可以基于 NAS 来备份+同步. (待验证)
hhstore commented 5 months ago

VMware 下载 + 安装:

VMware Fusion Pro 13 注册序列号:


4C21U-2KK9Q-M8130-4V2QH-CF810
ZF3R0-FHED2-M80TY-8QYGC-NPKYF
YF390-0HF8P-M81RQ-2DXQE-M2UT6
ZF71R-DMX85-08DQY-8YMNC-PPHV8

Ubuntu 下载 + 安装:

ARM desktop 版本:

常规 desktop 版本:

server 版本:

参考:

hhstore commented 5 months ago

VMware 虚拟机内, 安装 macOS:

教程:

hhstore commented 5 months ago

虚拟机安装 Ubuntu desktop 22 教程:

步骤:

  1. 安装 VMware.
  2. 下载 Ubuntu desktop ISO 文件.
  3. VMware, 挂载 Ubuntu ISO, 新建虚拟机.
  4. 执行安装步骤. (desktop 和 server 版本, 流程略不同)
  5. desktop 会进入 GUI 内, 勾选+配置, 然后才进行安装.
image
  1. 等待进度条走完, 结束, 重启虚拟机.
p_2024-01-09_07-01-20
  1. 首次, 等待一下. 出现如下为正常.
image
  1. 用户登陆界面:
image

配置 网络 + 代理:

image
hhstore commented 5 months ago

Ubuntu 虚拟机配置:

🔥 安装 VMware tool:


sudo apt update -y
sudo apt install open-vm-tools-desktop -y

# reboot
reboot

安装必备软件:


sudo apt update -y

sudo apt install -y zsh curl git vim openssh-server

激活 SSH


sudo apt update -y
sudo apt install openssh-server
image
hhstore commented 5 months ago

配置开发环境:

安装日常软件:


sudo snap install chromium-browser

安装开发工具:

hhstore commented 5 months ago

虚拟机安装 macOS

hhstore commented 5 months ago

1

hhstore commented 5 months ago

1

hhstore commented 5 months ago

1

hhstore commented 5 months ago

1