https://github.com/beringresearch/macpine

Lightweight Linux VMs on MacOS

https://github.com/beringresearch/macpine

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 10 committers (10.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.6%) to scientific vocabulary

Keywords

golang linux m1-mac macos qemu virtualization
Last synced: 5 months ago · JSON representation

Repository

Lightweight Linux VMs on MacOS

Basic Info
Statistics
  • Stars: 982
  • Watchers: 6
  • Forks: 29
  • Open Issues: 7
  • Releases: 21
Topics
golang linux m1-mac macos qemu virtualization
Created almost 4 years ago · Last pushed 6 months ago
Metadata Files
Readme License Security

README.md

build Go Report Card

Lightweight Alpine VMs on MacOS

Create and manage lightweight Alpine VMs on MacOS with:

:repeat: Seamless port forwarding

:cardindexdividers: Automatic file sharing

:roller_coaster: Bridged networking

:rocket: aarch64 and x86_64 emulation

Motivation

The goal of this project is to enable MacOS users to:

  1. Easily spin up and manage lightweight Alpine Linux environments.
  2. Use tiny VMs to take advantage of containerisation technologies, including Incus, LXD and Docker.
  3. Build and test software on x86_64 and aarch64 systems.

Installation

macpine is intended for use on modern macOS. Support for older versions of macOS and other OSes may vary.

Install from Homebrew (recommended)

bash brew install macpine # installs `alpine` command and `qemu` dependency automatically

Get the latest binary

Download the latest binary release for your system and add it to your $PATH by moving it to e.g. /usr/local/bin/:

``bash arch="$([uname -m` = 'x8664' ] && echo 'amd64' || echo 'arm64')" # detect architecture wget "https://github.com/beringresearch/macpine/releases/latest/download/alpinedarwin$arch" mv "alpinedarwin_$arch" alpine sudo chmod +x alpine sudo mv alpine /usr/local/bin/

export PATH="$PATH:/usr/local/bin"

```

Macpine depends on QEMU >= 7.22.0:

bash brew install qemu

Install from MacPorts

You can also install macpine via MacPorts:

bash sudo port install macpine

Install from source

Building from source requires a working go compiler, and running requires qemu:

bash brew install go qemu git clone https://github.com/beringresearch/macpine cd macpine make # compiles the project into a local bin/ directory make install # installs binaries to /usr/local/bin # PREFIX=/some/other/path make install installs to /some/other/path

Getting Started

To create and start a new instance:

```bash alpine launch # launches with default parameters alpine launch -a aarch64 # create an aarch64 instance alpine launch -d 10G -c 4 -m 2048 # create an instance with a 10GB disk, 4 cpus, and 2GB of RAM

alpine launch -h # view all configuration options and defaults ```

Access instance via ssh:

bash alpine launch -s 22 # launch an instance and expose SSH port to host port 22 alpine ssh instance-name # attach shell to instance (replace `instance-name` as appropriate)

Expose additional instance ports to host:

```bash

launch an instance, expose SSH to host port 2022 and forward host ports 8888 and 5432 to instance ports 8888 and 5432

alpine launch -s 2022 -p 8888,5432

launch an instance, expose SSH to host port 8022, forward host port 8081 to instance port 8082, and forward

host port 8083 to instance port 8083

alpine launch -s 8022 -p 8081:8082,8083

launch an instance, expose SSH to host port 9022, forward host port 9091 UDP to instance port 9091 UDP,

and forward host port 9092 UDP to instance port 9093 UDP

alpine launch -s 9023 -p 9091u,9092:9093u ```

Instances can be easily packaged for backup or sharing as .tar.gz files:

```bash alpine list

NAME STATUS SSH PORTS ARCH PID TAGS cheerful-result Running 2022 aarch64 26568 glittering-swing Running 3022 x86_64 57206 emulation,intel ```

bash alpine publish cheerful-result

This will create a file cheerful-result.tar.gz which can be imported as:

```bash

alpine delete cheerful-result

alpine import cheerful-result.tar.gz ```

See all the docs for more information: - advanced port forwarding and securing instance SSH - editing instance configurations - running incus within instances - running LXD within instances - hardening instances - auto-starting instances at login - general troubleshooting

Command Reference

```man Create, control, and connect to Alpine instances.

Usage: alpine [command]

Available Commands: completion Generate shell autocompletions. delete Delete instances. edit Edit instance configurations. exec execute a command on an instance over ssh. help Help about any command import Imports an instance archived with alpine publish. info Display information about instances. launch Create and start an instance. list List instances. pause Pause instances. publish Publish instances. rename Rename an instance. restart Stop and start instances. resume Unpause instances. ssh Attach an interactive shell to an instance via ssh. start Start instances. stop Stop instances. tag Add or remove tags from an instance.

Flags: -h, --help help for alpine

Use "alpine [command] --help" for more information about a command. ```

Multiple instances in a command: some commands (delete, edit, info, pause, publish, restart, resume, start, stop) accept multiple instance names and will repeat the operation over each unique named instance once.

Tags: using alpine tag, instances can be tagged; tags can be used in multi-instance commands (see above) e.g. alpine start +foobar will start all instances which have had been tagged foobar with alpine tag instance-name foobar. Note that the tag launchctl-autostart is used for auto-starting instances at login.

Shell autocompletion: shell command completion files (installed automatically with brew install macpine) can be generated with alpine completion [bash|zsh|fish|powershell]. See alpine completion -h or the completion documentation for more information.

Owner

  • Name: beringresearch
  • Login: beringresearch
  • Kind: user
  • Company: Bering Limited

GitHub Events

Total
  • Create event: 5
  • Release event: 3
  • Issues event: 13
  • Watch event: 81
  • Delete event: 3
  • Member event: 2
  • Issue comment event: 19
  • Push event: 7
  • Pull request review event: 2
  • Pull request event: 7
  • Fork event: 8
Last Year
  • Create event: 5
  • Release event: 3
  • Issues event: 13
  • Watch event: 81
  • Delete event: 3
  • Member event: 2
  • Issue comment event: 19
  • Push event: 7
  • Pull request review event: 2
  • Pull request event: 7
  • Fork event: 8

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 376
  • Total Committers: 10
  • Avg Commits per committer: 37.6
  • Development Distribution Score (DDS): 0.441
Past Year
  • Commits: 35
  • Committers: 4
  • Avg Commits per committer: 8.75
  • Development Distribution Score (DDS): 0.2
Top Committers
Name Email Commits
idroz i****v@b****m 210
Max Zinkus 5****s 147
Brandon Ros b****1@g****m 7
Gregory Anders g****g@g****m 3
Alexandre Espinosa Menor a****r@g****m 2
Zachary z****1@g****m 2
bunam b****e@g****m 2
Herby Gillot h****t@g****m 1
Joshua Horowitz j****h@a****u 1
Surya Murugan s****e@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 77
  • Total pull requests: 82
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 1 day
  • Total issue authors: 19
  • Total pull request authors: 7
  • Average comments per issue: 3.19
  • Average comments per pull request: 0.72
  • Merged pull requests: 77
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 14
  • Pull requests: 10
  • Average time to close issues: 2 days
  • Average time to close pull requests: 13 minutes
  • Issue authors: 7
  • Pull request authors: 3
  • Average comments per issue: 0.93
  • Average comments per pull request: 0.1
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • idroz (26)
  • maxzinkus (24)
  • pirj (4)
  • rauhryan (2)
  • paulrouget (2)
  • joshuahhh (2)
  • jdriselvato (2)
  • nixfreak (1)
  • timfayz (1)
  • johnlonganecker (1)
  • l00sed (1)
  • go-dockly (1)
  • themisir (1)
  • robtaylor (1)
  • bpint (1)
Pull Request Authors
  • idroz (47)
  • maxzinkus (39)
  • dependabot[bot] (2)
  • fonzarely (2)
  • adrozdovbering (1)
  • joshuahhh (1)
  • suryamurugan (1)
Top Labels
Issue Labels
enhancement (17) bug (3) release (2) awaiting review (2) blocked (2) good first issue (1) in progress (1) wontfix (1)
Pull Request Labels
enhancement (8) awaiting review (6) documentation (2) dependencies (2) in progress (1)

Packages

  • Total packages: 2
  • Total downloads:
    • homebrew 86 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 74
proxy.golang.org: github.com/beringresearch/macpine
  • Versions: 61
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 1.4%
Forks count: 3.5%
Average: 5.3%
Dependent packages count: 7.0%
Dependent repos count: 9.3%
Last synced: 6 months ago
formulae.brew.sh: macpine

Lightweight Linux VMs on MacOS

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 86 Last month
Rankings
Stargazers count: 19.4%
Dependent packages count: 19.5%
Average: 26.9%
Dependent repos count: 29.9%
Downloads: 32.6%
Forks count: 33.2%
Last synced: 6 months ago

Dependencies

go.mod go
  • github.com/inconshreveable/mousetrap v1.0.0
  • github.com/spf13/cobra v1.4.0
  • github.com/spf13/pflag v1.0.5
  • golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
  • golang.org/x/sys v0.0.0-20211031064116-611d5d643895
  • golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
  • gopkg.in/yaml.v2 v2.4.0
go.sum go
  • github.com/cpuguy83/go-md2man/v2 v2.0.1
  • github.com/inconshreveable/mousetrap v1.0.0
  • github.com/russross/blackfriday/v2 v2.1.0
  • github.com/spf13/cobra v1.4.0
  • github.com/spf13/pflag v1.0.5
  • golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
  • golang.org/x/sys v0.0.0-20211031064116-611d5d643895
  • golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
  • gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
  • gopkg.in/yaml.v2 v2.4.0
.github/workflows/gh-pages.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite