# Macos

## Prerequisites

### 1. Check & Install Homebrew

Check if Homebrew is installed:

```
 brew --version
```

If not installed, run the following:

```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

Add Homebrew to your PATH:

```
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
source ~/.zshrc
```

Verify Installation

```
 brew doctor
```

Update Homebrew (recommended):

```
brew update
```

### 2. Check & Install Lima

Check if Lima is installed:

```
 limactl --version
```

If not installed, install Lima using Homebrew:

```
brew install lima
```

Start the default virtual machine:

```
limactl start
```

### 3. Access Virtual Machine Shell

Access Lima shell with root privileges:

```
lima sudo -i
```

Register nodeCN

```sh
curl 'https://www.janction.ai/v0/node/install.sh' |  NODE_ID= bash -s install
```

If successful, the following message will be displayed:

```
Congratulations! Installation completed successfully!
 === EdgeCore Configuration Summary === 
KubeEdge Version: v1.20.0
Configuration Status:
- metaServer: enabled
- edgeMesh: disabled
- edgeStream: enabled
Backup File: /etc/kubeedge/config/edgecore.yaml.20250720_000731.bak
=======================================

=== Service Management Commands ===
To start edgecore service:
  systemctl start edgecore
To check edgecore service status:
  systemctl status edgecore
To stop edgecore service:
  systemctl stop edgecore
=======================================
    
```

### 5. Manage Lima Virtual Machine

**Do not stop the VM while the node is active.**

Stop the virtual machine:

```
limactl stop default
```

Check VM status:

```
 limactl status default
```

Delete the virtual machine:

```
 limactl delete default
```
