diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..8aa4182 Binary files /dev/null and b/.DS_Store differ diff --git a/VM_README.md b/VM_README.md new file mode 100644 index 0000000..30d1f26 --- /dev/null +++ b/VM_README.md @@ -0,0 +1,52 @@ +# Python Sandbox in Linux + +Python Sandbox allows you to run your python codes in a complete linux virtual machine. It is easy to use and efficient. The VM is customizable and you can choose your own CPU, disk size, and RAM size. + +Two key features: + - Automatic python virtual environment setup. + - Same python instructions + +## Numpy Example listed in samples/1st.gif +![](samples/1st.gif) + +## Gorilla CLI Example listed in samples/gorillaVM.gif +![](samples/gorillaVM.gif) + +## Requirements +Please install `qemu` on your machine. Currently, python-sandbox only works on MacOS with M-sereis chips. Windows and Linux versions are not yet tested, and they may potentially work. + +## Usage + +Darg all relevant python files into this folder. Then, type to see instructions you need to do: +```bash +$ python python-sandbox.py --help +``` + +## How It Works + +python-sandbox internally use lima to create a linux virtual machine. You can edit your linux machine profile in `python-sandbox.yml`. It regulates all of sandboxes you created and make sure there is no conflicts between sandboxes. + +### Arguments +To start a sandbox +```bash +python python-sandbox.py start NEWBOX +``` +To stop a sandbox +```bash +python python-sandbox.py stop NEWBOX +``` +#### Warning: always remember to stop a sandbox! The sanbox does not close on itself. + +To run python +```bash +python python-sandbox.py python PYFILE.py ARGS +``` +To pip install relevant packages +```bash +python python-sandbox.py pip install ARGS +``` +To show every sandbox status +```bash +python python-sandbox.py show-all +``` + diff --git a/go_cli.py b/go_cli.py index 42296d4..f4e22a6 100644 --- a/go_cli.py +++ b/go_cli.py @@ -88,8 +88,9 @@ def prefill_shell_cmd(cmd): # Use the new attributes termios.tcsetattr(stdin, termios.TCSANOW, newattr) # Write the selected command in stdin queue - for c in cmd: - fcntl.ioctl(stdin, termios.TIOCSTI, c) + os.write(stdin, cmd.encode()) + # for c in cmd: + # fcntl.ioctl(stdin, termios.TIOCSTI, c) # Restore TTY attributes for stdin termios.tcsetattr(stdin, termios.TCSADRAIN, oldattr) diff --git a/lima/.DS_Store b/lima/.DS_Store new file mode 100644 index 0000000..42dc842 Binary files /dev/null and b/lima/.DS_Store differ diff --git a/lima/.brew/lima.rb b/lima/.brew/lima.rb new file mode 100644 index 0000000..a0760f5 --- /dev/null +++ b/lima/.brew/lima.rb @@ -0,0 +1,36 @@ +class Lima < Formula + desc "Linux virtual machines" + homepage "https://lima-vm.io/" + url "https://github.com/lima-vm/lima/archive/refs/tags/v0.22.0.tar.gz" + sha256 "9ea5b439cf71bb8fc4d831c3a71540baaa4c4420152addf1e32de57a4dc8af96" + license "Apache-2.0" + head "https://github.com/lima-vm/lima.git", branch: "master" + + depends_on "go" => :build + depends_on "qemu" + + def install + if build.head? + system "make" + else + # VERSION has to be explicitly specified when building from tar.gz, as it does not contain git tags + system "make", "VERSION=#{version}" + end + + bin.install Dir["_output/bin/*"] + share.install Dir["_output/share/*"] + + # Install shell completions + generate_completions_from_executable(bin/"limactl", "completion", base_name: "limactl") + end + + test do + info = JSON.parse shell_output("#{bin}/limactl info") + # Verify that the VM drivers are compiled in + assert_includes info["vmTypes"], "qemu" + assert_includes info["vmTypes"], "vz" if OS.mac? && MacOS.version >= :ventura + # Verify that the template files are installed + template_names = info["templates"].map { |x| x["name"] } + assert_includes template_names, "default" + end +end diff --git a/lima/INSTALL_RECEIPT.json b/lima/INSTALL_RECEIPT.json new file mode 100644 index 0000000..51891c9 --- /dev/null +++ b/lima/INSTALL_RECEIPT.json @@ -0,0 +1,290 @@ +{ + "homebrew_version": "4.2.21-8-g55167f2", + "used_options": [ + + ], + "unused_options": [ + + ], + "built_as_bottle": true, + "poured_from_bottle": true, + "loaded_from_api": true, + "installed_as_dependency": false, + "installed_on_request": true, + "changed_files": [ + + ], + "time": 1716675096, + "source_modified_time": 1715052850, + "compiler": "clang", + "aliases": [ + + ], + "runtime_dependencies": [ + { + "full_name": "capstone", + "version": "5.0.1", + "revision": 0, + "pkg_version": "5.0.1", + "declared_directly": false + }, + { + "full_name": "dtc", + "version": "1.7.0", + "revision": 0, + "pkg_version": "1.7.0", + "declared_directly": false + }, + { + "full_name": "pcre2", + "version": "10.43", + "revision": 0, + "pkg_version": "10.43", + "declared_directly": false + }, + { + "full_name": "mpdecimal", + "version": "4.0.0", + "revision": 0, + "pkg_version": "4.0.0", + "declared_directly": false + }, + { + "full_name": "ca-certificates", + "version": "2024-03-11", + "revision": 0, + "pkg_version": "2024-03-11", + "declared_directly": false + }, + { + "full_name": "openssl@3", + "version": "3.3.0", + "revision": 0, + "pkg_version": "3.3.0", + "declared_directly": false + }, + { + "full_name": "readline", + "version": "8.2.10", + "revision": 0, + "pkg_version": "8.2.10", + "declared_directly": false + }, + { + "full_name": "sqlite", + "version": "3.45.3", + "revision": 0, + "pkg_version": "3.45.3", + "declared_directly": false + }, + { + "full_name": "xz", + "version": "5.4.6", + "revision": 0, + "pkg_version": "5.4.6", + "declared_directly": false + }, + { + "full_name": "python@3.12", + "version": "3.12.3", + "revision": 0, + "pkg_version": "3.12.3", + "declared_directly": false + }, + { + "full_name": "gettext", + "version": "0.22.5", + "revision": 0, + "pkg_version": "0.22.5", + "declared_directly": false + }, + { + "full_name": "glib", + "version": "2.80.2", + "revision": 0, + "pkg_version": "2.80.2", + "declared_directly": false + }, + { + "full_name": "gmp", + "version": "6.3.0", + "revision": 0, + "pkg_version": "6.3.0", + "declared_directly": false + }, + { + "full_name": "libunistring", + "version": "1.2", + "revision": 0, + "pkg_version": "1.2", + "declared_directly": false + }, + { + "full_name": "libidn2", + "version": "2.3.7", + "revision": 0, + "pkg_version": "2.3.7", + "declared_directly": false + }, + { + "full_name": "libtasn1", + "version": "4.19.0", + "revision": 0, + "pkg_version": "4.19.0", + "declared_directly": false + }, + { + "full_name": "nettle", + "version": "3.9.1", + "revision": 0, + "pkg_version": "3.9.1", + "declared_directly": false + }, + { + "full_name": "p11-kit", + "version": "0.25.3", + "revision": 0, + "pkg_version": "0.25.3", + "declared_directly": false + }, + { + "full_name": "libevent", + "version": "2.1.12", + "revision": 1, + "pkg_version": "2.1.12_1", + "declared_directly": false + }, + { + "full_name": "libnghttp2", + "version": "1.61.0", + "revision": 0, + "pkg_version": "1.61.0", + "declared_directly": false + }, + { + "full_name": "unbound", + "version": "1.20.0", + "revision": 0, + "pkg_version": "1.20.0", + "declared_directly": false + }, + { + "full_name": "gnutls", + "version": "3.8.4", + "revision": 0, + "pkg_version": "3.8.4", + "declared_directly": false + }, + { + "full_name": "jpeg-turbo", + "version": "3.0.3", + "revision": 0, + "pkg_version": "3.0.3", + "declared_directly": false + }, + { + "full_name": "libpng", + "version": "1.6.43", + "revision": 0, + "pkg_version": "1.6.43", + "declared_directly": false + }, + { + "full_name": "libslirp", + "version": "4.8.0", + "revision": 0, + "pkg_version": "4.8.0", + "declared_directly": false + }, + { + "full_name": "libssh", + "version": "0.10.6", + "revision": 0, + "pkg_version": "0.10.6", + "declared_directly": false + }, + { + "full_name": "libusb", + "version": "1.0.27", + "revision": 0, + "pkg_version": "1.0.27", + "declared_directly": false + }, + { + "full_name": "lzo", + "version": "2.10", + "revision": 0, + "pkg_version": "2.10", + "declared_directly": false + }, + { + "full_name": "ncurses", + "version": "6.5", + "revision": 0, + "pkg_version": "6.5", + "declared_directly": false + }, + { + "full_name": "pixman", + "version": "0.42.2", + "revision": 0, + "pkg_version": "0.42.2", + "declared_directly": false + }, + { + "full_name": "snappy", + "version": "1.2.1", + "revision": 0, + "pkg_version": "1.2.1", + "declared_directly": false + }, + { + "full_name": "vde", + "version": "2.3.3", + "revision": 0, + "pkg_version": "2.3.3", + "declared_directly": false + }, + { + "full_name": "lz4", + "version": "1.9.4", + "revision": 0, + "pkg_version": "1.9.4", + "declared_directly": false + }, + { + "full_name": "zstd", + "version": "1.5.6", + "revision": 0, + "pkg_version": "1.5.6", + "declared_directly": false + }, + { + "full_name": "qemu", + "version": "9.0.0", + "revision": 0, + "pkg_version": "9.0.0", + "declared_directly": true + } + ], + "source": { + "spec": "stable", + "versions": { + "stable": "0.22.0", + "head": null, + "version_scheme": 0 + }, + "path": "/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/l/lima.rb", + "tap_git_head": null, + "tap": "homebrew/core" + }, + "arch": "arm64", + "built_on": { + "os": "Macintosh", + "os_version": "macOS 14.4", + "cpu_family": "dunno", + "xcode": "15.3", + "clt": "15.3.0.0.1.1708646388", + "preferred_perl": "5.34" + } +} \ No newline at end of file diff --git a/lima/LICENSE b/lima/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/lima/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lima/README.md b/lima/README.md new file mode 100644 index 0000000..1e1a645 --- /dev/null +++ b/lima/README.md @@ -0,0 +1,81 @@ +[[🌎**Web site**]](https://lima-vm.io/) +[[📖**Documentation**]](https://lima-vm.io/docs/) +[[👤**Slack (`#lima`)**]](https://slack.cncf.io) + + + + Shows a stylized 'Lima' text in bold, modern font + + +# Lima: Linux Machines + +[Lima](https://lima-vm.io/) launches Linux virtual machines with automatic file sharing and port forwarding (similar to WSL2). + +The original goal of Lima was to promote [containerd](https://containerd.io) including [nerdctl (contaiNERD ctl)](https://github.com/containerd/nerdctl) +to Mac users, but Lima can be used for non-container applications as well. + +Lima also supports other container engines (Docker, Podman, Kubernetes, etc.) and non-macOS hosts (Linux, NetBSD, etc.). + +## Getting started +Set up (on macOS): +```bash +brew install lima +limactl start +``` + +To run Linux commands: +```bash +lima sudo apt-get install -y neofetch +lima neofetch +``` + +To run containers with containerd: +```bash +lima nerdctl run --rm hello-world +``` + +To run containers with Docker: +```bash +limactl start template://docker +export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock') +docker run --rm hello-world +``` + +To run containers with Kubernetes: +```bash +limactl start template://k8s +export KUBECONFIG=$(limactl list k8s --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml') +kubectl apply -f ... +``` + +See for the further information. + +## Community + +### Adopters + +Container environments: +- [Rancher Desktop](https://rancherdesktop.io/): Kubernetes and container management to the desktop +- [Colima](https://github.com/abiosoft/colima): Docker (and Kubernetes) on macOS with minimal setup +- [Finch](https://github.com/runfinch/finch): Finch is a command line client for local container development +- [Podman Desktop](https://podman-desktop.io/): Podman Desktop GUI has a plug-in for Lima virtual machines + +GUI: +- [Lima xbar plugin](https://github.com/unixorn/lima-xbar-plugin): [xbar](https://xbarapp.com/) plugin to start/stop VMs from the menu bar and see their running status. +- [lima-gui](https://github.com/afbjorklund/lima-gui): Qt GUI for Lima + +### Communication channels +- [GitHub Discussions](https://github.com/lima-vm/lima/discussions) +- `#lima` channel in the CNCF Slack + - New account: + - Login: + +### Code of Conduct +Lima follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). + +- - - +**We are a [Cloud Native Computing Foundation](https://cncf.io/) sandbox project.** + + + +The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [Trademark Usage](https://www.linuxfoundation.org/trademark-usage/). diff --git a/lima/bin/apptainer.lima b/lima/bin/apptainer.lima new file mode 100755 index 0000000..31ace6d --- /dev/null +++ b/lima/bin/apptainer.lima @@ -0,0 +1,18 @@ +#!/bin/sh +set -eu +: "${LIMA_INSTANCE:=apptainer}" +: "${APPTAINER_BINDPATH:=}" + +if [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then + echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl create --name=$LIMA_INSTANCE template://apptainer\` to create a new instance" >&2 + exit 1 +elif [ "$(limactl ls -f '{{ .Status }}' "$LIMA_INSTANCE" 2>/dev/null)" != "Running" ]; then + echo "instance \"$LIMA_INSTANCE\" is not running, run \`limactl start $LIMA_INSTANCE\` to start the existing instance" >&2 + exit 1 +fi +export LIMA_INSTANCE +if [ -n "$APPTAINER_BINDPATH" ]; then + APPTAINER_BINDPATH="$APPTAINER_BINDPATH," +fi +APPTAINER_BINDPATH="$APPTAINER_BINDPATH$HOME" +exec lima APPTAINER_BINDPATH="$APPTAINER_BINDPATH" apptainer "$@" diff --git a/lima/bin/docker.lima b/lima/bin/docker.lima new file mode 100755 index 0000000..b17ac3b --- /dev/null +++ b/lima/bin/docker.lima @@ -0,0 +1,21 @@ +#!/bin/sh +set -eu +: "${LIMA_INSTANCE:=docker}" +: "${DOCKER:=docker}" + +if [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then + echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl create --name=$LIMA_INSTANCE template://docker\` to create a new instance" >&2 + exit 1 +elif [ "$(limactl ls -f '{{ .Status }}' "$LIMA_INSTANCE" 2>/dev/null)" != "Running" ]; then + echo "instance \"$LIMA_INSTANCE\" is not running, run \`limactl start $LIMA_INSTANCE\` to start the existing instance" >&2 + exit 1 +fi +DOCKER=$(command -v "$DOCKER" || true) +if [ -n "$DOCKER" ]; then + DOCKER_HOST=$(limactl list "$LIMA_INSTANCE" --format 'unix://{{.Dir}}/sock/docker.sock') + export DOCKER_HOST + exec "$DOCKER" "$@" +else + export LIMA_INSTANCE + exec lima docker "$@" +fi diff --git a/lima/bin/kubectl.lima b/lima/bin/kubectl.lima new file mode 100755 index 0000000..70236ad --- /dev/null +++ b/lima/bin/kubectl.lima @@ -0,0 +1,37 @@ +#!/bin/sh +set -eu +: "${LIMA_INSTANCE:=}" +: "${KUBECTL:=kubectl}" + +if [ -z "$LIMA_INSTANCE" ]; then + if [ "$(limactl ls -q k3s 2>/dev/null)" = "k3s" ]; then + LIMA_INSTANCE=k3s + elif [ "$(limactl ls -q k8s 2>/dev/null)" = "k8s" ]; then + LIMA_INSTANCE=k8s + else + echo "No k3s or k8s existing instances found. Either create one with" >&2 + echo "limactl create --name=k3s template://k3s" >&2 + echo "limactl create --name=k8s template://k8s" >&2 + echo "or set LIMA_INSTANCE to the name of your Kubernetes instance" >&2 + exit 1 + fi + if [ "$(limactl ls -f '{{.Status}}' "$LIMA_INSTANCE" 2>/dev/null)" != "Running" ]; then + echo "instance \"$LIMA_INSTANCE\" is not running, run \`limactl start $LIMA_INSTANCE\` to start the existing instance" >&2 + exit 1 + fi +elif [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then + echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl create --name=$LIMA_INSTANCE\` to create a new instance" >&2 + exit 1 +elif [ "$(limactl ls -f '{{ .Status }}' "$LIMA_INSTANCE" 2>/dev/null)" != "Running" ]; then + echo "instance \"$LIMA_INSTANCE\" is not running, run \`limactl start $LIMA_INSTANCE\` to start the existing instance" >&2 + exit 1 +fi +KUBECTL=$(command -v "$KUBECTL" || true) +if [ -n "$KUBECTL" ]; then + KUBECONFIG=$(limactl list "$LIMA_INSTANCE" --format '{{.Dir}}/copied-from-guest/kubeconfig.yaml') + export KUBECONFIG + exec "$KUBECTL" "$@" +else + export LIMA_INSTANCE + exec lima sudo kubectl "$@" +fi diff --git a/lima/bin/lima b/lima/bin/lima new file mode 100755 index 0000000..b78c454 --- /dev/null +++ b/lima/bin/lima @@ -0,0 +1,36 @@ +#!/bin/sh +set -eu +: "${LIMA_INSTANCE:=default}" +: "${LIMA_SHELL:=}" +: "${LIMA_WORKDIR:=}" +: "${LIMACTL:=limactl}" + +if [ "$#" -eq 1 ]; then + if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + base="$(basename "$0")" + echo "Usage: ${base} [COMMAND...]" + echo + echo "${base} is an alias for \"${LIMACTL} shell ${LIMA_INSTANCE}\"." + echo "The instance name (\"${LIMA_INSTANCE}\") can be changed by specifying \$LIMA_INSTANCE." + echo + echo "The shell and initial workdir inside the instance can be specified via \$LIMA_SHELL" + echo "and \$LIMA_WORKDIR." + echo + echo "See \`${LIMACTL} shell --help\` for further information." + exit 0 + elif [ "$1" = "-v" ] || [ "$1" = "--version" ]; then + exec "$LIMACTL" "$@" + fi +fi + +set - "$LIMA_INSTANCE" "$@" +if [ -n "${LIMA_SHELL}" ]; then + set - --shell "$LIMA_SHELL" "$@" +fi +if [ -n "${LIMA_WORKDIR}" ]; then + set - --workdir "$LIMA_WORKDIR" "$@" +fi +# Avoid converting paths with MSYS2 +MSYS2_ARG_CONV_EXCL="*" +export MSYS2_ARG_CONV_EXCL +exec "$LIMACTL" shell "$@" diff --git a/lima/bin/limactl b/lima/bin/limactl new file mode 100755 index 0000000..93546f7 Binary files /dev/null and b/lima/bin/limactl differ diff --git a/lima/bin/nerdctl.lima b/lima/bin/nerdctl.lima new file mode 100755 index 0000000..230514b --- /dev/null +++ b/lima/bin/nerdctl.lima @@ -0,0 +1,3 @@ +#!/bin/sh +set -eu +exec lima nerdctl "$@" diff --git a/lima/bin/podman.lima b/lima/bin/podman.lima new file mode 100755 index 0000000..b05d23b --- /dev/null +++ b/lima/bin/podman.lima @@ -0,0 +1,21 @@ +#!/bin/sh +set -eu +: "${LIMA_INSTANCE:=podman}" +: "${PODMAN:=podman}" + +if [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then + echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl create --name=$LIMA_INSTANCE template://podman\` to create a new instance" >&2 + exit 1 +elif [ "$(limactl ls -f '{{ .Status }}' "$LIMA_INSTANCE" 2>/dev/null)" != "Running" ]; then + echo "instance \"$LIMA_INSTANCE\" is not running, run \`limactl start $LIMA_INSTANCE\` to start the existing instance" >&2 + exit 1 +fi +PODMAN=$(command -v "$PODMAN" || true) +if [ -n "$PODMAN" ]; then + CONTAINER_HOST=$(limactl list "$LIMA_INSTANCE" --format 'unix://{{.Dir}}/sock/podman.sock') + export CONTAINER_HOST + exec "$PODMAN" --remote "$@" +else + export LIMA_INSTANCE + exec lima podman "$@" +fi diff --git a/lima/etc/.DS_Store b/lima/etc/.DS_Store new file mode 100644 index 0000000..8c4545c Binary files /dev/null and b/lima/etc/.DS_Store differ diff --git a/lima/etc/bash_completion.d/limactl b/lima/etc/bash_completion.d/limactl new file mode 100644 index 0000000..088ef66 --- /dev/null +++ b/lima/etc/bash_completion.d/limactl @@ -0,0 +1,338 @@ +# bash completion V2 for limactl -*- shell-script -*- + +__limactl_debug() +{ + if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then + echo "$*" >> "${BASH_COMP_DEBUG_FILE}" + fi +} + +# Macs have bash3 for which the bash-completion package doesn't include +# _init_completion. This is a minimal version of that function. +__limactl_init_completion() +{ + COMPREPLY=() + _get_comp_words_by_ref "$@" cur prev words cword +} + +# This function calls the limactl program to obtain the completion +# results and the directive. It fills the 'out' and 'directive' vars. +__limactl_get_completion_results() { + local requestComp lastParam lastChar args + + # Prepare the command to request completions for the program. + # Calling ${words[0]} instead of directly limactl allows handling aliases + args=("${words[@]:1}") + requestComp="${words[0]} __complete ${args[*]}" + + lastParam=${words[$((${#words[@]}-1))]} + lastChar=${lastParam:$((${#lastParam}-1)):1} + __limactl_debug "lastParam ${lastParam}, lastChar ${lastChar}" + + if [[ -z ${cur} && ${lastChar} != = ]]; then + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go method. + __limactl_debug "Adding extra empty parameter" + requestComp="${requestComp} ''" + fi + + # When completing a flag with an = (e.g., limactl -n=) + # bash focuses on the part after the =, so we need to remove + # the flag part from $cur + if [[ ${cur} == -*=* ]]; then + cur="${cur#*=}" + fi + + __limactl_debug "Calling ${requestComp}" + # Use eval to handle any environment variables and such + out=$(eval "${requestComp}" 2>/dev/null) + + # Extract the directive integer at the very end of the output following a colon (:) + directive=${out##*:} + # Remove the directive + out=${out%:*} + if [[ ${directive} == "${out}" ]]; then + # There is not directive specified + directive=0 + fi + __limactl_debug "The completion directive is: ${directive}" + __limactl_debug "The completions are: ${out}" +} + +__limactl_process_completion_results() { + local shellCompDirectiveError=1 + local shellCompDirectiveNoSpace=2 + local shellCompDirectiveNoFileComp=4 + local shellCompDirectiveFilterFileExt=8 + local shellCompDirectiveFilterDirs=16 + local shellCompDirectiveKeepOrder=32 + + if (((directive & shellCompDirectiveError) != 0)); then + # Error code. No completion. + __limactl_debug "Received error from custom completion go code" + return + else + if (((directive & shellCompDirectiveNoSpace) != 0)); then + if [[ $(type -t compopt) == builtin ]]; then + __limactl_debug "Activating no space" + compopt -o nospace + else + __limactl_debug "No space directive not supported in this version of bash" + fi + fi + if (((directive & shellCompDirectiveKeepOrder) != 0)); then + if [[ $(type -t compopt) == builtin ]]; then + # no sort isn't supported for bash less than < 4.4 + if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then + __limactl_debug "No sort directive not supported in this version of bash" + else + __limactl_debug "Activating keep order" + compopt -o nosort + fi + else + __limactl_debug "No sort directive not supported in this version of bash" + fi + fi + if (((directive & shellCompDirectiveNoFileComp) != 0)); then + if [[ $(type -t compopt) == builtin ]]; then + __limactl_debug "Activating no file completion" + compopt +o default + else + __limactl_debug "No file completion directive not supported in this version of bash" + fi + fi + fi + + # Separate activeHelp from normal completions + local completions=() + local activeHelp=() + __limactl_extract_activeHelp + + if (((directive & shellCompDirectiveFilterFileExt) != 0)); then + # File extension filtering + local fullFilter filter filteringCmd + + # Do not use quotes around the $completions variable or else newline + # characters will be kept. + for filter in ${completions[*]}; do + fullFilter+="$filter|" + done + + filteringCmd="_filedir $fullFilter" + __limactl_debug "File filtering command: $filteringCmd" + $filteringCmd + elif (((directive & shellCompDirectiveFilterDirs) != 0)); then + # File completion for directories only + + local subdir + subdir=${completions[0]} + if [[ -n $subdir ]]; then + __limactl_debug "Listing directories in $subdir" + pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return + else + __limactl_debug "Listing directories in ." + _filedir -d + fi + else + __limactl_handle_completion_types + fi + + __limactl_handle_special_char "$cur" : + __limactl_handle_special_char "$cur" = + + # Print the activeHelp statements before we finish + if ((${#activeHelp[*]} != 0)); then + printf "\n"; + printf "%s\n" "${activeHelp[@]}" + printf "\n" + + # The prompt format is only available from bash 4.4. + # We test if it is available before using it. + if (x=${PS1@P}) 2> /dev/null; then + printf "%s" "${PS1@P}${COMP_LINE[@]}" + else + # Can't print the prompt. Just print the + # text the user had typed, it is workable enough. + printf "%s" "${COMP_LINE[@]}" + fi + fi +} + +# Separate activeHelp lines from real completions. +# Fills the $activeHelp and $completions arrays. +__limactl_extract_activeHelp() { + local activeHelpMarker="_activeHelp_ " + local endIndex=${#activeHelpMarker} + + while IFS='' read -r comp; do + if [[ ${comp:0:endIndex} == $activeHelpMarker ]]; then + comp=${comp:endIndex} + __limactl_debug "ActiveHelp found: $comp" + if [[ -n $comp ]]; then + activeHelp+=("$comp") + fi + else + # Not an activeHelp line but a normal completion + completions+=("$comp") + fi + done <<<"${out}" +} + +__limactl_handle_completion_types() { + __limactl_debug "__limactl_handle_completion_types: COMP_TYPE is $COMP_TYPE" + + case $COMP_TYPE in + 37|42) + # Type: menu-complete/menu-complete-backward and insert-completions + # If the user requested inserting one completion at a time, or all + # completions at once on the command-line we must remove the descriptions. + # https://github.com/spf13/cobra/issues/1508 + local tab=$'\t' comp + while IFS='' read -r comp; do + [[ -z $comp ]] && continue + # Strip any description + comp=${comp%%$tab*} + # Only consider the completions that match + if [[ $comp == "$cur"* ]]; then + COMPREPLY+=("$comp") + fi + done < <(printf "%s\n" "${completions[@]}") + ;; + + *) + # Type: complete (normal completion) + __limactl_handle_standard_completion_case + ;; + esac +} + +__limactl_handle_standard_completion_case() { + local tab=$'\t' comp + + # Short circuit to optimize if we don't have descriptions + if [[ "${completions[*]}" != *$tab* ]]; then + IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur") + return 0 + fi + + local longest=0 + local compline + # Look for the longest completion so that we can format things nicely + while IFS='' read -r compline; do + [[ -z $compline ]] && continue + # Strip any description before checking the length + comp=${compline%%$tab*} + # Only consider the completions that match + [[ $comp == "$cur"* ]] || continue + COMPREPLY+=("$compline") + if ((${#comp}>longest)); then + longest=${#comp} + fi + done < <(printf "%s\n" "${completions[@]}") + + # If there is a single completion left, remove the description text + if ((${#COMPREPLY[*]} == 1)); then + __limactl_debug "COMPREPLY[0]: ${COMPREPLY[0]}" + comp="${COMPREPLY[0]%%$tab*}" + __limactl_debug "Removed description from single completion, which is now: ${comp}" + COMPREPLY[0]=$comp + else # Format the descriptions + __limactl_format_comp_descriptions $longest + fi +} + +__limactl_handle_special_char() +{ + local comp="$1" + local char=$2 + if [[ "$comp" == *${char}* && "$COMP_WORDBREAKS" == *${char}* ]]; then + local word=${comp%"${comp##*${char}}"} + local idx=${#COMPREPLY[*]} + while ((--idx >= 0)); do + COMPREPLY[idx]=${COMPREPLY[idx]#"$word"} + done + fi +} + +__limactl_format_comp_descriptions() +{ + local tab=$'\t' + local comp desc maxdesclength + local longest=$1 + + local i ci + for ci in ${!COMPREPLY[*]}; do + comp=${COMPREPLY[ci]} + # Properly format the description string which follows a tab character if there is one + if [[ "$comp" == *$tab* ]]; then + __limactl_debug "Original comp: $comp" + desc=${comp#*$tab} + comp=${comp%%$tab*} + + # $COLUMNS stores the current shell width. + # Remove an extra 4 because we add 2 spaces and 2 parentheses. + maxdesclength=$(( COLUMNS - longest - 4 )) + + # Make sure we can fit a description of at least 8 characters + # if we are to align the descriptions. + if ((maxdesclength > 8)); then + # Add the proper number of spaces to align the descriptions + for ((i = ${#comp} ; i < longest ; i++)); do + comp+=" " + done + else + # Don't pad the descriptions so we can fit more text after the completion + maxdesclength=$(( COLUMNS - ${#comp} - 4 )) + fi + + # If there is enough space for any description text, + # truncate the descriptions that are too long for the shell width + if ((maxdesclength > 0)); then + if ((${#desc} > maxdesclength)); then + desc=${desc:0:$(( maxdesclength - 1 ))} + desc+="…" + fi + comp+=" ($desc)" + fi + COMPREPLY[ci]=$comp + __limactl_debug "Final comp: $comp" + fi + done +} + +__start_limactl() +{ + local cur prev words cword split + + COMPREPLY=() + + # Call _init_completion from the bash-completion package + # to prepare the arguments properly + if declare -F _init_completion >/dev/null 2>&1; then + _init_completion -n =: || return + else + __limactl_init_completion -n =: || return + fi + + __limactl_debug + __limactl_debug "========= starting completion logic ==========" + __limactl_debug "cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}, cword is $cword" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $cword location, so we need + # to truncate the command-line ($words) up to the $cword location. + words=("${words[@]:0:$cword+1}") + __limactl_debug "Truncated words[*]: ${words[*]}," + + local out directive + __limactl_get_completion_results + __limactl_process_completion_results +} + +if [[ $(type -t compopt) = "builtin" ]]; then + complete -o default -F __start_limactl limactl +else + complete -o default -o nospace -F __start_limactl limactl +fi + +# ex: ts=4 sw=4 et filetype=sh diff --git a/lima/sbom.spdx.json b/lima/sbom.spdx.json new file mode 100644 index 0000000..09350a8 --- /dev/null +++ b/lima/sbom.spdx.json @@ -0,0 +1,1110 @@ +{ + "SPDXID": "SPDXRef-DOCUMENT", + "spdxVersion": "SPDX-2.3", + "name": "SBOM-SPDX-lima-0.22.0", + "creationInfo": { + "created": "2024-05-25 22:11:36 UTC", + "creators": [ + "Tool: https://github.com/homebrew/brew@4.3.1" + ] + }, + "dataLicense": "CC0-1.0", + "documentNamespace": "https://formulae.brew.sh/spdx/lima-0.22.0.json", + "documentDescribes": [ + "SPDXRef-Archive-lima-src", + "SPDXRef-Package-SPDXRef-capstone-5.0.1", + "SPDXRef-Package-SPDXRef-dtc-1.7.0", + "SPDXRef-Package-SPDXRef-pcre2-10.43", + "SPDXRef-Package-SPDXRef-mpdecimal-4.0.0", + "SPDXRef-Package-SPDXRef-ca-certificates-2024-03-11", + "SPDXRef-Package-SPDXRef-openssl@3-3.3.0", + "SPDXRef-Package-SPDXRef-readline-8.2.10", + "SPDXRef-Package-SPDXRef-sqlite-3.45.3", + "SPDXRef-Package-SPDXRef-xz-5.4.6", + "SPDXRef-Package-SPDXRef-python@3.12-3.12.3", + "SPDXRef-Package-SPDXRef-gettext-0.22.5", + "SPDXRef-Package-SPDXRef-glib-2.80.2", + "SPDXRef-Package-SPDXRef-gmp-6.3.0", + "SPDXRef-Package-SPDXRef-libunistring-1.2", + "SPDXRef-Package-SPDXRef-libidn2-2.3.7", + "SPDXRef-Package-SPDXRef-libtasn1-4.19.0", + "SPDXRef-Package-SPDXRef-nettle-3.9.1", + "SPDXRef-Package-SPDXRef-p11-kit-0.25.3", + "SPDXRef-Package-SPDXRef-libevent-2.1.12_1", + "SPDXRef-Package-SPDXRef-libnghttp2-1.61.0", + "SPDXRef-Package-SPDXRef-unbound-1.20.0", + "SPDXRef-Package-SPDXRef-gnutls-3.8.4", + "SPDXRef-Package-SPDXRef-jpeg-turbo-3.0.3", + "SPDXRef-Package-SPDXRef-libpng-1.6.43", + "SPDXRef-Package-SPDXRef-libslirp-4.8.0", + "SPDXRef-Package-SPDXRef-libssh-0.10.6", + "SPDXRef-Package-SPDXRef-libusb-1.0.27", + "SPDXRef-Package-SPDXRef-lzo-2.10", + "SPDXRef-Package-SPDXRef-ncurses-6.5", + "SPDXRef-Package-SPDXRef-pixman-0.42.2", + "SPDXRef-Package-SPDXRef-snappy-1.2.1", + "SPDXRef-Package-SPDXRef-vde-2.3.3", + "SPDXRef-Package-SPDXRef-lz4-1.9.4", + "SPDXRef-Package-SPDXRef-zstd-1.5.6", + "SPDXRef-Package-SPDXRef-qemu-9.0.0", + "SPDXRef-Compiler", + "SPDXRef-Bottle-lima" + ], + "files": [ + + ], + "packages": [ + { + "SPDXID": "SPDXRef-Archive-lima-src", + "name": "lima", + "versionInfo": "0.22.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "builtDate": "2024-05-07 03:34:10 UTC", + "licenseConcluded": "Apache-2.0", + "downloadLocation": "https://github.com/lima-vm/lima/archive/refs/tags/v0.22.0.tar.gz", + "copyrightText": "NOASSERTION", + "externalRefs": [ + + ], + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "9ea5b439cf71bb8fc4d831c3a71540baaa4c4420152addf1e32de57a4dc8af96" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-capstone-5.0.1", + "name": "capstone", + "versionInfo": "5.0.1", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/capstone/blobs/sha256:667f0e0d8960724b71c950ccc7769e747269b828c9e1c90009dc5708d285a941", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "667f0e0d8960724b71c950ccc7769e747269b828c9e1c90009dc5708d285a941" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/capstone@5.0.1", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-dtc-1.7.0", + "name": "dtc", + "versionInfo": "1.7.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-2.0-or-later or BSD-2-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/dtc/blobs/sha256:a37a3658ee16c9b0428449ef970b771161f3f36b8f223276401277ebb582af57", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "a37a3658ee16c9b0428449ef970b771161f3f36b8f223276401277ebb582af57" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/dtc@1.7.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-pcre2-10.43", + "name": "pcre2", + "versionInfo": "10.43", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/pcre2/blobs/sha256:45c605d79f321f1afcab9192841fb6440f97693440ed6ccb8242edb3118303f3", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "45c605d79f321f1afcab9192841fb6440f97693440ed6ccb8242edb3118303f3" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/pcre2@10.43", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-mpdecimal-4.0.0", + "name": "mpdecimal", + "versionInfo": "4.0.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-2-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/mpdecimal/blobs/sha256:2965eec8a30f462b3bd6a8cc2756c1645e75f4399471594e434e36e886239e2e", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "2965eec8a30f462b3bd6a8cc2756c1645e75f4399471594e434e36e886239e2e" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/mpdecimal@4.0.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-ca-certificates-2024-03-11", + "name": "ca-certificates", + "versionInfo": "2024-03-11", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "MPL-2.0", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:cab828953672906e00a8f25db751977b8dc4115f021f8dfe82b644ade03dacdb", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "cab828953672906e00a8f25db751977b8dc4115f021f8dfe82b644ade03dacdb" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/ca-certificates@2024-03-11", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-openssl@3-3.3.0", + "name": "openssl@3", + "versionInfo": "3.3.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "Apache-2.0", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:ec6f9daf8e32d96f4a2f4cd56d18533ee47bb8d9e7cb3d832ac64115d8a1a4ca", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "ec6f9daf8e32d96f4a2f4cd56d18533ee47bb8d9e7cb3d832ac64115d8a1a4ca" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/openssl@3@3.3.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-readline-8.2.10", + "name": "readline", + "versionInfo": "8.2.10", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-3.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/readline/blobs/sha256:713fd1fa8544426b7e97eb21d13153195fea4c407db8a174bd183777b81c9192", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "713fd1fa8544426b7e97eb21d13153195fea4c407db8a174bd183777b81c9192" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/readline@8.2.10", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-sqlite-3.45.3", + "name": "sqlite", + "versionInfo": "3.45.3", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "blessing", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:253a7732af34b28f992072e84d9977d511844a0ebd238e94a5cb2f3fe254604c", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "253a7732af34b28f992072e84d9977d511844a0ebd238e94a5cb2f3fe254604c" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/sqlite@3.45.3", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-xz-5.4.6", + "name": "xz", + "versionInfo": "5.4.6", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "Public Domain and GPL-2.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/xz/blobs/sha256:01ced87d92d0c1131c069108efb14f6940f9e528e2d044ac41d9a0d8f5169f2e", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "01ced87d92d0c1131c069108efb14f6940f9e528e2d044ac41d9a0d8f5169f2e" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/xz@5.4.6", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-python@3.12-3.12.3", + "name": "python@3.12", + "versionInfo": "3.12.3", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "Python-2.0", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/python/3.12/blobs/sha256:fd301f96783de7d57e8d704ca0967e5cf111350acbf1ad8bec36fa27bb75fc3c", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "fd301f96783de7d57e8d704ca0967e5cf111350acbf1ad8bec36fa27bb75fc3c" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/python@3.12@3.12.3", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-gettext-0.22.5", + "name": "gettext", + "versionInfo": "0.22.5", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-3.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/gettext/blobs/sha256:4b5b6cb0692b4606b9220fcbc9da3ab546234348dc87ef8033830e22c4c7bdb1", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "4b5b6cb0692b4606b9220fcbc9da3ab546234348dc87ef8033830e22c4c7bdb1" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/gettext@0.22.5", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-glib-2.80.2", + "name": "glib", + "versionInfo": "2.80.2", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "LGPL-2.1-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/glib/blobs/sha256:4bbd69fd99b5e0123f90c4eaa5e5b5b4c5270873c18b8cb21f83da4f82006380", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "4bbd69fd99b5e0123f90c4eaa5e5b5b4c5270873c18b8cb21f83da4f82006380" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/glib@2.80.2", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-gmp-6.3.0", + "name": "gmp", + "versionInfo": "6.3.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "LGPL-3.0-or-later or GPL-2.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/gmp/blobs/sha256:78e4f40cba6419cf7e2d81e9c945d1e93744511bd5230bdfac1b69ed894914b4", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "78e4f40cba6419cf7e2d81e9c945d1e93744511bd5230bdfac1b69ed894914b4" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/gmp@6.3.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libunistring-1.2", + "name": "libunistring", + "versionInfo": "1.2", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-2.0-only or LGPL-3.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libunistring/blobs/sha256:4a1c0f956e528e0fe9a5040da6a2002e221024835916fdc198b5d734e3c2638d", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "4a1c0f956e528e0fe9a5040da6a2002e221024835916fdc198b5d734e3c2638d" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libunistring@1.2", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libidn2-2.3.7", + "name": "libidn2", + "versionInfo": "2.3.7", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-2.0-or-later or LGPL-3.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libidn2/blobs/sha256:670f6ed3768acde8ce10b5dcfc88fef69cea994ff84491b253a5e818cd4f9a1b", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "670f6ed3768acde8ce10b5dcfc88fef69cea994ff84491b253a5e818cd4f9a1b" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libidn2@2.3.7", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libtasn1-4.19.0", + "name": "libtasn1", + "versionInfo": "4.19.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "LGPL-2.1-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libtasn1/blobs/sha256:975eaba8f266020c3c82a667a0e693a1c6b1f76e317a95bb79b6906fd248bcc5", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "975eaba8f266020c3c82a667a0e693a1c6b1f76e317a95bb79b6906fd248bcc5" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libtasn1@4.19.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-nettle-3.9.1", + "name": "nettle", + "versionInfo": "3.9.1", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-2.0-or-later or LGPL-3.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/nettle/blobs/sha256:8421b1b1c642a639028f71f23939bdb56a2a8d331f3f3f1cac1bd8866d540d4d", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "8421b1b1c642a639028f71f23939bdb56a2a8d331f3f3f1cac1bd8866d540d4d" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/nettle@3.9.1", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-p11-kit-0.25.3", + "name": "p11-kit", + "versionInfo": "0.25.3", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/p11-kit/blobs/sha256:cd5ef135c54d2a312c17af15e9f3c807b3b37a65388b64a35a4d215b54745789", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "cd5ef135c54d2a312c17af15e9f3c807b3b37a65388b64a35a4d215b54745789" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/p11-kit@0.25.3", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libevent-2.1.12_1", + "name": "libevent", + "versionInfo": "2.1.12_1", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libevent/blobs/sha256:38a3eb3510a7e0cd4096e4592d0095c562eb1bbad572d951f1923009a14ad702", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "38a3eb3510a7e0cd4096e4592d0095c562eb1bbad572d951f1923009a14ad702" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libevent@2.1.12_1", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libnghttp2-1.61.0", + "name": "libnghttp2", + "versionInfo": "1.61.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "MIT", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libnghttp2/blobs/sha256:6bd6cd9fad916829f98adbd9823545a09b0c147475cb4aa3caaa1f3a9e8104e0", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "6bd6cd9fad916829f98adbd9823545a09b0c147475cb4aa3caaa1f3a9e8104e0" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libnghttp2@1.61.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-unbound-1.20.0", + "name": "unbound", + "versionInfo": "1.20.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/unbound/blobs/sha256:d747e30c1da19b82c8009e624fda911469d67d107cdcba6ff6686190f5b52928", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "d747e30c1da19b82c8009e624fda911469d67d107cdcba6ff6686190f5b52928" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/unbound@1.20.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-gnutls-3.8.4", + "name": "gnutls", + "versionInfo": "3.8.4", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "LGPL-2.1-or-later and GPL-3.0-only", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/gnutls/blobs/sha256:46373a7206cc70289bfef2081508c62cc74a2589060b21ce26c44c4c86fbda41", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "46373a7206cc70289bfef2081508c62cc74a2589060b21ce26c44c4c86fbda41" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/gnutls@3.8.4", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-jpeg-turbo-3.0.3", + "name": "jpeg-turbo", + "versionInfo": "3.0.3", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "IJG", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/jpeg-turbo/blobs/sha256:9ea422966185251d1073ba0f4a75c34b4ec497fc7819ea8de80f69fe8e6be18d", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "9ea422966185251d1073ba0f4a75c34b4ec497fc7819ea8de80f69fe8e6be18d" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/jpeg-turbo@3.0.3", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libpng-1.6.43", + "name": "libpng", + "versionInfo": "1.6.43", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "libpng-2.0", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libpng/blobs/sha256:37936ba5cd5a1e736908a26fd2a944e04d86694a55f99fe5e173bfacac90e2e8", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "37936ba5cd5a1e736908a26fd2a944e04d86694a55f99fe5e173bfacac90e2e8" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libpng@1.6.43", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libslirp-4.8.0", + "name": "libslirp", + "versionInfo": "4.8.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libslirp/blobs/sha256:6c4d57761e16cc3a1cd0a9c02147d28072e80159d38bdb90216e980d51deb265", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "6c4d57761e16cc3a1cd0a9c02147d28072e80159d38bdb90216e980d51deb265" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libslirp@4.8.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libssh-0.10.6", + "name": "libssh", + "versionInfo": "0.10.6", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "LGPL-2.1-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libssh/blobs/sha256:f46550586eea1bbce8a418c9ce7621909aaad4b96d98004289ea12ccd4593201", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "f46550586eea1bbce8a418c9ce7621909aaad4b96d98004289ea12ccd4593201" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libssh@0.10.6", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-libusb-1.0.27", + "name": "libusb", + "versionInfo": "1.0.27", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "LGPL-2.1-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/libusb/blobs/sha256:fff3e66328455513a887dd4e8043a13a1213035f7e4a757d4fdf93f9815ffd1d", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "fff3e66328455513a887dd4e8043a13a1213035f7e4a757d4fdf93f9815ffd1d" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/libusb@1.0.27", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-lzo-2.10", + "name": "lzo", + "versionInfo": "2.10", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-2.0-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/lzo/blobs/sha256:167749edd2052e4c577f27c79a41eb1cb4b79302b1e4bef1e4cfb29bd50aedd9", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "167749edd2052e4c577f27c79a41eb1cb4b79302b1e4bef1e4cfb29bd50aedd9" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/lzo@2.10", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-ncurses-6.5", + "name": "ncurses", + "versionInfo": "6.5", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "MIT", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/ncurses/blobs/sha256:ee5253473badfa0701deac8e9973a7358c761dd287f0d748f753130a7a6d2705", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "ee5253473badfa0701deac8e9973a7358c761dd287f0d748f753130a7a6d2705" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/ncurses@6.5", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-pixman-0.42.2", + "name": "pixman", + "versionInfo": "0.42.2", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "MIT", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/pixman/blobs/sha256:d355a294d3f9152479c2c0905efbeb329aef9cb27b9ae12e2a4ea6a4f41f2174", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "d355a294d3f9152479c2c0905efbeb329aef9cb27b9ae12e2a4ea6a4f41f2174" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/pixman@0.42.2", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-snappy-1.2.1", + "name": "snappy", + "versionInfo": "1.2.1", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/snappy/blobs/sha256:2b905dfed7d6c0b44de9c89a79a6aa69824758c2727dcffe95bc6ebef465cf3f", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "2b905dfed7d6c0b44de9c89a79a6aa69824758c2727dcffe95bc6ebef465cf3f" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/snappy@1.2.1", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-vde-2.3.3", + "name": "vde", + "versionInfo": "2.3.3", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-2.0-or-later and LGPL-2.1-or-later", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/vde/blobs/sha256:3d2231810ad7229ba6a68178d648ab1f13bdfe50b214cb2d299d644d66e03762", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "3d2231810ad7229ba6a68178d648ab1f13bdfe50b214cb2d299d644d66e03762" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/vde@2.3.3", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-lz4-1.9.4", + "name": "lz4", + "versionInfo": "1.9.4", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-2-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/lz4/blobs/sha256:5a8b7116d978e403c525e61794c60b43480d0afc83e499a763f7f14641bbc9b1", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "5a8b7116d978e403c525e61794c60b43480d0afc83e499a763f7f14641bbc9b1" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/lz4@1.9.4", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-zstd-1.5.6", + "name": "zstd", + "versionInfo": "1.5.6", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "BSD-3-Clause", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/zstd/blobs/sha256:2028141683f55bffcd0693b9e49eef1e3dabc1e184214cacb173ca9bd54dabc0", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "2028141683f55bffcd0693b9e49eef1e3dabc1e184214cacb173ca9bd54dabc0" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/zstd@1.5.6", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Package-SPDXRef-qemu-9.0.0", + "name": "qemu", + "versionInfo": "9.0.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "GPL-2.0-only", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/qemu/blobs/sha256:8a28629a57bbfb6006e269d4cc8554c2481d2e725ca670f94c8a71feb95635d7", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "8a28629a57bbfb6006e269d4cc8554c2481d2e725ca670f94c8a71feb95635d7" + } + ], + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/qemu@9.0.0", + "referenceType": "purl" + } + ] + }, + { + "SPDXID": "SPDXRef-Compiler", + "name": "clang", + "versionInfo": "15.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION", + "downloadLocation": "NOASSERTION", + "checksums": [ + + ], + "externalRefs": [ + + ] + }, + { + "SPDXID": "SPDXRef-Bottle-lima", + "name": "lima", + "versionInfo": "0.22.0", + "filesAnalyzed": false, + "licenseDeclared": "NOASSERTION", + "builtDate": "2024-05-07 03:34:10 UTC", + "licenseConcluded": "Apache-2.0", + "downloadLocation": "https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:31c8d1a5164f001587f3f31c23351bba4f8699c0354c21e7f5ec239b03333149", + "copyrightText": "NOASSERTION", + "externalRefs": [ + { + "referenceCategory": "PACKAGE-MANAGER", + "referenceLocator": "pkg:brew/homebrew/core/lima@0.22.0", + "referenceType": "purl" + } + ], + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "31c8d1a5164f001587f3f31c23351bba4f8699c0354c21e7f5ec239b03333149" + } + ] + } + ], + "relationships": [ + { + "spdxElementId": "SPDXRef-Package-SPDXRef-capstone-5.0.1", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-dtc-1.7.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-pcre2-10.43", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-mpdecimal-4.0.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-ca-certificates-2024-03-11", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-openssl@3-3.3.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-readline-8.2.10", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-sqlite-3.45.3", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-xz-5.4.6", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-python@3.12-3.12.3", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-gettext-0.22.5", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-glib-2.80.2", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-gmp-6.3.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libunistring-1.2", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libidn2-2.3.7", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libtasn1-4.19.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-nettle-3.9.1", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-p11-kit-0.25.3", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libevent-2.1.12_1", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libnghttp2-1.61.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-unbound-1.20.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-gnutls-3.8.4", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-jpeg-turbo-3.0.3", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libpng-1.6.43", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libslirp-4.8.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libssh-0.10.6", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-libusb-1.0.27", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-lzo-2.10", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-ncurses-6.5", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-pixman-0.42.2", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-snappy-1.2.1", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-vde-2.3.3", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-lz4-1.9.4", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-zstd-1.5.6", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-Package-SPDXRef-qemu-9.0.0", + "relationshipType": "RUNTIME_DEPENDENCY_OF", + "relatedSpdxElement": "SPDXRef-Bottle-lima" + }, + { + "spdxElementId": "SPDXRef-File-lima", + "relationshipType": "PACKAGE_OF", + "relatedSpdxElement": "SPDXRef-Archive-lima-src" + }, + { + "spdxElementId": "SPDXRef-Compiler", + "relationshipType": "BUILD_TOOL_OF", + "relatedSpdxElement": "SPDXRef-Package-lima-src" + } + ] +} \ No newline at end of file diff --git a/lima/share/.DS_Store b/lima/share/.DS_Store new file mode 100644 index 0000000..8a76ae6 Binary files /dev/null and b/lima/share/.DS_Store differ diff --git a/lima/share/doc/lima/LICENSE b/lima/share/doc/lima/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/lima/share/doc/lima/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lima/share/doc/lima/MAINTAINERS.md b/lima/share/doc/lima/MAINTAINERS.md new file mode 100644 index 0000000..a13014c --- /dev/null +++ b/lima/share/doc/lima/MAINTAINERS.md @@ -0,0 +1,10 @@ +# Lima maintainers + +| Name | GitHub ID (not Twitter ID) | GPG fingerprint | +|--------------------|------------------------------------------------|------------------------------------------------------------------------------------------| +| Akihiro Suda | [@AkihiroSuda](https://github.com/AkihiroSuda) | [C020 EA87 6CE4 E06C 7AB9 5AEF 4952 4C6F 9F63 8F1A](https://github.com/AkihiroSuda.gpg) | +| Jan Dubois | [@jandubois](https://github.com/jandubois) | | +| Anders F Björklund | [@afbjorklund](https://github.com/afbjorklund) | | +| Balaji Vijayakumar | [@balajiv113](https://github.com/balajiv113) | | + +See https://github.com/lima-vm/.github/blob/main/SECURITY.md for how to report security issues. diff --git a/lima/share/doc/lima/README.ja.md b/lima/share/doc/lima/README.ja.md new file mode 100644 index 0000000..588e3c9 --- /dev/null +++ b/lima/share/doc/lima/README.ja.md @@ -0,0 +1,87 @@ +This is an *informal* translation of [`README.md` (revision 6938ae5f, 2023-Sep-29)](https://github.com/lima-vm/lima/blob/6938ae5fc8eaf1dec9a99011f775e571a37601ec/README.md) in Japanese. +This translation might be out of sync with the English version. +Please refer to the [English `README.md`](README.md) for the latest information. + +[`README.md` (リビジョン 6938ae5f, 2023年09月29日)](https://github.com/lima-vm/lima/blob/6938ae5fc8eaf1dec9a99011f775e571a37601ec/README.md)の *非正式* な日本語訳です。 +英語版からの翻訳が遅れていることがあります。 +最新の情報については[英語版 `README.md`](README.md)をご覧ください。 + +- - - + +[[🌎**ウェブサイト**]](https://lima-vm.io/) +[[📖**ドキュメント**]](https://lima-vm.io/docs/) +[[👤**Slack (`#lima`)**]](https://slack.cncf.io) + + + +# Lima: Linux Machines + +[Lima](https://lima-vm.io/)は自動的なファイル共有とポートフォワード機能つきでLinux仮想マシンを起動します(WSL2と同様)。 + +Limaは、Macユーザへ[nerdctl (contaiNERD ctl)](https://github.com/containerd/nerdctl)を含む[containerd](https://containerd.io)を普及させることを当初の最終目標に据えていました。しかし、Limaではコンテナ化されていないアプリケーションも実行することができます。 + +Limaは他のコンテナエンジン(Docker, Podman, Kubernetes 等)やmacOS以外のホスト(Linux, NetBSD 等)での動作もサポートしています。 + +## はじめの一歩 + +セットアップ (macOSにて): +```bash +brew install lima +limactl start +``` + +Linuxコマンドを実行するには: +```bash +lima sudo apt-get install -y neofetch +lima neofetch +``` + +containerdを用いてコンテナを実行するには: +```bash +lima nerdctl run --rm hello-world +``` + +Dockerを用いてコンテナを実行するには: +```bash +limactl start template://docker +export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock') +docker run --rm hello-world +``` + +Kubernetesを用いてコンテナを実行するには: +```bash +limactl start template://k8s +export KUBECONFIG=$(limactl list k8s --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml') +kubectl apply -f ... +``` + +詳しくは をご覧ください。 + +## コミュニティ + +### 採用者 + +コンテナ環境: +- [Rancher Desktop](https://rancherdesktop.io/): デスクトップで管理できるKubernetesとコンテナ +- [Colima](https://github.com/abiosoft/colima): macOSで小さく始めるDocker(とKubernetes) +- [Finch](https://github.com/runfinch/finch): Finchはローカルでのコンテナ開発用のコマンドラインクライアント +- [Podman Desktop](https://podman-desktop.io/): Podman Desktop GUIにはLimaのプラグインが用意されています + +GUI: +- [Lima xbar plugin](https://github.com/unixorn/lima-xbar-plugin): [xbar](https://xbarapp.com/) メニューバーから仮想マシンを開始・終了でき、稼働状態を確認できるプラグイン +- [lima-gui](https://github.com/afbjorklund/lima-gui): LimaのQt GUI + +### 連絡手段 +- [GitHub Discussions](https://github.com/lima-vm/lima/discussions) +- CNCF Slackの`#lima`チャンネル + - 新規アカウント: + - ログイン: + +### 行動規範 +Limaは[CNCF行動規範](https://github.com/cncf/foundation/blob/master/code-of-conduct.md)に従います。 + +**私たちは [Cloud Native Computing Foundation](https://cncf.io/) sandbox project です。** + + + +The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [Trademark Usage](https://www.linuxfoundation.org/trademark-usage/). diff --git a/lima/share/doc/lima/README.md b/lima/share/doc/lima/README.md new file mode 100644 index 0000000..1e1a645 --- /dev/null +++ b/lima/share/doc/lima/README.md @@ -0,0 +1,81 @@ +[[🌎**Web site**]](https://lima-vm.io/) +[[📖**Documentation**]](https://lima-vm.io/docs/) +[[👤**Slack (`#lima`)**]](https://slack.cncf.io) + + + + Shows a stylized 'Lima' text in bold, modern font + + +# Lima: Linux Machines + +[Lima](https://lima-vm.io/) launches Linux virtual machines with automatic file sharing and port forwarding (similar to WSL2). + +The original goal of Lima was to promote [containerd](https://containerd.io) including [nerdctl (contaiNERD ctl)](https://github.com/containerd/nerdctl) +to Mac users, but Lima can be used for non-container applications as well. + +Lima also supports other container engines (Docker, Podman, Kubernetes, etc.) and non-macOS hosts (Linux, NetBSD, etc.). + +## Getting started +Set up (on macOS): +```bash +brew install lima +limactl start +``` + +To run Linux commands: +```bash +lima sudo apt-get install -y neofetch +lima neofetch +``` + +To run containers with containerd: +```bash +lima nerdctl run --rm hello-world +``` + +To run containers with Docker: +```bash +limactl start template://docker +export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock') +docker run --rm hello-world +``` + +To run containers with Kubernetes: +```bash +limactl start template://k8s +export KUBECONFIG=$(limactl list k8s --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml') +kubectl apply -f ... +``` + +See for the further information. + +## Community + +### Adopters + +Container environments: +- [Rancher Desktop](https://rancherdesktop.io/): Kubernetes and container management to the desktop +- [Colima](https://github.com/abiosoft/colima): Docker (and Kubernetes) on macOS with minimal setup +- [Finch](https://github.com/runfinch/finch): Finch is a command line client for local container development +- [Podman Desktop](https://podman-desktop.io/): Podman Desktop GUI has a plug-in for Lima virtual machines + +GUI: +- [Lima xbar plugin](https://github.com/unixorn/lima-xbar-plugin): [xbar](https://xbarapp.com/) plugin to start/stop VMs from the menu bar and see their running status. +- [lima-gui](https://github.com/afbjorklund/lima-gui): Qt GUI for Lima + +### Communication channels +- [GitHub Discussions](https://github.com/lima-vm/lima/discussions) +- `#lima` channel in the CNCF Slack + - New account: + - Login: + +### Code of Conduct +Lima follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). + +- - - +**We are a [Cloud Native Computing Foundation](https://cncf.io/) sandbox project.** + + + +The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [Trademark Usage](https://www.linuxfoundation.org/trademark-usage/). diff --git a/lima/share/doc/lima/README.zh.md b/lima/share/doc/lima/README.zh.md new file mode 100644 index 0000000..dd45288 --- /dev/null +++ b/lima/share/doc/lima/README.zh.md @@ -0,0 +1,491 @@ +This is an *informal* translation of [`README.md` (revision c1368f45, 2022-Dec-12)](https://github.com/lima-vm/lima/blob/c1368f45d908947dd0828bc5caa00baa4a46be5c/README.md) in Chinese. +This translation might be out of sync with the English version. +Please refer to the [English `README.md`](README.md) for the latest information. + +这是 [`README.md` (修订版 c1368f45, 2022-12-12)](https://github.com/lima-vm/lima/blob/c1368f45d908947dd0828bc5caa00baa4a46be5c/README.md) 的*非正式*中文翻译,与英文版相比可能有所延迟。 +最新情况请查看[英文版 `README.md`](README.md)。 + +[[📖**开始使用**]](#开始使用) +[[❓**FAQs & 疑难解答**]](#faqs--疑难解答) + +![Lima logo](./docs/images/lima-logo-01.svg) + +# Lima: Linux virtual machines (多数情况下在 macOS 上) + +Lima 启动了具有自动文件共享和端口转发功能的 Linux 虚拟机(类似于 WSL2),以及 [containerd](https://containerd.io)。 + +Lima 可以被认为是某种非官方的 "Mac 上的 containerd"。 + +Lima 预期是在 macOS 宿主上使用,但它在 Linux 宿主上也运行良好。 + + +✅ 自动文件共享 + +✅ 自动端口转发 + +✅ 对 [containerd](https://containerd.io) 的内建支持 ([其他的容器引擎也可以使用](./examples)) + +✅ Intel 宿主上的 Intel 虚拟机 + +✅ [Intel 宿主上的 ARM 虚拟机](./docs/multi-arch.md) + +✅ ARM 宿主上的 ARM 虚拟机 + +✅ [ARM 宿主上的 Intel 虚拟机](./docs/multi-arch.md) + +✅ 各种虚拟机 Linux 发行版:[AlmaLinux](./examples/almalinux.yaml),[Alpine](./examples/alpine.yaml),[Arch Linux](./examples/archlinux.yaml),[Debian](./examples/debian.yaml),[Fedora](./examples/fedora.yaml),[openSUSE](./examples/opensuse.yaml),[Oracle Linux](./examples/oraclelinux.yaml),[Rocky](./examples/rocky.yaml),[Ubuntu](./examples/ubuntu.yaml) (默认),…… + +相关项目:[sshocker (带有文件共享和端口转发的 ssh)](https://github.com/lima-vm/sshocker) + +这个项目与 [The Lima driver project (driver for ARM Mali GPUs)](https://gitlab.freedesktop.org/lima) 无关。 + +[Talks](docs/talks.md) 页面包含 Lima 相关会议演讲的幻灯片和视频的链接。 + +## 动机 + +Lima 的目标是向 Mac 用户推广 [containerd](https://containerd.io) (包括 [nerdctl (contaiNERD ctl)](https://github.com/containerd/nerdctl)),但 Lima 也可以用于非容器应用。 + +## 社区 +### 相关项目 + +容器环境: +- [Rancher Desktop](https://rancherdesktop.io/): 在桌面上进行 Kubernetes 和容器的管理 +- [Colima](https://github.com/abiosoft/colima): 用最小化的安装来在 Mac 上使用 Docker (和 Kubernetes) +- [Finch](https://github.com/runfinch/finch): Finch 是一个用于本地容器开发的命令行客户端 + +GUI: +- [Lima xbar 插件](https://github.com/unixorn/lima-xbar-plugin): [xbar](https://xbarapp.com/) 插件用于从菜单栏启动/停止虚拟机并查看它们的运行状态。 +- [lima-gui](https://github.com/afbjorklund/lima-gui): Lima 的 Qt GUI + +### 交流渠道 +- [GitHub Discussions](https://github.com/lima-vm/lima/discussions) +- CNCF Slack 上的 `#lima` 频道 + - 新用户:https://slack.cncf.io/ + - 登录:https://cloud-native.slack.com/ + +### 行为准则 +Lima 遵循 [CNCF 行为准则](https://github.com/cncf/foundation/blob/master/code-of-conduct.md)。 + +## 例子 + +### uname +```console +$ uname -a +Darwin macbook.local 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:47 PDT 2021; root:xnu-7195.101.2~1/RELEASE_X86_64 x86_64 + +$ lima uname -a +Linux lima-default 5.11.0-16-generic #17-Ubuntu SMP Wed Apr 14 20:12:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux + +$ LIMA_INSTANCE=arm lima uname -a +Linux lima-arm 5.11.0-16-generic #17-Ubuntu SMP Wed Apr 14 20:10:16 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux +``` + +请查看 [`./docs/multi-arch.md`](./docs/multi-arch.md),获取 ARM 宿主上的 Intel 虚拟机 和 Intel 宿主上的 ARM 虚拟机 的执行情况。 + +### 在 macOS 和 Linux 之间共享文件 +```console +$ echo "files under /Users on macOS filesystem are readable from Linux" > some-file + +$ lima cat some-file +files under /Users on macOS filesystem are readable from Linux + +$ lima sh -c 'echo "/tmp/lima is writable from both macOS and Linux" > /tmp/lima/another-file' + +$ cat /tmp/lima/another-file +/tmp/lima is writable from both macOS and Linux +``` + +### 运行 containerd 容器 (与 Docker 容器兼容) +```console +$ lima nerdctl run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine +``` + +> 你不用每次都运行 "lima nerdctl",相反,你可以使用特殊的快捷方式 "nerdctl.lima" 来做同样的事情。默认情况下,它将和 Lima 一起安装,所以,你不需要做任何额外的事情。会有一个名为 nerdctl 的符号链接指向 nerdctl.lima。但这只在目录中没有 nerdctl 条目时才会创建。值得一提的是,它只能通过 make install 创建。不包括在 Homebrew/MacPorts/nix 软件包中。 + +在 macOS 和 Linux 都可以通过 http://127.0.0.1:8080 访问。 + +关于如何使用 containerd 和 nerdctl(contaiNERD ctl),请访问 https://github.com/containerd/containerd 和 https://github.com/containerd/nerdctl。 + +## 开始使用 +### 安装 + +可以直接使用 [Homebrew 上的包](https://github.com/Homebrew/homebrew-core/blob/master/Formula/l/lima.rb) 进行安装。 + +```console +brew install lima +``` + +
+手动安装的步骤 +

+ +#### 安装 QEMU + +安装 QEMU 7.0 或更新的版本。 + +#### 安装 Lima + +- 从 https://github.com/lima-vm/lima/releases 下载 Lima 的二进制文件, + 并将其解压到 `/usr/local`(或其他地方)。比如: + +```bash +brew install jq +VERSION=$(curl -fsSL https://api.github.com/repos/lima-vm/lima/releases/latest | jq -r .tag_name) +curl -fsSL "https://github.com/lima-vm/lima/releases/download/${VERSION}/lima-${VERSION:1}-$(uname -s)-$(uname -m).tar.gz" | tar Cxzvm /usr/local +``` + +- 如果想从源码安装 Lima,可以运行 `make && make install`。 + +> **注意** +> Lima 没有定期在 ARM Mac 进行测试(因为缺乏 CI)。 + +

+
+ +### 用法 + +```console +[macOS]$ limactl start +... +INFO[0029] READY. Run `lima` to open the shell. + +[macOS]$ lima uname +Linux +``` + +### 命令含义 + +#### `limactl start` +`limactl start [--name=NAME] [--tty=false] `: 启动 Linux 实例 + +```console +$ limactl start +? Creating an instance "default" [Use arrows to move, type to filter] +> Proceed with the current configuration + Open an editor to review or modify the current configuration + Choose another example (docker, podman, archlinux, fedora, ...) + Exit +... +INFO[0029] READY. Run `lima` to open the shell. +``` + +选择 `Proceed with the current configuration`,然后等待宿主终端上显示 "READY" 。 + +如果想做自动化,`--tty=false` flag 可以禁用用户交互。 + +##### 高级用法 +从 "docker" 模板创建一个 "default" 实例: +```console +$ limactl start --name=default template://docker +``` + +> 注意:`limactl start template://TEMPLATE` 需要 Lima v0.9.0 或更新版本。 +> 老版本应该用 `limactl start /usr/local/share/doc/lima/examples/TEMPLATE.yaml` 替代。 + +查看模板列表: +```console +$ limactl start --list-templates +``` + +从本地文件创建 "default" 实例: +```console +$ limactl start --name=default /usr/local/share/lima/examples/fedora.yaml +``` + +从远程 URL(小心使用,一定要确保来源是可信的)创建 "default" 实例: +```console +$ limactl start --name=default https://raw.githubusercontent.com/lima-vm/lima/master/examples/alpine.yaml +``` + +#### `limactl shell` +`limactl shell `: 在 Linux 上执行 ``。 + +对于 "default" 实例,这条命令可以缩写为 `lima `。 +`lima` 命令也接受环境变量 `$LIMA_INSTANCE` 作为实例名。 + +#### `limactl copy` +`limactl copy ... `: 在实例之间,或者宿主与实例之间复制文件 + +使用 `:` 指定一个实例内的源文件或者目标文件。 + +#### `limactl list` +`limactl list [--json]`: 列出实例 + +#### `limactl stop` +`limactl stop [--force] `: 停止实例 + +#### `limactl delete` +`limactl delete [--force] `: 删除实例 + +#### `limactl factory-reset` +`limactl factory-reset `: 将实例恢复为初始设置 + +#### `limactl edit` +`limactl edit `: 编辑实例 + +#### `limactl disk` + +`limactl disk create --size `: 创建一个要附加到某个实例的外部磁盘 + +`limactl disk delete `: 删除一个已有的磁盘 + +`limactl disk list`: 列出所有已有的磁盘 + +#### `limactl completion` +- 要启用 bash 中的自动补全,添加 `source <(limactl completion bash)` 到 `~/.bash_profile` 内。 + +- 要启用 zsh 中的自动补全,请查看 `limactl completion zsh --help` + +### :warning: 警告:确保做好数据备份 +Lima 可能存在导致数据丢失的 bug。 + +**确保在运行 Lima 前做好数据备份。** + +尤其需要注意的是,以下数据可能很容易丢失: +- 共享可写目录下的数据(默认路径`/tmp/lima`), + 可能在宿主休眠之后发生(比如,在关闭和重新打开笔记本电脑的盖子之后) +- 虚拟机镜像中的数据,绝大部分发生在升级 Lima 的版本时 + +### 配置 + +请参考 [`./examples/default.yaml`](./examples/default.yaml)。 + +当前虚拟机默认配置: +- OS: Ubuntu 22.10 (Kinetic Kudu) +- CPU: 4 cores +- 内存:4 GiB +- 硬盘:100 GiB +- 挂载目录:`~`(只读), `/tmp/lima`(可写) +- SSH: 127.0.0.1:60022 + +## 它是怎么工作的? + +- (系统)管理程序:[QEMU 附带 HVF 加速(默认),或者 Virtualization.framework](./docs/vmtype.md) +- 文件共享:[Reverse SSHFS (默认),或者 virtio-9p-pci 即 virtfs,或者 virtiofs](./docs/mount.md) +- 端口转发:`ssh -L`,通过监视虚拟机的 `/proc/net/tcp` 和 `iptables` 事件来自动化 + +## 开发者指南 + +### 给 Lima 做贡献 +- 请通过 `git commit -s` 来用你的真实姓名签名你的提交, + 以此确认你的 [Developer Certificate of Origin (DCO)](https://developercertificate.org/)。 +- 请合并提交。 + +### 帮助我们 +:pray: +- 文档 +- CLI 用户体验 +- 性能优化 +- Windows 宿主 +- 使用 [vsock](https://github.com/apple/darwin-xnu/blob/xnu-7195.81.3/bsd/man/man4/vsock.4) 替换 SSH(这份工作需要在 QEMU repo 内完成) + +## FAQs & 疑难解答 + + + + +### Generic + +- [普遍问题](#%E6%99%AE%E9%81%8D%E9%97%AE%E9%A2%98) + - ["我的登录密码是什么?"](#%E6%88%91%E7%9A%84%E7%99%BB%E5%BD%95%E5%AF%86%E7%A0%81%E6%98%AF%E4%BB%80%E4%B9%88) + - ["Lima 能在 ARM Mac 上运行吗?"](#lima-%E8%83%BD%E5%9C%A8-arm-mac-%E4%B8%8A%E8%BF%90%E8%A1%8C%E5%90%97) + - ["我能运行非 Ubuntu 虚拟机吗"](#%E6%88%91%E8%83%BD%E8%BF%90%E8%A1%8C%E9%9D%9E-ubuntu-%E8%99%9A%E6%8B%9F%E6%9C%BA%E5%90%97) + - ["我能运行其他容器引擎,比如 Docker 和 Podman 吗?Kubernetes 呢?"](#%E6%88%91%E8%83%BD%E8%BF%90%E8%A1%8C%E5%85%B6%E4%BB%96%E5%AE%B9%E5%99%A8%E5%BC%95%E6%93%8E%E6%AF%94%E5%A6%82-docker-%E5%92%8C-podman-%E5%90%97kubernetes-%E5%91%A2) + - ["我能在远程 Linux 计算机上运行 Lima 吗?"](#%E6%88%91%E8%83%BD%E5%9C%A8%E8%BF%9C%E7%A8%8B-linux-%E8%AE%A1%E7%AE%97%E6%9C%BA%E4%B8%8A%E8%BF%90%E8%A1%8C-lima-%E5%90%97) + - ["与 Docker for Mac 相比有什么优点?"](#%E4%B8%8E-docker-for-mac-%E7%9B%B8%E6%AF%94%E6%9C%89%E4%BB%80%E4%B9%88%E4%BC%98%E7%82%B9) +- [QEMU](#qemu) + - ["QEMU 崩溃,提示 `HV_ERROR`"](#qemu-%E5%B4%A9%E6%BA%83%E6%8F%90%E7%A4%BA-hv_error) + - ["QEMU 很慢"](#qemu-%E5%BE%88%E6%85%A2) + - [错误 "killed -9"](#%E9%94%99%E8%AF%AF-killed--9) + - ["QEMU 崩溃,提示 `vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed`"](#qemu-%E5%B4%A9%E6%BA%83%E6%8F%90%E7%A4%BA-vmx_write_mem-mmu_gva_to_gpa-xxxxxxxxxxxxxxxx-failed) +- [网络](#%E7%BD%91%E7%BB%9C) + - ["从宿主无法访问虚拟机 IP 192.168.5.15"](#%E4%BB%8E%E5%AE%BF%E4%B8%BB%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E8%99%9A%E6%8B%9F%E6%9C%BA-ip-192168515) + - ["Ping 显示重复的数据包和大量的响应时间"](#ping-%E6%98%BE%E7%A4%BA%E9%87%8D%E5%A4%8D%E7%9A%84%E6%95%B0%E6%8D%AE%E5%8C%85%E5%92%8C%E5%A4%A7%E9%87%8F%E7%9A%84%E5%93%8D%E5%BA%94%E6%97%B6%E9%97%B4) +- [文件系统共享](#%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%85%B1%E4%BA%AB) + - ["文件系统很慢"](#%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%BE%88%E6%85%A2) + - ["文件系统不可写"](#%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E4%B8%8D%E5%8F%AF%E5%86%99) +- [外部项目](#%E5%A4%96%E9%83%A8%E9%A1%B9%E7%9B%AE) + - ["我在使用 Rancher Desktop。怎么处理底层的 Lima?"](#%E6%88%91%E5%9C%A8%E4%BD%BF%E7%94%A8-rancher-desktop-%E6%80%8E%E4%B9%88%E5%A4%84%E7%90%86%E5%BA%95%E5%B1%82%E7%9A%84-lima) +- ["调试其他问题还有什么提示吗?"](#%E8%B0%83%E8%AF%95%E5%85%B6%E4%BB%96%E9%97%AE%E9%A2%98%E8%BF%98%E6%9C%89%E4%BB%80%E4%B9%88%E6%8F%90%E7%A4%BA%E5%90%97) + + +### 普遍问题 +#### "我的登录密码是什么?" +默认情况下,密码是被禁用和锁定的。 +你应该执行 `limactl shell bash`(或者 `lima bash`)来打开 shell。 + +还有一种方法,你可以直接 ssh 进虚拟机:`ssh -p 60022 -i ~/.lima/_config/user -o NoHostAuthenticationForLocalhost=yes 127.0.0.1`。 + +#### "Lima 能在 ARM Mac 上运行吗?" +可以的。不过我们没有定期在 ARM 上进行测试(因为缺乏 CI)。 + +#### "我能运行非 Ubuntu 虚拟机吗" +AlmaLinux,Alpine,Arch Linux,Debian,Fedora,openSUSE,Oracle Linux,和 Rocky 都是可以运行的。 +请查看 [`./examples/`](./examples/) 。 + +一个镜像必须满足下面的需求: +- systemd 或者 OpenRC +- cloud-init +- 下面的二进制包应该被预装: + - `sudo` +- 下面的二进制包应该被预装,或者可以通过包管理器安装: + - `sshfs` + - `newuidmap` 和 `newgidmap` +- `apt-get`, `dnf`, `apk`, `pacman`, 或者 `zypper` (如果你想贡献对其他包管理器的支持,请执行 `git grep apt-get` 来确定哪里需要改动) + +#### "我能运行其他容器引擎,比如 Docker 和 Podman 吗?Kubernetes 呢?" +是的,任何容器引擎都可以和 Lima 配合使用。 + +容器运行时例子: +- [`./examples/docker.yaml`](./examples/docker.yaml): Docker +- [`./examples/podman.yaml`](./examples/podman.yaml): Podman +- [`./examples/apptainer.yaml`](./examples/apptainer.yaml): Apptainer + +容器镜像构建器例子: +- [`./examples/buildkit.yaml`](./examples/buildkit.yaml): BuildKit + +容器业务流程协调程序例子: +- [`./examples/k3s.yaml`](./examples/k3s.yaml): Kubernetes (k3s) +- [`./examples/k8s.yaml`](./examples/k8s.yaml): Kubernetes (kubeadm) +- [`./examples/nomad.yaml`](./examples/nomad.yaml): Nomad + +默认的 Ubuntu 镜像也包含了 LXD。运行 `lima sudo lxc init` 来设置 LXD。 + +也可以看看第三方基于 Lima 的 containerd 项目: +- [Rancher Desktop](https://rancherdesktop.io/): 在桌面上进行 Kubernetes 和容器的管理 +- [Colima](https://github.com/abiosoft/colima): 用最小化的安装来在 Mac 上使用 Docker (和 Kubernetes) + +#### "我能在远程 Linux 计算机上运行 Lima 吗?" +Lima 本身不支持连接到远程 Linux 计算机,但是 Lima 的前身 [sshocker](https://github.com/lima-vm/sshocker) 为远程 Linux 计算机提供了类似的功能。 + +例如,运行 `sshocker -v /Users/foo:/home/foo/mnt -p 8080:80 @` 将 `/Users/foo` 作为 `/home/foo/mnt` 向远程计算机公开,并将 `localhost:8080` 转发到远程计算机的 80 端口。 + +#### "与 Docker for Mac 相比有什么优点?" +Lima 是免费软件(Apache License 2.0),但 Docker for Mac 不是。 +他们的 [EULA](https://www.docker.com/legal/docker-software-end-user-license-agreement) 甚至禁止披露 benchmark 的结果。 + +另一方面来说,[Moby](https://github.com/moby/moby),即 Docker for Linux,也是免费软件,但 Moby/Docker 没有 containerd 的几个新特性,比如: +- [按需拉取镜像(即 lazy-pulling, eStargz)](https://github.com/containerd/nerdctl/blob/master/docs/stargz.md) +- [运行加密容器](https://github.com/containerd/nerdctl/blob/master/docs/ocicrypt.md) +- 导入和导出 [本地 OCI 存档](https://github.com/opencontainers/image-spec/blob/master/image-layout.md) + +### QEMU +#### "QEMU 崩溃,提示 `HV_ERROR`" +如果你在 macOS 上通过 homebrew 安装了 QEMU v6.0.0 或更新的版本,你的 QEMU 二进制文件应该已经自动签名以启用 HVF 加速。 + +但是,如果你看到 `HV_ERROR`,你可能需要对二进制文件进行手动签名。 + +```bash +cat >entitlements.xml < + + + + com.apple.security.hypervisor + + + +EOF + +codesign -s - --entitlements entitlements.xml --force /usr/local/bin/qemu-system-x86_64 +``` + +注意:**只有** 10.15.7 **之前**版本的 macOS 上你才可能需要额外添加这个授权: + +``` + com.apple.vm.hypervisor + +``` + +#### "QEMU 很慢" +- 确保 HVF 已经通过 `com.apple.security.hypervisor` 授权进行启用。参见 ["QEMU 崩溃,提示 `HV_ERROR`"](#-qemu-崩溃提示-hverror-) +- 模拟非原生计算机(Intel 宿主上的 ARM 虚拟机,ARM 宿主上的 Intel 虚拟机)在设计上就很慢。查看 [`docs/multi-arch.md`](./docs/multi-arch.md) 了解解决方法。 + +#### 错误 "killed -9" +- 确保 QEMU 已经签名过。参见 ["QEMU 崩溃,提示 `HV_ERROR`"](#-qemu-崩溃提示-hverror-)。 +- 如果你是在 macOS 10.15.7 或者 11.0 或者更新的版本上运行,请确保授权 `com.apple.vm.hypervisor` **没有**被添加。它只在旧版本 macOS 上生效。你可以通过执行 `codesign --remove-signature /usr/local/bin/qemu-system-x86_64` 来清理签名然后[重新开始](#开始使用) + +#### "QEMU 崩溃,提示 `vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed`" +已知在 Intel Mac 上运行 RHEL8 兼容发行版(如 Rocky Linux 8.x)的镜像时会发生此错误。 +解决方式是设置环境变量:`QEMU_SYSTEM_X86_64="qemu-system-x86_64 -cpu Haswell-v4"`。 + +https://bugs.launchpad.net/qemu/+bug/1838390 + +### 网络 +#### "从宿主无法访问虚拟机 IP 192.168.5.15" + +默认虚拟机 IP 192.168.5.15 对宿主和其他虚拟机来说是不可访问的。 + +要添加另一个 IP 地址给宿主和其他虚拟机访问的话,请启用 [`socket_vmnet`](https://github.com/lima-vm/socket_vmnet) (从 Lima v0.12 起可用) +或者 [`vde_vmnet`](https://github.com/lima-vm/vde_vmnet) (已弃用). + +请查看 [`./docs/network.md`](./docs/network.md)。 + +#### "Ping 显示重复的数据包和大量的响应时间" + +Lima 使用的是 QEMU 的 SLIRP 网络,它不支持开箱即用 `ping`。 + +``` +$ ping google.com +PING google.com (172.217.165.14): 56 data bytes +64 bytes from 172.217.165.14: seq=0 ttl=42 time=2395159.646 ms +64 bytes from 172.217.165.14: seq=0 ttl=42 time=2396160.798 ms (DUP!) +``` + +更多细节请查看 [Documentation/Networking](https://wiki.qemu.org/Documentation/Networking#User_Networking_.28SLIRP.29)。 + +### 文件系统共享 +#### "文件系统很慢" +试试 virtiofs。请查看 [`docs/mount.md`](./docs/mount.md)。 + +#### "文件系统不可写" +默认情况下,home 目录是以只读形式挂载的。 +如果想启用可写,请在 YAML 中指定 `writable: true`。 + +```yaml +mounts: +- location: "~" + writable: true +``` + +运行 `limactl edit ` 来为一个实例打开 YAML 编辑器进行编辑。 + +### 外部项目 +#### "我在使用 Rancher Desktop。怎么处理底层的 Lima?" + +在 macOS 宿主上,Rancher Desktop(从 v1.0 开始)以以下配置启动 Lima: + +- `$LIMA_HOME` 目录:`$HOME/Library/Application Support/rancher-desktop/lima` +- `limactl` 二进制文件:`/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl` +- Lima 实例名:`0` + +如果想要开启一个 shell,运行下面的命令: + +```shell +LIMA_HOME="$HOME/Library/Application Support/rancher-desktop/lima" "/Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl" shell 0 +``` + +在 Linux 宿主上,试试以下命令: +```shell +LIMA_HOME="$HOME/.local/share/rancher-desktop/lima" /opt/rancher-desktop/resources/resources/linux/lima/bin/limactl shell 0 +``` + +如果你已经安装了 Rancher Desktop 作为一个 AppImage 的话: +```shell +LIMA_HOME="$HOME/.local/share/rancher-desktop/lima" "$(ls -d /tmp/.mount_ranche*/opt/rancher-desktop/resources/resources/linux/lima/bin)/limactl" shell 0 +``` + +### "有关于调试问题的其他提示吗?" +- 检查日志: + - `limactl --debug start` + - `$HOME/.lima//serial.log` + - `/var/log/cloud-init-output.log` (虚拟机内) + - `/var/log/cloud-init.log` (虚拟机内) +- 确保你没有在 YAML 文件内混合使用空格和 tab。 + +- - - +**我们是一个 [Cloud Native Computing Foundation](https://cncf.io/) 沙盒项目。** + + + +The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [Trademark Usage](https://www.linuxfoundation.org/trademark-usage/). diff --git a/lima/share/doc/lima/ROADMAP.md b/lima/share/doc/lima/ROADMAP.md new file mode 100644 index 0000000..fd434ef --- /dev/null +++ b/lima/share/doc/lima/ROADMAP.md @@ -0,0 +1,11 @@ +# Lima roadmap + +Instead of using a static text file, Lima uses the `roadmap` label on GitHub issues to designate features or bug fixes that we plan to implement. + +Issues are tagged with the `roadmap` label when at least one maintainer or contributor has declared intent to work on or help with the implementation. + +There are no commitments or timelines attached to the label, and the label may be removed again from an abandoned issue at any time. + +Non-roadmap issues are kept open (as long as they fit the scope of the project) in case a volunteer one day appears and offers to work on them. + +To find the items currently planned for Lima you can filter on [open issues with the `roadmap` label]( https://github.com/lima-vm/lima/issues?q=is%3Aissue+is%3Aopen+label%3Aroadmap). diff --git a/lima/share/doc/lima/SECURITY.md b/lima/share/doc/lima/SECURITY.md new file mode 100644 index 0000000..437c328 --- /dev/null +++ b/lima/share/doc/lima/SECURITY.md @@ -0,0 +1 @@ +Moved to https://github.com/lima-vm/.github/blob/main/SECURITY.md diff --git a/lima/share/doc/lima/VERSION b/lima/share/doc/lima/VERSION new file mode 100644 index 0000000..2157409 --- /dev/null +++ b/lima/share/doc/lima/VERSION @@ -0,0 +1 @@ +0.22.0 diff --git a/lima/share/doc/lima/examples b/lima/share/doc/lima/examples new file mode 120000 index 0000000..f10e14a --- /dev/null +++ b/lima/share/doc/lima/examples @@ -0,0 +1 @@ +templates \ No newline at end of file diff --git a/lima/share/doc/lima/templates b/lima/share/doc/lima/templates new file mode 120000 index 0000000..c15b1de --- /dev/null +++ b/lima/share/doc/lima/templates @@ -0,0 +1 @@ +../../lima/templates \ No newline at end of file diff --git a/lima/share/fish/vendor_completions.d/limactl.fish b/lima/share/fish/vendor_completions.d/limactl.fish new file mode 100644 index 0000000..d34fdca --- /dev/null +++ b/lima/share/fish/vendor_completions.d/limactl.fish @@ -0,0 +1,235 @@ +# fish completion for limactl -*- shell-script -*- + +function __limactl_debug + set -l file "$BASH_COMP_DEBUG_FILE" + if test -n "$file" + echo "$argv" >> $file + end +end + +function __limactl_perform_completion + __limactl_debug "Starting __limactl_perform_completion" + + # Extract all args except the last one + set -l args (commandline -opc) + # Extract the last arg and escape it in case it is a space + set -l lastArg (string escape -- (commandline -ct)) + + __limactl_debug "args: $args" + __limactl_debug "last arg: $lastArg" + + # Disable ActiveHelp which is not supported for fish shell + set -l requestComp "LIMACTL_ACTIVE_HELP=0 $args[1] __complete $args[2..-1] $lastArg" + + __limactl_debug "Calling $requestComp" + set -l results (eval $requestComp 2> /dev/null) + + # Some programs may output extra empty lines after the directive. + # Let's ignore them or else it will break completion. + # Ref: https://github.com/spf13/cobra/issues/1279 + for line in $results[-1..1] + if test (string trim -- $line) = "" + # Found an empty line, remove it + set results $results[1..-2] + else + # Found non-empty line, we have our proper output + break + end + end + + set -l comps $results[1..-2] + set -l directiveLine $results[-1] + + # For Fish, when completing a flag with an = (e.g., -n=) + # completions must be prefixed with the flag + set -l flagPrefix (string match -r -- '-.*=' "$lastArg") + + __limactl_debug "Comps: $comps" + __limactl_debug "DirectiveLine: $directiveLine" + __limactl_debug "flagPrefix: $flagPrefix" + + for comp in $comps + printf "%s%s\n" "$flagPrefix" "$comp" + end + + printf "%s\n" "$directiveLine" +end + +# this function limits calls to __limactl_perform_completion, by caching the result behind $__limactl_perform_completion_once_result +function __limactl_perform_completion_once + __limactl_debug "Starting __limactl_perform_completion_once" + + if test -n "$__limactl_perform_completion_once_result" + __limactl_debug "Seems like a valid result already exists, skipping __limactl_perform_completion" + return 0 + end + + set --global __limactl_perform_completion_once_result (__limactl_perform_completion) + if test -z "$__limactl_perform_completion_once_result" + __limactl_debug "No completions, probably due to a failure" + return 1 + end + + __limactl_debug "Performed completions and set __limactl_perform_completion_once_result" + return 0 +end + +# this function is used to clear the $__limactl_perform_completion_once_result variable after completions are run +function __limactl_clear_perform_completion_once_result + __limactl_debug "" + __limactl_debug "========= clearing previously set __limactl_perform_completion_once_result variable ==========" + set --erase __limactl_perform_completion_once_result + __limactl_debug "Successfully erased the variable __limactl_perform_completion_once_result" +end + +function __limactl_requires_order_preservation + __limactl_debug "" + __limactl_debug "========= checking if order preservation is required ==========" + + __limactl_perform_completion_once + if test -z "$__limactl_perform_completion_once_result" + __limactl_debug "Error determining if order preservation is required" + return 1 + end + + set -l directive (string sub --start 2 $__limactl_perform_completion_once_result[-1]) + __limactl_debug "Directive is: $directive" + + set -l shellCompDirectiveKeepOrder 32 + set -l keeporder (math (math --scale 0 $directive / $shellCompDirectiveKeepOrder) % 2) + __limactl_debug "Keeporder is: $keeporder" + + if test $keeporder -ne 0 + __limactl_debug "This does require order preservation" + return 0 + end + + __limactl_debug "This doesn't require order preservation" + return 1 +end + + +# This function does two things: +# - Obtain the completions and store them in the global __limactl_comp_results +# - Return false if file completion should be performed +function __limactl_prepare_completions + __limactl_debug "" + __limactl_debug "========= starting completion logic ==========" + + # Start fresh + set --erase __limactl_comp_results + + __limactl_perform_completion_once + __limactl_debug "Completion results: $__limactl_perform_completion_once_result" + + if test -z "$__limactl_perform_completion_once_result" + __limactl_debug "No completion, probably due to a failure" + # Might as well do file completion, in case it helps + return 1 + end + + set -l directive (string sub --start 2 $__limactl_perform_completion_once_result[-1]) + set --global __limactl_comp_results $__limactl_perform_completion_once_result[1..-2] + + __limactl_debug "Completions are: $__limactl_comp_results" + __limactl_debug "Directive is: $directive" + + set -l shellCompDirectiveError 1 + set -l shellCompDirectiveNoSpace 2 + set -l shellCompDirectiveNoFileComp 4 + set -l shellCompDirectiveFilterFileExt 8 + set -l shellCompDirectiveFilterDirs 16 + + if test -z "$directive" + set directive 0 + end + + set -l compErr (math (math --scale 0 $directive / $shellCompDirectiveError) % 2) + if test $compErr -eq 1 + __limactl_debug "Received error directive: aborting." + # Might as well do file completion, in case it helps + return 1 + end + + set -l filefilter (math (math --scale 0 $directive / $shellCompDirectiveFilterFileExt) % 2) + set -l dirfilter (math (math --scale 0 $directive / $shellCompDirectiveFilterDirs) % 2) + if test $filefilter -eq 1; or test $dirfilter -eq 1 + __limactl_debug "File extension filtering or directory filtering not supported" + # Do full file completion instead + return 1 + end + + set -l nospace (math (math --scale 0 $directive / $shellCompDirectiveNoSpace) % 2) + set -l nofiles (math (math --scale 0 $directive / $shellCompDirectiveNoFileComp) % 2) + + __limactl_debug "nospace: $nospace, nofiles: $nofiles" + + # If we want to prevent a space, or if file completion is NOT disabled, + # we need to count the number of valid completions. + # To do so, we will filter on prefix as the completions we have received + # may not already be filtered so as to allow fish to match on different + # criteria than the prefix. + if test $nospace -ne 0; or test $nofiles -eq 0 + set -l prefix (commandline -t | string escape --style=regex) + __limactl_debug "prefix: $prefix" + + set -l completions (string match -r -- "^$prefix.*" $__limactl_comp_results) + set --global __limactl_comp_results $completions + __limactl_debug "Filtered completions are: $__limactl_comp_results" + + # Important not to quote the variable for count to work + set -l numComps (count $__limactl_comp_results) + __limactl_debug "numComps: $numComps" + + if test $numComps -eq 1; and test $nospace -ne 0 + # We must first split on \t to get rid of the descriptions to be + # able to check what the actual completion will be. + # We don't need descriptions anyway since there is only a single + # real completion which the shell will expand immediately. + set -l split (string split --max 1 \t $__limactl_comp_results[1]) + + # Fish won't add a space if the completion ends with any + # of the following characters: @=/:., + set -l lastChar (string sub -s -1 -- $split) + if not string match -r -q "[@=/:.,]" -- "$lastChar" + # In other cases, to support the "nospace" directive we trick the shell + # by outputting an extra, longer completion. + __limactl_debug "Adding second completion to perform nospace directive" + set --global __limactl_comp_results $split[1] $split[1]. + __limactl_debug "Completions are now: $__limactl_comp_results" + end + end + + if test $numComps -eq 0; and test $nofiles -eq 0 + # To be consistent with bash and zsh, we only trigger file + # completion when there are no other completions + __limactl_debug "Requesting file completion" + return 1 + end + end + + return 0 +end + +# Since Fish completions are only loaded once the user triggers them, we trigger them ourselves +# so we can properly delete any completions provided by another script. +# Only do this if the program can be found, or else fish may print some errors; besides, +# the existing completions will only be loaded if the program can be found. +if type -q "limactl" + # The space after the program name is essential to trigger completion for the program + # and not completion of the program name itself. + # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. + complete --do-complete "limactl " > /dev/null 2>&1 +end + +# Remove any pre-existing completions for the program since we will be handling all of them. +complete -c limactl -e + +# this will get called after the two calls below and clear the $__limactl_perform_completion_once_result global +complete -c limactl -n '__limactl_clear_perform_completion_once_result' +# The call to __limactl_prepare_completions will setup __limactl_comp_results +# which provides the program's completion choices. +# If this doesn't require order preservation, we don't use the -k flag +complete -c limactl -n 'not __limactl_requires_order_preservation && __limactl_prepare_completions' -f -a '$__limactl_comp_results' +# otherwise we use the -k flag +complete -k -c limactl -n '__limactl_requires_order_preservation && __limactl_prepare_completions' -f -a '$__limactl_comp_results' diff --git a/lima/share/lima/examples b/lima/share/lima/examples new file mode 120000 index 0000000..f10e14a --- /dev/null +++ b/lima/share/lima/examples @@ -0,0 +1 @@ +templates \ No newline at end of file diff --git a/lima/share/lima/lima-guestagent.Linux-aarch64 b/lima/share/lima/lima-guestagent.Linux-aarch64 new file mode 100644 index 0000000..2ed7479 Binary files /dev/null and b/lima/share/lima/lima-guestagent.Linux-aarch64 differ diff --git a/lima/share/lima/lima-guestagent.Linux-armv7l b/lima/share/lima/lima-guestagent.Linux-armv7l new file mode 100644 index 0000000..034c06b Binary files /dev/null and b/lima/share/lima/lima-guestagent.Linux-armv7l differ diff --git a/lima/share/lima/lima-guestagent.Linux-riscv64 b/lima/share/lima/lima-guestagent.Linux-riscv64 new file mode 100644 index 0000000..3d3cb7f Binary files /dev/null and b/lima/share/lima/lima-guestagent.Linux-riscv64 differ diff --git a/lima/share/lima/lima-guestagent.Linux-x86_64 b/lima/share/lima/lima-guestagent.Linux-x86_64 new file mode 100644 index 0000000..e8f7af9 Binary files /dev/null and b/lima/share/lima/lima-guestagent.Linux-x86_64 differ diff --git a/lima/share/lima/templates/README.md b/lima/share/lima/templates/README.md new file mode 100644 index 0000000..866e53f --- /dev/null +++ b/lima/share/lima/templates/README.md @@ -0,0 +1,77 @@ +Run `limactl start template://fedora` to create a Lima instance named "fedora". + +To open a shell, run `limactl shell fedora bash` or `LIMA_INSTANCE=fedora lima bash`. + +- - - + +⭐ = ["Tier 1"](#tier) + +☆ = ["Tier 2"](#tier) + +Default: [`default`](./default.yaml) (⭐Ubuntu, with containerd/nerdctl) + +Distro: +- [`almalinux-8`](./almalinux-8.yaml): AlmaLinux 8 +- [`almalinux-9`](./almalinux-9.yaml), `almalinux.yaml`: AlmaLinux 9 +- [`alpine`](./alpine.yaml): ☆Alpine Linux +- [`archlinux`](./archlinux.yaml): ⭐Arch Linux +- [`centos-stream-8`](./centos-stream-8.yaml): CentOS Stream 8 +- [`centos-stream-9`](./centos-stream-9.yaml), `centos-stream.yaml`: CentOS Stream 9 +- [`debian-11`](./debian-11.yaml): Debian GNU/Linux 11(bullseye) +- [`debian-12`](./debian-12.yaml), `debian.yaml`: ⭐Debian GNU/Linux 12(bookworm) +- [`fedora`](./fedora.yaml): ⭐Fedora +- [`opensuse`](./opensuse.yaml): ⭐openSUSE Leap +- [`oraclelinux-8`](./oraclelinux-8.yaml): Oracle Linux 8 +- [`oraclelinux-9`](./oraclelinux-9.yaml), `oraclelinux.yaml`: Oracle Linux 9 +- [`rocky-8`](./rocky-8.yaml): Rocky Linux 8 +- [`rocky-9`](./rocky-9.yaml), `rocky.yaml`: Rocky Linux 9 +- [`ubuntu`](./ubuntu.yaml): Ubuntu (same as `default.yaml` but without extra YAML lines) +- [`ubuntu-lts`](./ubuntu-lts.yaml): Ubuntu LTS (same as `ubuntu.yaml` but pinned to an LTS version) +- [`deprecated/centos-7`](./deprecated/centos-7.yaml): [deprecated] CentOS Linux 7 +- [`experimental/gentoo`](./experimental/gentoo.yaml): [experimental] Gentoo +- [`experimental/opensuse-tumbleweed`](./experimental/opensuse-tumbleweed.yaml): [experimental] openSUSE Tumbleweed + +Container engines: +- [`apptainer`](./apptainer.yaml): Apptainer +- [`apptainer-rootful`](./apptainer-rootful.yaml): Apptainer (rootful) +- [`docker`](./docker.yaml): ⭐Docker +- [`docker-rootful`](./docker-rootful.yaml): Docker (rootful) +- [`podman`](./podman.yaml): Podman +- [`podman-rootful`](./podman-rootful.yaml): Podman (rootful) +- LXD is installed in the default Ubuntu template, so there is no `lxd.yaml` + +Container image builders: +- [`buildkit`](./buildkit.yaml): BuildKit + +Container orchestration: +- [`faasd`](./faasd.yaml): [Faasd](https://docs.openfaas.com/deployment/faasd/) +- [`k3s`](./k3s.yaml): Kubernetes via k3s +- [`k8s`](./k8s.yaml): Kubernetes via kubeadm +- [`experimental/u7s`](./experimental/u7s.yaml): [Usernetes](https://github.com/rootless-containers/usernetes): Rootless Kubernetes + +Optional feature enablers: +- [`vmnet`](./vmnet.yaml): ⭐enable [`vmnet.framework`](../docs/network.md) +- [`experimental/9p`](./experimental/9p.yaml): [experimental] use 9p mount type +- [`experimental/virtiofs-linux`](./experimental/9p.yaml): [experimental] use virtiofs mount type for Linux +- [`experimental/armv7l`](./experimental/armv7l.yaml): [experimental] ARMv7 +- [`experimental/riscv64`](./experimental/riscv64.yaml): [experimental] RISC-V +- [`experimental/net-user-v2`](./experimental/net-user-v2.yaml): [experimental] user-v2 network + to enable VM-to-VM communication without root privilege +- [`experimental/vnc`](./experimental/vnc.yaml): [experimental] use vnc display and xorg server + +Lost+found: +- ~`centos`~: Removed in Lima v0.8.0, as CentOS 8 reached [EOL](https://www.centos.org/centos-linux-eol/). + Replaced by [`almalinux`](./almalinux.yaml), [`centos-stream`](./centos-stream.yaml), [`oraclelinux`](./oraclelinux.yaml), + and [`rocky`](./rocky.yaml). +- ~`singularity`~: Moved to [`apptainer-rootful`](./apptainer-rootful.yaml) in Lima v0.13.0, as Singularity was renamed to Apptainer. +- ~`experimental/apptainer`~: Moved to [`apptainer`](./apptainer.yaml) in Lima v0.13.0. +- ~`experimental/{almalinux,centos-stream-9,oraclelinux,rocky}-9`~: Moved to [`almalinux-9`](./almalinux-9.yaml), [`centos-stream-9`](./centos-stream-9.yaml), + [`oraclelinux-9`](./oraclelinux-9.yaml), and [`rocky-9`](./rocky-9.yaml) in Lima v0.13.0. +- ~`nomad`~: Removed in Lima v0.17.1, as Nomad is [no longer free software](https://github.com/hashicorp/nomad/commit/b3e30b1dfa185d9437a25830522da47b91f78816) + +## Tier + +- "Tier 1" (marked with ⭐): Good stability. Regularly tested on the CI. +- "Tier 2" (marked with ☆): Moderate stability. Regularly tested on the CI. + +Other yamls are tested only occasionally and manually. diff --git a/lima/share/lima/templates/almalinux-8.yaml b/lima/share/lima/templates/almalinux-8.yaml new file mode 100644 index 0000000..92bd125 --- /dev/null +++ b/lima/share/lima/templates/almalinux-8.yaml @@ -0,0 +1,26 @@ +# This template requires Lima v0.8.3 or later. + +# NOTE: EL8-based distros are known not to work on M1 chips: https://github.com/lima-vm/lima/issues/841 +# EL9-based distros are known to work. + +images: +- location: "https://repo.almalinux.org/almalinux/8.9/cloud/x86_64/images/AlmaLinux-8-GenericCloud-8.9-20231128.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:a1686bc537bce699b512e3233666f5b8f69ed797ff1ce0af52c17fdc52942621" +- location: "https://repo.almalinux.org/almalinux/8.9/cloud/aarch64/images/AlmaLinux-8-GenericCloud-8.9-20231128.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:603531fce80537f1ac4f78b6a43f79a47d1b2d70247fb2004da48ff1e5300813" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://repo.almalinux.org/almalinux/8/cloud/aarch64/images/AlmaLinux-8-GenericCloud-latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +cpuType: + # Workaround for "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac + # https://bugs.launchpad.net/qemu/+bug/1838390 + x86_64: "Haswell-v4" diff --git a/lima/share/lima/templates/almalinux-9.yaml b/lima/share/lima/templates/almalinux-9.yaml new file mode 100644 index 0000000..0128766 --- /dev/null +++ b/lima/share/lima/templates/almalinux-9.yaml @@ -0,0 +1,19 @@ +# This template requires Lima v0.11.1 or later. + +images: +- location: "https://repo.almalinux.org/almalinux/9.3/cloud/x86_64/images/AlmaLinux-9-GenericCloud-9.3-20231113.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:6bbd060c971fd827a544c7e5e991a7d9e44460a449d2d058a0bb1290dec5a114" +- location: "https://repo.almalinux.org/almalinux/9.3/cloud/aarch64/images/AlmaLinux-9-GenericCloud-9.3-20231113.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:a064715bc755346d5a8e1a4c6b1b7abffe4de03f1b0584942d5483ed32aafd67" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://repo.almalinux.org/almalinux/9/cloud/aarch64/images/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/almalinux.yaml b/lima/share/lima/templates/almalinux.yaml new file mode 100644 index 0000000..0128766 --- /dev/null +++ b/lima/share/lima/templates/almalinux.yaml @@ -0,0 +1,19 @@ +# This template requires Lima v0.11.1 or later. + +images: +- location: "https://repo.almalinux.org/almalinux/9.3/cloud/x86_64/images/AlmaLinux-9-GenericCloud-9.3-20231113.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:6bbd060c971fd827a544c7e5e991a7d9e44460a449d2d058a0bb1290dec5a114" +- location: "https://repo.almalinux.org/almalinux/9.3/cloud/aarch64/images/AlmaLinux-9-GenericCloud-9.3-20231113.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:a064715bc755346d5a8e1a4c6b1b7abffe4de03f1b0584942d5483ed32aafd67" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://repo.almalinux.org/almalinux/9/cloud/aarch64/images/AlmaLinux-9-GenericCloud-latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/alpine.yaml b/lima/share/lima/templates/alpine.yaml new file mode 100644 index 0000000..7cf6881 --- /dev/null +++ b/lima/share/lima/templates/alpine.yaml @@ -0,0 +1,21 @@ +# This template requires Lima v0.7.0 or later. +# Using the Alpine 3.19 aarch64 image with vmType=vz requires macOS Ventura 13.3 or later. + +images: +- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.38/alpine-lima-std-3.19.0-x86_64.iso" + arch: "x86_64" + digest: "sha512:e0c7e88e4cccc24d4e1b3593198cc0bbc3dbc12d07f1d935da0fa73e5b96e19bb5f83925b9fd06c28dfb2278fc4b941333cf2b2565d346c3e3bc5559a268a82d" +- location: "https://github.com/lima-vm/alpine-lima/releases/download/v0.2.38/alpine-lima-std-3.19.0-aarch64.iso" + arch: "aarch64" + digest: "sha512:bf195270ca0e101353ba346f4d651c0518bdea6f2b3845dd43a5c29cb5e1046274579b918bed2f5fb38ce7e9b2eccabe7fcf8040c29c22a3aa3f7a92ef831df7" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true + +# The built-in containerd installer does not support Alpine currently. +# Hint: use the "rd" ISO instead of the "std" ISO to enable containerd: https://github.com/lima-vm/alpine-lima/releases/ +containerd: + system: false + user: false diff --git a/lima/share/lima/templates/apptainer-rootful.yaml b/lima/share/lima/templates/apptainer-rootful.yaml new file mode 100644 index 0000000..54b76a8 --- /dev/null +++ b/lima/share/lima/templates/apptainer-rootful.yaml @@ -0,0 +1,45 @@ +# A template to use Apptainer instead of containerd & nerdctl +# $ limactl start ./apptainer-rootful.yaml +# $ limactl shell apptainer-rootful apptainer run -u -B $HOME:$HOME docker://alpine + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +containerd: + system: false + user: false +provision: +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v apptainer >/dev/null 2>&1 && exit 0 + # add the "Official PPA for Apptainer" + add-apt-repository -y ppa:apptainer/ppa + apt-get update + apt-get install -y apptainer-suid +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v apptainer >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "apptainer is not installed yet" + exit 1 + fi + hint: See "/var/log/cloud-init-output.log" in the guest diff --git a/lima/share/lima/templates/apptainer.yaml b/lima/share/lima/templates/apptainer.yaml new file mode 100644 index 0000000..b5c59f7 --- /dev/null +++ b/lima/share/lima/templates/apptainer.yaml @@ -0,0 +1,48 @@ +# A template to use Apptainer instead of containerd & nerdctl +# $ limactl start ./apptainer.yaml +# $ limactl shell apptainer apptainer run -u -B $HOME:$HOME docker://alpine + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +containerd: + system: false + user: false +provision: +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v apptainer >/dev/null 2>&1 && exit 0 + # Workaround for https://github.com/apptainer/apptainer/issues/2027 + echo "kernel.apparmor_restrict_unprivileged_userns = 0" >/etc/sysctl.d/99-userns.conf + sysctl --system + # add the "Official PPA for Apptainer" + add-apt-repository -y ppa:apptainer/ppa + apt-get update + apt-get install -y apptainer +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v apptainer >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "apptainer is not installed yet" + exit 1 + fi + hint: See "/var/log/cloud-init-output.log" in the guest diff --git a/lima/share/lima/templates/archlinux.yaml b/lima/share/lima/templates/archlinux.yaml new file mode 100644 index 0000000..5dd60e8 --- /dev/null +++ b/lima/share/lima/templates/archlinux.yaml @@ -0,0 +1,23 @@ +# This template requires Lima v0.7.0 or later +images: +# Try to use yyyyMMdd.REV image if available. Note that yyyyMMdd.REV will be removed after several months. +- location: "https://geo.mirror.pkgbuild.com/images/v20240501.233015/Arch-Linux-x86_64-cloudimg-20240501.233015.qcow2" + arch: "x86_64" + digest: "sha256:bf87b7c03d77bff13d8079eef70c05d14b7ebdb761d01b7f95c2d335b41e0e50" +- location: "https://github.com/mcginty/arch-boxes-arm/releases/download/v20220323/Arch-Linux-aarch64-cloudimg-20220323.0.qcow2" + arch: "aarch64" + digest: "sha512:27524910bf41cb9b3223c8749c6e67fd2f2fdb8b70d40648708e64d6b03c0b4a01b3c5e72d51fefd3e0c3f58487dbb400a79ca378cde2da341a3a19873612be8" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2" + arch: "x86_64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +# reverse-sshfs seems unstable with ArchLinux ? +mountType: "9p" +vmType: "qemu" +firmware: + legacyBIOS: true diff --git a/lima/share/lima/templates/buildkit.yaml b/lima/share/lima/templates/buildkit.yaml new file mode 100644 index 0000000..22b0300 --- /dev/null +++ b/lima/share/lima/templates/buildkit.yaml @@ -0,0 +1,34 @@ +# A template to use BuildKit +# $ limactl start ./buildkit.yaml + +# To run `buildkit` on the host (assumes buildctl is installed): +# $ export BUILDKIT_HOST=$(limactl list buildkit --format 'unix://{{.Dir}}/sock/buildkitd.sock') +# $ buildctl debug workers +message: | + To run `buildkit` on the host (assumes buildctl is installed), run the following commands: + ------- + export BUILDKIT_HOST="unix://{{.Dir}}/sock/buildkitd.sock" + buildctl debug workers + ------- +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +containerd: + system: false + user: true + +portForwards: +- guestSocket: "/run/user/{{.UID}}/buildkit-default/buildkitd.sock" + hostSocket: "{{.Dir}}/sock/buildkitd.sock" diff --git a/lima/share/lima/templates/centos-stream-8.yaml b/lima/share/lima/templates/centos-stream-8.yaml new file mode 100644 index 0000000..dc8a380 --- /dev/null +++ b/lima/share/lima/templates/centos-stream-8.yaml @@ -0,0 +1,30 @@ +# This template requires Lima v0.8.3 or later. + +# NOTE: EL8-based distros are known not to work on M1 chips: https://github.com/lima-vm/lima/issues/841 +# EL9-based distros are known to work. + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20240429.0.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:dd4d28d3ff4e1e9e18748fdc1daae1f5502b93663fbd8c0a6072822fd0afd7e5" +- location: "https://cloud.centos.org/centos/8-stream/aarch64/images/CentOS-Stream-GenericCloud-8-20240429.0.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:d72dc4d34920150e5bda2a29be8faef23639e02e95421a03c8df300a49436ff2" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://cloud.centos.org/centos/8-stream/aarch64/images/CentOS-Stream-GenericCloud-8-latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +firmware: + # CentOS Stream 8 still requires legacyBIOS, while AlmaLinux 8 and Rocky Linux 8 do not. + legacyBIOS: true +cpuType: + # Workaround for "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac + # https://bugs.launchpad.net/qemu/+bug/1838390 + x86_64: "Haswell-v4" diff --git a/lima/share/lima/templates/centos-stream-9.yaml b/lima/share/lima/templates/centos-stream-9.yaml new file mode 100644 index 0000000..db9023b --- /dev/null +++ b/lima/share/lima/templates/centos-stream-9.yaml @@ -0,0 +1,23 @@ +# This template requires Lima v0.11.1 or later. + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20240429.0.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:286633ec3f8cbd2ba151e0e6e4b12bd231e5cb0d7ab99614929626026f5a334b" +- location: "https://cloud.centos.org/centos/9-stream/aarch64/images/CentOS-Stream-GenericCloud-9-20240429.0.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:2a27c9c99eacd4e345625e8548ec1af7f6a33e5c377acd2ae1515be7e5ecd336" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://cloud.centos.org/centos/9-stream/aarch64/images/CentOS-Stream-GenericCloud-9-latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +firmware: + # CentOS Stream 9 still requires legacyBIOS, while AlmaLinux 9 and Rocky Linux 9 do not. + legacyBIOS: true diff --git a/lima/share/lima/templates/centos-stream.yaml b/lima/share/lima/templates/centos-stream.yaml new file mode 100644 index 0000000..db9023b --- /dev/null +++ b/lima/share/lima/templates/centos-stream.yaml @@ -0,0 +1,23 @@ +# This template requires Lima v0.11.1 or later. + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20240429.0.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:286633ec3f8cbd2ba151e0e6e4b12bd231e5cb0d7ab99614929626026f5a334b" +- location: "https://cloud.centos.org/centos/9-stream/aarch64/images/CentOS-Stream-GenericCloud-9-20240429.0.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:2a27c9c99eacd4e345625e8548ec1af7f6a33e5c377acd2ae1515be7e5ecd336" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://cloud.centos.org/centos/9-stream/aarch64/images/CentOS-Stream-GenericCloud-9-latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +firmware: + # CentOS Stream 9 still requires legacyBIOS, while AlmaLinux 9 and Rocky Linux 9 do not. + legacyBIOS: true diff --git a/lima/share/lima/templates/debian-11.yaml b/lima/share/lima/templates/debian-11.yaml new file mode 100644 index 0000000..182cb16 --- /dev/null +++ b/lima/share/lima/templates/debian-11.yaml @@ -0,0 +1,20 @@ +# This template requires Lima v0.7.0 or later +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud.debian.org/images/cloud/bullseye/20240429-1732/debian-11-genericcloud-amd64-20240429-1732.qcow2" + arch: "x86_64" + digest: "sha512:5426d0398d3ec685a74256114158daebfd7064b95301c6e2724b1b35e4a83b57809269096b44278b4c3ad4da851d5d606ab740d50c928a2a6c7707aa51d8b61a" +- location: "https://cloud.debian.org/images/cloud/bullseye/20240429-1732/debian-11-genericcloud-arm64-20240429-1732.qcow2" + arch: "aarch64" + digest: "sha512:3982f5162f90ab205348469518faf8688417379546275c7de317a599dac9f9de134a8a67c9a2313a11919726d9e04e755f5abdd67d801f705ea31ad9619ffb5f" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-amd64.qcow2" + arch: "x86_64" +- location: "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-genericcloud-arm64.qcow2" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/debian-12.yaml b/lima/share/lima/templates/debian-12.yaml new file mode 100644 index 0000000..b054a22 --- /dev/null +++ b/lima/share/lima/templates/debian-12.yaml @@ -0,0 +1,20 @@ +# This template requires Lima v0.7.0 or later +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud.debian.org/images/cloud/bookworm/20240429-1732/debian-12-genericcloud-amd64-20240429-1732.qcow2" + arch: "x86_64" + digest: "sha512:6cc752d71b390c7fea64b0b598225914a7f4adacd4a33fa366187fac01094648628e0681a109ae9320b9a79aba2832f33395fa13154dad636465b7d9cdbed599" +- location: "https://cloud.debian.org/images/cloud/bookworm/20240429-1732/debian-12-genericcloud-arm64-20240429-1732.qcow2" + arch: "aarch64" + digest: "sha512:59afc40ad0062ca100c9280a281256487348c8aa23b3e70c329a6d6f29b5343b628622e63e0b9b4fc3987dd691d5f3c657233186b3271878d5e0aa0b4d264b06" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" + arch: "x86_64" +- location: "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-arm64.qcow2" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/debian.yaml b/lima/share/lima/templates/debian.yaml new file mode 100644 index 0000000..b054a22 --- /dev/null +++ b/lima/share/lima/templates/debian.yaml @@ -0,0 +1,20 @@ +# This template requires Lima v0.7.0 or later +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud.debian.org/images/cloud/bookworm/20240429-1732/debian-12-genericcloud-amd64-20240429-1732.qcow2" + arch: "x86_64" + digest: "sha512:6cc752d71b390c7fea64b0b598225914a7f4adacd4a33fa366187fac01094648628e0681a109ae9320b9a79aba2832f33395fa13154dad636465b7d9cdbed599" +- location: "https://cloud.debian.org/images/cloud/bookworm/20240429-1732/debian-12-genericcloud-arm64-20240429-1732.qcow2" + arch: "aarch64" + digest: "sha512:59afc40ad0062ca100c9280a281256487348c8aa23b3e70c329a6d6f29b5343b628622e63e0b9b4fc3987dd691d5f3c657233186b3271878d5e0aa0b4d264b06" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" + arch: "x86_64" +- location: "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-arm64.qcow2" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/default.yaml b/lima/share/lima/templates/default.yaml new file mode 100644 index 0000000..45cf27b --- /dev/null +++ b/lima/share/lima/templates/default.yaml @@ -0,0 +1,508 @@ +# ===================================================================== # +# BASIC CONFIGURATION +# ===================================================================== # + +# Default values in this YAML file are specified by `null` instead of Lima's "builtin default" values, +# so they can be overridden by the $LIMA_HOME/_config/default.yaml mechanism documented at the end of this file. + +# VM type: "qemu" or "vz" (on macOS 13 and later). +# The vmType can be specified only on creating the instance. +# The vmType of existing instances cannot be changed. +# 🟢 Builtin default: "qemu" +vmType: null + +# OS: "Linux". +# 🟢 Builtin default: "Linux" +os: null + +# Arch: "default", "x86_64", "aarch64". +# 🟢 Builtin default: "default" (corresponds to the host architecture) +arch: null + +# OpenStack-compatible disk image. +# 🟢 Builtin default: null (must be specified) +# 🔵 This file: Ubuntu images +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +# CPUs +# 🟢 Builtin default: min(4, host CPU cores) +cpus: null + +# Memory size +# 🟢 Builtin default: min("4GiB", half of host memory) +memory: null + +# Disk size +# 🟢 Builtin default: "100GiB" +disk: null + +# Expose host directories to the guest, the mount point might be accessible from all UIDs in the guest +# 🟢 Builtin default: null (Mount nothing) +# 🔵 This file: Mount the home as read-only, /tmp/lima as writable +mounts: +- location: "~" + # Configure the mountPoint inside the guest. + # 🟢 Builtin default: value of location + mountPoint: null + # CAUTION: `writable` SHOULD be false for the home directory. + # Setting `writable` to true is possible, but untested and dangerous. + # 🟢 Builtin default: false + writable: null + sshfs: + # Enabling the SSHFS cache will increase performance of the mounted filesystem, at + # the cost of potentially not reflecting changes made on the host in a timely manner. + # Warning: It looks like PHP filesystem access does not work correctly when + # the cache is disabled. + # 🟢 Builtin default: true + cache: null + # SSHFS has an optional flag called 'follow_symlinks'. This allows mounts + # to be properly resolved in the guest os and allow for access to the + # contents of the symlink. As a result, symlinked files & folders on the Host + # system will look and feel like regular files directories in the Guest OS. + # 🟢 Builtin default: false + followSymlinks: null + # SFTP driver, "builtin" or "openssh-sftp-server". "openssh-sftp-server" is recommended. + # 🟢 Builtin default: "openssh-sftp-server" if OpenSSH SFTP Server binary is found, otherwise "builtin" + sftpDriver: null + 9p: + # Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none". + # "mapped-xattr" and "mapped-file" are useful for persistent chown but incompatible with symlinks. + # 🟢 Builtin default: "none" (since Lima v0.13) + securityModel: null + # Select 9P protocol version. Valid options are: "9p2000" (legacy), "9p2000.u", "9p2000.L". + # 🟢 Builtin default: "9p2000.L" + protocolVersion: null + # The number of bytes to use for 9p packet payload, where 4KiB is the absolute minimum. + # 🟢 Builtin default: "128KiB" + msize: null + # Specifies a caching policy. Valid options are: "none", "loose", "fscache" and "mmap". + # Try choosing "mmap" or "none" if you see a stability issue with the default "fscache". + # See https://www.kernel.org/doc/Documentation/filesystems/9p.txt + # 🟢 Builtin default: "fscache" for non-writable mounts, "mmap" for writable mounts + cache: null +- location: "/tmp/lima" + # 🟢 Builtin default: false + # 🔵 This file: true (only for "/tmp/lima") + writable: true + +# Mount type for above mounts, such as "reverse-sshfs" (from sshocker), "9p" (EXPERIMENTAL, from QEMU’s virtio-9p-pci, aka virtfs), +# or "virtiofs" (EXPERIMENTAL, needs `vmType: vz`) +# 🟢 Builtin default: "reverse-sshfs" (for QEMU), "virtiofs" (for vz) +mountType: null + +# Enable inotify support for mounted directories (EXPERIMENTAL) +# 🟢 Builtin default: Disabled by default +mountInotify: null + +# Lima disks to attach to the instance. The disks will be accessible from inside the +# instance, labeled by name. (e.g. if the disk is named "data", it will be labeled +# "lima-data" inside the instance). The disk will be mounted inside the instance at +# `/mnt/lima-${VOLUME}`. +# 🟢 Builtin default: null +additionalDisks: +# disks should either be a list of disk name strings, for example: +# - "data" +# or a list of disk objects with extra parameters, for example: +# - name: "data" +# format: true +# fsType: "ext4" + +ssh: + # A localhost port of the host. Forwarded to port 22 of the guest. + # 🟢 Builtin default: 0 (automatically assigned to a free port) + # NOTE: when the instance name is "default", the builtin default value is set to + # 60022 for backward compatibility. + localPort: 0 + # Load ~/.ssh/*.pub in addition to $LIMA_HOME/_config/user.pub . + # This option is useful when you want to use other SSH-based + # applications such as rsync with the Lima instance. + # If you have an insecure key under ~/.ssh, do not use this option. + # 🟢 Builtin default: true + loadDotSSHPubKeys: null + # Forward ssh agent into the instance. + # The ssh agent socket can be mounted in a container at the path `/run/host-services/ssh-auth.sock`. + # Set the environment variable `SSH_AUTH_SOCK` value to the path above. + # The socket is accessible by the non-root user inside the Lima instance. + # 🟢 Builtin default: false + forwardAgent: null + # Forward X11 into the instance + # 🟢 Builtin default: false + forwardX11: null + # Trust forwarded X11 clients + # 🟢 Builtin default: false + forwardX11Trusted: null + +# ===================================================================== # +# ADVANCED CONFIGURATION +# ===================================================================== # + +caCerts: + # If set to `true`, this will remove all the default trusted CA certificates that + # are normally shipped with the OS. + # 🟢 Builtin default: false + removeDefaults: null + + # A list of trusted CA certificate files. The files will be read and passed to cloud-init. + files: + # - examples/hello.crt + + # A list of trusted CA certificates. These are directly passed to cloud-init. + certs: + # - | + # -----BEGIN CERTIFICATE----- + # YOUR-ORGS-TRUSTED-CA-CERT-HERE + # -----END CERTIFICATE----- + # - | + # -----BEGIN CERTIFICATE----- + # YOUR-ORGS-TRUSTED-CA-CERT-HERE + # -----END CERTIFICATE----- + +# Upgrade the instance on boot +# Reboot after upgrade if required +# 🟢 Builtin default: false +upgradePackages: null + +containerd: + # Enable system-wide (aka rootful) containerd and its dependencies (BuildKit, Stargz Snapshotter) + # Note that `nerdctl.lima` only works in rootless mode; you have to use `lima sudo nerdctl ...` + # to use rootful containerd with nerdctl. + # 🟢 Builtin default: false + system: null + # Enable user-scoped (aka rootless) containerd and its dependencies + # 🟢 Builtin default: true + user: null +# # Override containerd archive +# # 🟢 Builtin default: hard-coded URL with hard-coded digest (see the output of `limactl info | jq .defaultTemplate.containerd.archives`) +# archives: +# - location: "~/Downloads/nerdctl-full-X.Y.Z-linux-amd64.tar.gz" +# arch: "x86_64" +# digest: "sha256:..." + +# Provisioning scripts need to be idempotent because they might be called +# multiple times, e.g. when the host VM is being restarted. +# The scripts can use the following template variables: {{.Home}}, {{.UID}}, and {{.User}} +# 🟢 Builtin default: null +# provision: +# # `system` is executed with the root privilege +# - mode: system +# script: | +# #!/bin/bash +# set -eux -o pipefail +# export DEBIAN_FRONTEND=noninteractive +# apt-get install -y vim +# # `user` is executed without the root privilege +# - mode: user +# script: | +# #!/bin/bash +# set -eux -o pipefail +# cat < ~/.vimrc +# set number +# EOF +# # `boot` is executed directly by /bin/sh as part of cloud-init-local.service's early boot process, +# # which is why there is no hash-bang specified in the example +# # See cloud-init docs for more info https://docs.cloud-init.io/en/latest/reference/examples.html#run-commands-on-first-boot +# - mode: boot +# script: | +# systemctl disable NetworkManager-wait-online.service +# # `dependency` is executed before the regular dependency resolution workflow in +# # pkg/cidata/cidata.TEMPLATE.d/boot/30-install-packages.sh +# # If skipDefaultDependencyResolution is set on at least one `dependency` mode provisioning script, the regular +# # dependency resolution workflow in pkg/cidata/cidata.TEMPLATE.d/boot/30-install-packages.sh will be skipped. +# - mode: dependency +# skipDefaultDependencyResolution: false +# script: | +# #!/bin/bash +# dnf config-manager --add-repo ... +# dnf install ... + +# Probe scripts to check readiness. +# 🟢 Builtin default: null +# probes: +# # Only `readiness` probes are supported right now. +# - mode: readiness +# description: vim to be installed +# script: | +# #!/bin/bash +# set -eux -o pipefail +# if ! timeout 30s bash -c "until command -v vim; do sleep 3; done"; then +# echo >&2 "vim is not installed yet" +# exit 1 +# fi +# hint: | +# vim was not installed in the guest. Make sure the package system is working correctly. +# Also see "/var/log/cloud-init-output.log" in the guest. + +# ===================================================================== # +# FURTHER ADVANCED CONFIGURATION +# ===================================================================== # + +# Specify desired QEMU CPU type for each arch. +# You can see what options are available for host emulation with: `qemu-system-$(arch) -cpu help`. +# Setting of instructions is supported like this: "qemu64,+ssse3". +cpuType: + # 🟢 Builtin default: "cortex-a72" (or "host" when running on aarch64 host) + aarch64: null + # 🟢 Builtin default: "cortex-a7" (or "host" when running on armv7l host) + armv7l: null + # 🟢 Builtin default: "qemu64" (or "host,-pdpe1gb" when running on x86_64 host) + x86_64: null + # 🟢 Builtin default: "rv64" (or "host" when running on riscv64 host) + riscv64: null + +rosetta: + # Enable Rosetta for Linux (EXPERIMENTAL). + # Hint: try `softwareupdate --install-rosetta` if Lima gets stuck at `Installing rosetta...` + # 🟢 Builtin default: false + enabled: null + # Register rosetta to /proc/sys/fs/binfmt_misc + # 🟢 Builtin default: false + binfmt: null + +# Specify the timezone name (as used by the zoneinfo database). Specify the empty string +# to not set a timezone in the instance. +# 🟢 Builtin default: use name from /etc/timezone or deduce from symlink target of /etc/localtime +timezone: null + +firmware: + # Use legacy BIOS instead of UEFI. Ignored for aarch64. + # 🟢 Builtin default: false + legacyBIOS: null +# # Override UEFI images +# # 🟢 Builtin default: uses VM's default UEFI, except for qemu + aarch64. +# # See +# images: +# - location: "~/Downloads/edk2-aarch64-code.fd.gz" +# arch: "aarch64" +# digest: "sha256:..." +# vmType: "qemu" + +audio: + # EXPERIMENTAL + # QEMU audiodev, e.g., "none", "coreaudio", "pa", "alsa", "oss". + # VZ driver, use "vz" as device name + # Choosing "none" will mute the audio output, and not play any sound. + # 🟢 Builtin default: "" + device: null + +video: + # QEMU display, e.g., "none", "cocoa", "sdl", "gtk", "vnc", "default". + # Choosing "none" will hide the video output, and not show any window. + # Choosing "vnc" will use a network server, and not show any window. + # Choosing "default" will pick the first available of: gtk, sdl, cocoa. + # As of QEMU v6.2, enabling anything but none or vnc is known to have negative impact + # on performance on macOS hosts: https://gitlab.com/qemu-project/qemu/-/issues/334 + # 🟢 Builtin default: "none" + display: null + # VNC (Virtual Network Computing) is a platform-independent graphical + # desktop-sharing system that uses the Remote Frame Buffer protocol (RFB) + vnc: + # VNC display, e.g.,"to=L", "host:d", "unix:path", "none" + # By convention the TCP port is 5900+d, connections from any host. + # 🟢 Builtin default: "127.0.0.1:0,to=9" + display: null + +# The instance can get routable IP addresses from the vmnet framework using +# https://github.com/lima-vm/socket_vmnet. +# 🟢 Builtin default: null +networks: +# Lima can manage daemons for networks defined in $LIMA_HOME/_config/networks.yaml +# automatically. The socket_vmnet binary must be installed into +# secure locations only alterable by the "root" user. +# - lima: shared +# # MAC address of the instance; lima will pick one based on the instance name, +# # so DHCP assigned ip addresses should remain constant over instance restarts. +# macAddress: "" +# # Interface name, defaults to "lima0", "lima1", etc. +# interface: "" +# +# Lima can also connect to "unmanaged" networks addressed by "socket". This +# means that the daemons will not be controlled by Lima, but must be started +# before the instance. The interface type (host, shared, or bridged) is +# configured in socket_vmnet and not in lima. +# - socket: "/var/run/socket_vmnet" + + +# The "vzNAT" IP address is accessible from the host, but not from other guests. +# Needs `vmType: vz` (EXPERIMENTAL). +# - vzNAT: true + +# Port forwarding rules. Forwarding between ports 22 and ssh.localPort cannot be overridden. +# Rules are checked sequentially until the first one matches. +# portForwards: +# - guestPort: 443 +# hostIP: "0.0.0.0" # overrides the default value "127.0.0.1"; allows privileged port forwarding +# # default: hostPort: 443 (same as guestPort) +# # default: guestIP: "127.0.0.1" (also matches bind addresses "0.0.0.0", "::", and "::1") +# # default: proto: "tcp" (only valid value right now) +# +# - guestPortRange: [4000, 4999] +# hostIP: "0.0.0.0" # overrides the default value "127.0.0.1" +# # default: hostPortRange: [4000, 4999] (must specify same number of ports as guestPortRange) +# +# - guestPort: 80 +# hostPort: 8080 # overrides the default value 80 +# +# - guestIP: "127.0.0.2" # overrides the default value "127.0.0.1" +# hostIP: "127.0.0.2" # overrides the default value "127.0.0.1" +# # default: guestPortRange: [1, 65535] +# # default: hostPortRange: [1, 65535] +# +# - guestPort: 8888 +# ignore: true (don't forward this port) +# +# - guestPort: 7443 +# guestIP: "0.0.0.0" # Will match *any* interface +# guestIPMustBeZero: true # Restrict matching to 0.0.0.0 binds only +# hostIP: "0.0.0.0" # Forwards to 0.0.0.0, exposing it externally +# +# - guestSocket: "/run/user/{{.UID}}/my.sock" +# hostSocket: mysocket +# # default: reverse: false +# # "guestSocket" can include these template variables: {{.Home}}, {{.UID}}, and {{.User}}. +# # "hostSocket" can include {{.Home}}, {{.Dir}}, {{.Name}}, {{.UID}}, and {{.User}}. +# # "reverse" can only be used for unix sockets right now, not for tcp sockets. +# # Put sockets into "{{.Dir}}/sock" to avoid collision with Lima internal sockets! +# # Sockets can also be forwarded to ports and vice versa, but not to/from a range of ports. +# # Forwarding requires the lima user to have rw access to the "guestsocket", +# # and the local user rwx access to the directory of the "hostsocket". +# +# # Lima internally appends this fallback rule at the end: +# - guestIP: "127.0.0.1" +# guestPortRange: [1, 65535] +# hostIP: "127.0.0.1" +# hostPortRange: [1, 65535] +# # Any port still not matched by a rule will not be forwarded (ignored) + +# Copy files from the guest to the host. Copied after provisioning scripts have been completed. +# copyToHost: +# - guest: "/etc/myconfig.cfg" +# host: "{{.Dir}}/copied-from-guest/myconfig" +# # deleteOnStop: false +# # "guest" can include these template variables: {{.Home}}, {{.UID}}, and {{.User}}. +# # "host" can include {{.Home}}, {{.Dir}}, {{.Name}}, {{.UID}}, and {{.User}}. +# # "deleteOnStop" will delete the file from the host when the instance is stopped. + +# Message. Information to be shown to the user, given as a Go template for the instance. +# The same template variables as for listing instances can be used, for example {{.Dir}}. +# You can view the complete list of variables using `limactl list --list-fields` command. +# It also includes {{.HostOS}} and {{.HostArch}} vars, for the runtime GOOS and GOARCH. +# 🟢 Builtin default: null +# message: | +# This will be shown to the user. + +# Extra environment variables that will be loaded into the VM at start up. +# These variables are consumed by internal init scripts, and also added +# to /etc/environment. +# If you set any of "ftp_proxy", "http_proxy", "https_proxy", or "no_proxy", then +# Lima will automatically set an uppercase variant to the same value as well. +# 🟢 Builtin default: null +# env: +# KEY: value + +# Lima will override the proxy environment variables with values from the current process +# environment (the environment in effect when you run `limactl start`). It will automatically +# replace the strings "localhost" and "127.0.0.1" with the host gateway address from inside +# the VM, so it stays routable. Use of the process environment can be disabled by setting +# propagateProxyEnv to false. +# 🟢 Builtn default: true +propagateProxyEnv: null + +# The host agent implements a DNS server that looks up host names on the host +# using the local system resolver. This means changing VPN and network settings +# are reflected automatically into the guest, including conditional forward, +# and mDNS lookup. By default only IPv4 addresses will be returned. IPv6 addresses +# can only work when using a vmnet network interface and the host has working +# IPv6 configured as well. +hostResolver: + # 🟢 Builtin default: true + enabled: null + # 🟢 Builtin default: false + ipv6: null + # Static names can be defined here as an alternative to adding them to the hosts /etc/hosts. + # Values can be either other hostnames, or IP addresses. The host.lima.internal name is + # predefined to specify the gateway address to the host. + # 🟢 Builtin default: null + hosts: + # guest.name: 127.1.1.1 + # host.name: host.lima.internal + +# If hostResolver.enabled is false, then the following rules apply for configuring dns: +# Explicitly set DNS addresses for qemu user-mode networking. By default qemu picks *one* +# nameserver from the host config and forwards all queries to this server. On macOS +# Lima adds the nameservers configured for the first host interface in service order, +# that has an IPv4 address, to the list. In case this still doesn't work (e.g. VPN +# setups), the servers can be specified here explicitly. If nameservers are specified +# here, then the configuration from network preferences will be ignored. +# 🟢 Builtin default: null +# dns: +# - 1.1.1.1 +# - 1.0.0.1 + +# Prefix to use for installing guest agent, and containerd with dependencies (if configured) +# 🟢 Builtin default: /usr/local +guestInstallPrefix: null + +# When the "plain" mode is enabled: +# - the YAML properties for mounts, port forwarding, containerd, etc. will be ignored +# - guest agent will not be running +# - dependency packages like sshfs will not be installed into the VM +# User-specified provisioning scripts will be still executed. +# 🟢 Builtin default: false +plain: null + +# ===================================================================== # +# GLOBAL DEFAULTS AND OVERRIDES +# ===================================================================== # + +# The builtin defaults can be changed globally by creating a $LIMA_HOME/_config/default.yaml +# file. It will be used by ALL instances under the same $LIMA_HOME, and it +# will be applied on each `limactl start`, so can affect instance restarts. + +# A similar mechanism is $LIMA_HOME/_config/override.yaml, which will take +# precedence even over the settings in an instances lima.yaml file. +# It too applies to ALL instances under the same $LIMA_HOME, and is applied +# on each restart. It can be used to globally override settings, e.g. make +# the mount of the home directory writable. + +# On each instance start the config settings are determined: If a value is +# not set in `lima.yaml`, then the `default.yaml` is used. If that file +# doesn't exist, or the value is not defined in the file, then the builtin +# default is used. If `override.yaml` exists and defines the value, then +# it overrides whatever has been chosen so far. + +# For slices (e.g. `mounts`, `provision`) and maps (`env`) the entries are +# combined instead of replacing each other. Slices are produced from override +# settings, followed by lima.yaml, followed by default.yaml (but NOT from +# builtin defaults). Maps are produced starting with default.yaml values, +# overwriting with lima.yaml ones, overwriting with override.yaml. + +# Exceptions: +# - `dns` will use the list from the highest priority file; they are not +# combined. If override.yaml defines a list of `dns` entries, then the +# settings in default.yaml and lima.yaml are ignored. +# +# - `mounts` will update the `writable` setting when 2 entries have the +# same `location` value. For this reason they are processed in the opposite +# order: starting with default, followed by lima, and then override. +# +# -`networks` will replace lower priority entries with the same `interface` +# name with higher priority definitions. This does not apply if the +# `interface` field is empty. `networks` are therefore also processed +# in lowest to highest priority order. + +# ===================================================================== # +# END OF TEMPLATE +# ===================================================================== # diff --git a/lima/share/lima/templates/deprecated/centos-7.yaml b/lima/share/lima/templates/deprecated/centos-7.yaml new file mode 100644 index 0000000..de4a37b --- /dev/null +++ b/lima/share/lima/templates/deprecated/centos-7.yaml @@ -0,0 +1,24 @@ +# This template requires Lima v0.10.0 or later. +# WARNING: RHEL-like below version 8 is unsupported, use at your own risk! +images: +- location: "https://cloud.centos.org/altarch/7/images/CentOS-7-x86_64-GenericCloud-2009.qcow2" + arch: "x86_64" + digest: "sha256:e38bab0475cc6d004d2e17015969c659e5a308111851b0e2715e84646035bdd3" +- location: "https://cloud.centos.org/altarch/7/images/CentOS-7-aarch64-GenericCloud-2009.qcow2" + arch: "aarch64" + digest: "sha256:51c0222aa4bc7d966fc044eb6ce9182993a1dc398eaa595e58abd0d361439baf" +# CentOS7 doesn't have support to systemd-user (https://bugzilla.redhat.com/show_bug.cgi?id=1173278) +# containerd as system works, but you'd need to use nerdctl in the shell of the instance as root +containerd: + system: false + user: false +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +firmware: + legacyBIOS: true +cpuType: + # Workaround for "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac + # https://bugs.launchpad.net/qemu/+bug/1838390 + x86_64: "Haswell-v4" diff --git a/lima/share/lima/templates/docker-rootful.yaml b/lima/share/lima/templates/docker-rootful.yaml new file mode 100644 index 0000000..ce254db --- /dev/null +++ b/lima/share/lima/templates/docker-rootful.yaml @@ -0,0 +1,84 @@ +# A template to use Docker (rootful) instead of containerd & nerdctl +# $ limactl start ./docker-rootful.yaml +# $ limactl shell docker-roootful docker run -it -v $HOME:$HOME --rm alpine + +# To run `docker` on the host (assumes docker-cli is installed): +# $ export DOCKER_HOST=$(limactl list docker-rootful --format 'unix://{{.Dir}}/sock/docker.sock') +# $ docker ... + +# This template requires Lima v0.20.0 or later +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +# containerd is managed by Docker, not by Lima, so the values are set to false here. +containerd: + system: false + user: false +provision: +- mode: system + # This script defines the host.docker.internal hostname when hostResolver is disabled. + # It is also needed for lima 0.8.2 and earlier, which does not support hostResolver.hosts. + # Names defined in /etc/hosts inside the VM are not resolved inside containers when + # using the hostResolver; use hostResolver.hosts instead (requires lima 0.8.3 or later). + script: | + #!/bin/sh + sed -i 's/host.lima.internal.*/host.lima.internal host.docker.internal/' /etc/hosts +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v docker >/dev/null 2>&1 && exit 0 + if [ ! -e /etc/systemd/system/docker.socket.d/override.conf ]; then + mkdir -p /etc/systemd/system/docker.socket.d + # Alternatively we could just add the user to the "docker" group, but that requires restarting the user session + cat <<-EOF >/etc/systemd/system/docker.socket.d/override.conf + [Socket] + SocketUser={{.User}} + EOF + fi + export DEBIAN_FRONTEND=noninteractive + curl -fsSL https://get.docker.com | sh +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v docker >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "docker is not installed yet" + exit 1 + fi + if ! timeout 30s bash -c "until pgrep dockerd; do sleep 3; done"; then + echo >&2 "dockerd is not running" + exit 1 + fi + hint: See "/var/log/cloud-init-output.log". in the guest +hostResolver: + # hostResolver.hosts requires lima 0.8.3 or later. Names defined here will also + # resolve inside containers, and not just inside the VM itself. + hosts: + host.docker.internal: host.lima.internal +portForwards: +- guestSocket: "/var/run/docker.sock" + hostSocket: "{{.Dir}}/sock/docker.sock" +message: | + To run `docker` on the host (assumes docker-cli is installed), run the following commands: + ------ + docker context create lima-{{.Name}} --docker "host=unix://{{.Dir}}/sock/docker.sock" + docker context use lima-{{.Name}} + docker run hello-world + ------ diff --git a/lima/share/lima/templates/docker.yaml b/lima/share/lima/templates/docker.yaml new file mode 100644 index 0000000..0ce8eee --- /dev/null +++ b/lima/share/lima/templates/docker.yaml @@ -0,0 +1,86 @@ +# A template to use Docker instead of containerd & nerdctl +# $ limactl start ./docker.yaml +# $ limactl shell docker docker run -it -v $HOME:$HOME --rm alpine + +# To run `docker` on the host (assumes docker-cli is installed): +# $ export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock') +# $ docker ... + +# This template requires Lima v0.8.0 or later +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +# containerd is managed by Docker, not by Lima, so the values are set to false here. +containerd: + system: false + user: false +provision: +- mode: system + # This script defines the host.docker.internal hostname when hostResolver is disabled. + # It is also needed for lima 0.8.2 and earlier, which does not support hostResolver.hosts. + # Names defined in /etc/hosts inside the VM are not resolved inside containers when + # using the hostResolver; use hostResolver.hosts instead (requires lima 0.8.3 or later). + script: | + #!/bin/sh + sed -i 's/host.lima.internal.*/host.lima.internal host.docker.internal/' /etc/hosts +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v docker >/dev/null 2>&1 && exit 0 + export DEBIAN_FRONTEND=noninteractive + curl -fsSL https://get.docker.com | sh + # NOTE: you may remove the lines below, if you prefer to use rootful docker, not rootless + systemctl disable --now docker + apt-get install -y uidmap dbus-user-session +- mode: user + script: | + #!/bin/bash + set -eux -o pipefail + systemctl --user start dbus + dockerd-rootless-setuptool.sh install + docker context use rootless +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v docker >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "docker is not installed yet" + exit 1 + fi + if ! timeout 30s bash -c "until pgrep rootlesskit; do sleep 3; done"; then + echo >&2 "rootlesskit (used by rootless docker) is not running" + exit 1 + fi + hint: See "/var/log/cloud-init-output.log". in the guest +hostResolver: + # hostResolver.hosts requires lima 0.8.3 or later. Names defined here will also + # resolve inside containers, and not just inside the VM itself. + hosts: + host.docker.internal: host.lima.internal +portForwards: +- guestSocket: "/run/user/{{.UID}}/docker.sock" + hostSocket: "{{.Dir}}/sock/docker.sock" +message: | + To run `docker` on the host (assumes docker-cli is installed), run the following commands: + ------ + docker context create lima-{{.Name}} --docker "host=unix://{{.Dir}}/sock/docker.sock" + docker context use lima-{{.Name}} + docker run hello-world + ------ diff --git a/lima/share/lima/templates/experimental/9p.yaml b/lima/share/lima/templates/experimental/9p.yaml new file mode 100644 index 0000000..25478be --- /dev/null +++ b/lima/share/lima/templates/experimental/9p.yaml @@ -0,0 +1,29 @@ +# This template requires Lima v0.10.0 or later. +# On macOS hosts, QEMU needs to be v7.0.0 or later. Homebrew's QEMU v6.2.0_1 can be used too. +# This template is planned to be merged to default.yaml in Lima v1.0 (ETA: 2022 Q2). +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" + 9p: + # Try choosing "mmap" or "none" if you see a stability issue with the default "fscache". + cache: "fscache" +- location: "/tmp/lima" + writable: true + 9p: + cache: "mmap" + +mountType: "9p" diff --git a/lima/share/lima/templates/experimental/armv7l.yaml b/lima/share/lima/templates/experimental/armv7l.yaml new file mode 100644 index 0000000..6789ec1 --- /dev/null +++ b/lima/share/lima/templates/experimental/armv7l.yaml @@ -0,0 +1,23 @@ +# This template requires Lima v0.17.0 or later. + +arch: "armv7l" +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-armhf.img" + arch: "armv7l" + digest: "sha256:8713000ae4d230acda4edb8c1161dcd71ffb6861eac0837bd1b3b0d5fe402f60" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-armhf.img" + arch: "armv7l" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +mountType: "9p" + +# We do not have arm-v7 binaries of containerd +containerd: + system: false + user: false diff --git a/lima/share/lima/templates/experimental/gentoo.yaml b/lima/share/lima/templates/experimental/gentoo.yaml new file mode 100644 index 0000000..c75374d --- /dev/null +++ b/lima/share/lima/templates/experimental/gentoo.yaml @@ -0,0 +1,15 @@ +vmType: "qemu" +images: +- location: "https://distfiles.gentoo.org/experimental/amd64/openstack/gentoo-openstack-amd64-default-latest.qcow2" + arch: "x86_64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +mountType: "9p" + +# The built-in containerd installer does not support Gentoo currently. +containerd: + system: false + user: false diff --git a/lima/share/lima/templates/experimental/net-user-v2.yaml b/lima/share/lima/templates/experimental/net-user-v2.yaml new file mode 100644 index 0000000..3c1682e --- /dev/null +++ b/lima/share/lima/templates/experimental/net-user-v2.yaml @@ -0,0 +1,17 @@ +# A template to run lima instance with experimental user-v2 network enabled +# This template requires Lima v0.16.0 or later. +images: +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +hostResolver: + hosts: + host.docker.internal: host.lima.internal +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +networks: +- lima: user-v2 diff --git a/lima/share/lima/templates/experimental/opensuse-tumbleweed.yaml b/lima/share/lima/templates/experimental/opensuse-tumbleweed.yaml new file mode 100644 index 0000000..c3fe0b1 --- /dev/null +++ b/lima/share/lima/templates/experimental/opensuse-tumbleweed.yaml @@ -0,0 +1,23 @@ +# NOTE: Tumbleweed image is known to be broken as of April 2023: +# https://github.com/lima-vm/lima/issues/1496 +# +# This template requires Lima v0.11.3 or later +images: +# Hint: run `limactl prune` to invalidate the "Current" cache +- location: "https://download.opensuse.org/tumbleweed/appliances/openSUSE-Tumbleweed-Minimal-VM.x86_64-Cloud.qcow2" + arch: "x86_64" +# JeOS is deprecated and will be removed probably, but Minimal-VM.aarch64-kvm-and-xen still lacks cloud-init +# https://bugzilla.opensuse.org/show_bug.cgi?id=1210246 +- location: "https://download.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.qcow2" + arch: "aarch64" +# download.opensuse.org is inaccessible from Japan (500 Internal Server Error) +# https://bugzilla.opensuse.org/show_bug.cgi?id=1210240 +- location: "https://provo-mirror.opensuse.org/tumbleweed/appliances/openSUSE-Tumbleweed-Minimal-VM.x86_64-Cloud.qcow2" + arch: "x86_64" +- location: "https://provo-mirror.opensuse.org/ports/aarch64/tumbleweed/appliances/openSUSE-Tumbleweed-ARM-JeOS-efi.aarch64.qcow2" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/experimental/riscv64.yaml b/lima/share/lima/templates/experimental/riscv64.yaml new file mode 100644 index 0000000..400843d --- /dev/null +++ b/lima/share/lima/templates/experimental/riscv64.yaml @@ -0,0 +1,30 @@ +# This template requires Lima v0.11.0 or later. + +arch: "riscv64" +images: +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-riscv64.img" + arch: "riscv64" + digest: "sha256:cf83a85b5cafdf994c4fe2647915547e3184169e76c7da642912c2f6e493681c" + kernel: + # Extracted from http://http.us.debian.org/debian/pool/main/u/u-boot/u-boot-qemu_2023.07+dfsg-1_all.deb (GPL-2.0) + location: "https://github.com/lima-vm/u-boot-qemu-mirror/releases/download/2023.07%2Bdfsg-7/qemu-riscv64_smode_uboot.elf" + digest: "sha256:d4b3a10c3ef04219641802a586dca905e768805f5a5164fb68520887df54f33c" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-riscv64.img" + arch: "riscv64" + kernel: + # Extracted from http://http.us.debian.org/debian/pool/main/u/u-boot/u-boot-qemu_2023.07+dfsg-1_all.deb (GPL-2.0) + location: "https://github.com/lima-vm/u-boot-qemu-mirror/releases/download/2023.07%2Bdfsg-1/qemu-riscv64_smode_uboot.elf" + digest: "sha256:d4b3a10c3ef04219641802a586dca905e768805f5a5164fb68520887df54f33c" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +mountType: "9p" + +# We do not have riscv64 binaries of containerd +containerd: + system: false + user: false diff --git a/lima/share/lima/templates/experimental/rke2.yaml b/lima/share/lima/templates/experimental/rke2.yaml new file mode 100644 index 0000000..bded4fc --- /dev/null +++ b/lima/share/lima/templates/experimental/rke2.yaml @@ -0,0 +1,76 @@ +# Deploy kubernetes via rke2 (which installs a bundled containerd). +# $ limactl start ./rke2.yaml +# $ limactl shell rke2 sudo kubectl +# +# It can be accessed from the host by exporting the kubeconfig file; +# the ports are already forwarded automatically by lima: +# +# $ export KUBECONFIG=$(limactl list rke2 --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml') +# $ kubectl get no +# NAME STATUS ROLES AGE VERSION +# lima-rke2 Ready control-plane,etcd,master 68s v1.27.3+rke2r1 +# +# For more details of RKE2, please refer to https://docs.rke2.io/ +# +# This template requires Lima v0.7.0 or later. + + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +# Mounts are disabled in this template, but can be enabled optionally. +mounts: [] + +# containerd is managed by rke2, not by Lima, so the values are set to false here. +containerd: + system: false + user: false + +provision: +- mode: system + script: | + #!/bin/sh + if [ ! -d /var/lib/rancher/rke2 ]; then + curl -sfL https://get.rke2.io | INSTALL_RKE2_CHANNEL=v1.29 sh - + fi + env | grep "http_proxy\|https_proxy\|no_proxy" > /etc/default/rke2-server + sed -i "s/http_proxy/CONTAINERD_HTTP_PROXY/g" /etc/default/rke2-server + sed -i "s/https_proxy/CONTAINERD_HTTPS_PROXY/g" /etc/default/rke2-server + sed -i "s/no_proxy/CONTAINERD_NO_PROXY/g" /etc/default/rke2-server + + systemctl start rke2-server.service + +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until test -f /etc/rancher/rke2/rke2.yaml; do sleep 3; done"; then + echo >&2 "rke2 is not running yet" + exit 1 + fi + hint: | + The rke2 kubeconfig file has not yet been created. + Run "limactl shell rke2 sudo journalctl -u rke2-server" to check the log. + If that is still empty, check the bottom of the log at "/var/log/cloud-init-output.log". +copyToHost: +- guest: "/etc/rancher/rke2/rke2.yaml" + host: "{{.Dir}}/copied-from-guest/kubeconfig.yaml" + deleteOnStop: true +message: | + To run `kubectl` on the host (assumes kubectl is installed), run the following commands: + ------ + export KUBECONFIG="{{.Dir}}/copied-from-guest/kubeconfig.yaml" + kubectl ... + ------ diff --git a/lima/share/lima/templates/experimental/u7s.yaml b/lima/share/lima/templates/experimental/u7s.yaml new file mode 100644 index 0000000..e32b590 --- /dev/null +++ b/lima/share/lima/templates/experimental/u7s.yaml @@ -0,0 +1,136 @@ +# Deploy kubernetes via usernetes. +# $ limactl start ./u7s.yaml +# $ limactl shell u7s kubectl + +# It can be accessed from the host by exporting the kubeconfig file; +# the ports are already forwarded automatically by lima: +# +# $ export KUBECONFIG=$(limactl list u7s --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml') +# $ kubectl get no +# NAME STATUS ROLES AGE VERSION +# u7s-lima-u7s Ready control-plane 33s v1.28.0 + +# This template requires Lima v0.8.0 or later +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +# Mounts are disabled in this template, but can be enabled optionally. +mounts: [] +# containerd is managed by Docker, not by Lima, so the values are set to false here. +containerd: + system: false + user: false +provision: +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v kubectl >/dev/null 2>&1 && exit 0 + version=$(curl -L -s https://dl.k8s.io/release/stable.txt) + case $(uname -m) in + x86_64) arch=amd64;; + aarch64) arch=arm64;; + esac + curl -L "https://dl.k8s.io/release/$version/bin/linux/$arch/kubectl" -o /usr/local/bin/kubectl + chmod 755 /usr/local/bin/kubectl + kubectl version --client +- mode: user + script: | + #!/bin/bash + set -eux -o pipefail + test -d ~/usernetes && exit 0 + cd ~ + git clone --branch=gen2-v20240203.0 https://github.com/rootless-containers/usernetes +- mode: user + script: | + #!/bin/bash + set -eux -o pipefail + cd ~/usernetes/init-host + sudo ./init-host.root.sh + ./init-host.rootless.sh +- mode: user + script: | + #!/bin/bash + set -eux -o pipefail + test -e ~/usernetes/kubeconfig && exit 0 + cd ~/usernetes + export KUBECONFIG=./kubeconfig + patch --forward -r - kubeadm-config.yaml </dev/null 2>&1; do sleep 3; done"; then + echo >&2 "kubectl is not installed yet" + exit 1 + fi + hint: | + See "/var/log/cloud-init-output.log". in the guest +- description: "kubeadm to be completed" + script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 300s bash -c "until test -f ~/usernetes/kubeconfig; do sleep 3; done"; then + echo >&2 "k8s is not running yet" + exit 1 + fi + hint: | + The k8s kubeconfig file has not yet been created. +- description: "kubernetes cluster to be running" + script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 300s bash -c "until kubectl version >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "kubernetes cluster is not up and running yet" + exit 1 + fi +- description: "coredns deployment to be running" + script: | + #!/bin/bash + set -eux -o pipefail + kubectl wait -n kube-system --timeout=180s --for=condition=available deploy coredns +copyToHost: +- guest: "{{.Home}}/usernetes/kubeconfig" + host: "{{.Dir}}/copied-from-guest/kubeconfig.yaml" + deleteOnStop: true +message: | + To run `kubectl` on the host (assumes kubectl is installed), run the following commands: + ------ + export KUBECONFIG="{{.Dir}}/copied-from-guest/kubeconfig.yaml" + kubectl ... + ------ diff --git a/lima/share/lima/templates/experimental/virtiofs-linux.yaml b/lima/share/lima/templates/experimental/virtiofs-linux.yaml new file mode 100644 index 0000000..06948ee --- /dev/null +++ b/lima/share/lima/templates/experimental/virtiofs-linux.yaml @@ -0,0 +1,26 @@ +# This template requires Lima v0.17.0 or later, running on Linux with: +# - QEMU v4.2.0 or later. +# - virtiofsd's Rust implementation: https://gitlab.com/virtio-fs/virtiofsd +# The QEMU version (qemu-virtiofsd) will *not* work, as it requires root access +# for all operations. +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true + +mountType: "virtiofs" diff --git a/lima/share/lima/templates/experimental/vnc.yaml b/lima/share/lima/templates/experimental/vnc.yaml new file mode 100644 index 0000000..fe0f0b6 --- /dev/null +++ b/lima/share/lima/templates/experimental/vnc.yaml @@ -0,0 +1,61 @@ +# A template to run ubuntu using display: vnc +# This template requires Lima v0.20.0 or later. +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true + +vmType: "qemu" +video: + display: "vnc" + +provision: +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v Xorg >/dev/null 2>&1 && exit 0 + export DEBIAN_FRONTEND=noninteractive + # x-terminal-emulator x-session-manager x-window-manager + apt-get install -y xorg xterm openbox hsetroot tint2 slim + printf "auto_login yes\ndefault_user {{.User}}\n" >>/etc/slim.conf + # configure some nice lima green, set up panel and apps + printf "hsetroot -solid \"#32CD32\" &\ntint2 &\n" >>/etc/xdg/openbox/autostart + sed -i 's/Clearlooks/Clearlooks-Olive/' /etc/xdg/openbox/rc.xml # go for green + apt-get install -y --no-install-recommends dillo xfe # x-www-browser +explorer +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + systemctl set-default graphical.target + systemctl isolate graphical.target +probes: +- description: "Xorg to be installed" + script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v Xorg >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "Xorg is not installed yet" + exit 1 + fi + hint: See "/var/log/cloud-init-output.log". in the guest +message: | + Use a VNC viewer or noVNC, to connect to the display: + + * VNC Display: see + * VNC Password: see diff --git a/lima/share/lima/templates/experimental/vz.yaml b/lima/share/lima/templates/experimental/vz.yaml new file mode 100644 index 0000000..6af217e --- /dev/null +++ b/lima/share/lima/templates/experimental/vz.yaml @@ -0,0 +1,27 @@ +# A template to run ubuntu using vmType: vz instead of qemu (Default) +# This template requires Lima v0.14.0 or later and macOS 13. +vmType: "vz" +rosetta: + # Enable Rosetta for Linux. + # Hint: try `softwareupdate --install-rosetta` if Lima gets stuck at `Installing rosetta...` + enabled: true + # Register rosetta to /proc/sys/fs/binfmt_misc + binfmt: true + +# Note: On Intel Mac, macOS >= 13.5 is required to boot kernel v6.2 (used by Ubuntu 23.04, Fedora 38, etc.) with vz. +# https://github.com/lima-vm/lima/issues/1577 +images: +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +mountType: "virtiofs" + +networks: +# The "vzNAT" IP address is accessible from the host, but not from other guests. +- vzNAT: true diff --git a/lima/share/lima/templates/experimental/wsl2.yaml b/lima/share/lima/templates/experimental/wsl2.yaml new file mode 100644 index 0000000..3fc32b0 --- /dev/null +++ b/lima/share/lima/templates/experimental/wsl2.yaml @@ -0,0 +1,17 @@ +# This template requires Lima v0.18.0 or later and only works on Windows versions +# that support WSL2 (Windows 10 Build >= 19041, all Windows 11). +vmType: wsl2 + +images: +# Source: https://github.com/runfinch/finch-core/blob/main/Dockerfile +- location: "https://deps.runfinch.com/common/x86-64/finch-rootfs-production-amd64-1694791577.tar.gz" + arch: "x86_64" + digest: "sha256:2d4d2e7386450899c6d0587fd0db21afadb31d974fa744aa9365c883935c5341" + +mountType: wsl2 + +# Use system because of an error when setting up RootlessKit (see https://github.com/microsoft/WSL/issues/8842) +# There are possible workarounds, just not implemented yet. +containerd: + system: true + user: false diff --git a/lima/share/lima/templates/faasd.yaml b/lima/share/lima/templates/faasd.yaml new file mode 100644 index 0000000..e4516bd --- /dev/null +++ b/lima/share/lima/templates/faasd.yaml @@ -0,0 +1,67 @@ +# Deploy faasd (which installs a bundled containerd). +# +# It can be accessed from the host by authenticating with faas-cli; +# the ports are already forwarded automatically by lima. +# +# This template requires Lima v0.7.0 or later. + +message: | + # Get the faas-cli from one of following sources: + # package manager: + brew install faas-cli + # + # script: + curl -sLS https://cli.openfaas.com | sh + # + # You can now log into your gateway: + ------ + export OPENFAAS_URL=http://localhost:8080 + limactl shell faasd sudo cat /var/lib/faasd/secrets/basic-auth-password | faas-cli login -u admin --password-stdin + ------ + # + # Once logged in, you can deploy your first function + ------ + faas-cli store deploy NodeInfo + ------ + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +# Mounts are disabled in this template, but can be enabled optionally. +mounts: [] + +# containerd is installed by the faasd installer script, not by Lima, so the values are set to false here. +containerd: + system: false + user: false + +provision: +- mode: user + script: | + #!/bin/sh + curl -sfL https://raw.githubusercontent.com/openfaas/faasd/master/hack/install.sh | bash -s - + +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/healthz)" != "200" ]]; do sleep 5; done'; then + echo >&2 "faasd is not running yet" + exit 1 + fi + hint: | + The faasd service is not yet running. + Run "limactl shell faasd sudo journalctl -u faasd" to check the log. + If that is still empty, check the bottom of the log at "/var/log/cloud-init-output.log". diff --git a/lima/share/lima/templates/fedora.yaml b/lima/share/lima/templates/fedora.yaml new file mode 100644 index 0000000..b12f6e8 --- /dev/null +++ b/lima/share/lima/templates/fedora.yaml @@ -0,0 +1,12 @@ +# This template requires Lima v0.7.0 or later. +images: +- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2" + arch: "x86_64" + digest: "sha256:ac58f3c35b73272d5986fa6d3bc44fd246b45df4c334e99a07b3bbd00684adee" +- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/aarch64/images/Fedora-Cloud-Base-Generic.aarch64-40-1.14.qcow2" + arch: "aarch64" + digest: "sha256:ebdce26d861a9d15072affe1919ed753ec7015bd97b3a7d0d0df6a10834f7459" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/k3s.yaml b/lima/share/lima/templates/k3s.yaml new file mode 100644 index 0000000..03df9b7 --- /dev/null +++ b/lima/share/lima/templates/k3s.yaml @@ -0,0 +1,66 @@ +# Deploy kubernetes via k3s (which installs a bundled containerd). +# $ limactl start ./k3s.yaml +# $ limactl shell k3s kubectl +# +# It can be accessed from the host by exporting the kubeconfig file; +# the ports are already forwarded automatically by lima: +# +# $ export KUBECONFIG=$(limactl list k3s --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml') +# $ kubectl get no +# NAME STATUS ROLES AGE VERSION +# lima-k3s Ready control-plane,master 69s v1.21.1+k3s1 +# +# This template requires Lima v0.7.0 or later. + +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +# Mounts are disabled in this template, but can be enabled optionally. +mounts: [] + +# containerd is managed by k3s, not by Lima, so the values are set to false here. +containerd: + system: false + user: false + +provision: +- mode: system + script: | + #!/bin/sh + if [ ! -d /var/lib/rancher/k3s ]; then + curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --write-kubeconfig-mode 644" sh - + fi +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until test -f /etc/rancher/k3s/k3s.yaml; do sleep 3; done"; then + echo >&2 "k3s is not running yet" + exit 1 + fi + hint: | + The k3s kubeconfig file has not yet been created. + Run "limactl shell k3s sudo journalctl -u k3s" to check the log. + If that is still empty, check the bottom of the log at "/var/log/cloud-init-output.log". +copyToHost: +- guest: "/etc/rancher/k3s/k3s.yaml" + host: "{{.Dir}}/copied-from-guest/kubeconfig.yaml" + deleteOnStop: true +message: | + To run `kubectl` on the host (assumes kubectl is installed), run the following commands: + ------ + export KUBECONFIG="{{.Dir}}/copied-from-guest/kubeconfig.yaml" + kubectl ... + ------ diff --git a/lima/share/lima/templates/k8s.yaml b/lima/share/lima/templates/k8s.yaml new file mode 100644 index 0000000..cd976de --- /dev/null +++ b/lima/share/lima/templates/k8s.yaml @@ -0,0 +1,180 @@ +# Deploy kubernetes via kubeadm. +# $ limactl start ./k8s.yaml +# $ limactl shell k8s kubectl + +# It can be accessed from the host by exporting the kubeconfig file; +# the ports are already forwarded automatically by lima: +# +# $ export KUBECONFIG=$(limactl list k8s --format 'unix://{{.Dir}}/copied-from-guest/kubeconfig.yaml') +# $ kubectl get no +# NAME STATUS ROLES AGE VERSION +# lima-k8s Ready control-plane,master 44s v1.22.3 + +# This template requires Lima v0.20.0 or later. +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +# Mounts are disabled in this template, but can be enabled optionally. +mounts: [] +containerd: + system: true + user: false +provision: +# See +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v kubeadm >/dev/null 2>&1 && exit 0 + # Install and configure prerequisites + cat < +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + grep SystemdCgroup /etc/containerd/config.toml && exit 0 + grep "version = 2" /etc/containerd/config.toml || exit 1 + # Configuring the systemd cgroup driver + # Overriding the sandbox (pause) image + cat <>/etc/containerd/config.toml + [plugins] + [plugins."io.containerd.grpc.v1.cri"] + sandbox_image = "$(kubeadm config images list | grep pause | sort -r | head -n1)" + [plugins."io.containerd.grpc.v1.cri".containerd] + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true + EOF + systemctl restart containerd +# See +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + test -e /etc/kubernetes/admin.conf && exit 0 + export KUBECONFIG=/etc/kubernetes/admin.conf + kubeadm config images list + kubeadm config images pull --cri-socket=unix:///run/containerd/containerd.sock + # Initializing your control-plane node + cat <kubeadm-config.yaml + kind: InitConfiguration + apiVersion: kubeadm.k8s.io/v1beta3 + nodeRegistration: + criSocket: unix:///run/containerd/containerd.sock + --- + kind: ClusterConfiguration + apiVersion: kubeadm.k8s.io/v1beta3 + apiServer: + certSANs: # --apiserver-cert-extra-sans + - "127.0.0.1" + networking: + podSubnet: "10.244.0.0/16" # --pod-network-cidr + --- + kind: KubeletConfiguration + apiVersion: kubelet.config.k8s.io/v1beta1 + cgroupDriver: systemd + EOF + kubeadm init --config kubeadm-config.yaml + # Installing a Pod network add-on + kubectl apply -f https://github.com/flannel-io/flannel/releases/download/v0.24.0/kube-flannel.yml + # Control plane node isolation + kubectl taint nodes --all node-role.kubernetes.io/control-plane- + # Replace the server address with localhost, so that it works also from the host + sed -e "/server:/ s|https://.*:\([0-9]*\)$|https://127.0.0.1:\1|" -i $KUBECONFIG + mkdir -p ${HOME:-/root}/.kube && cp -f $KUBECONFIG ${HOME:-/root}/.kube/config +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + export KUBECONFIG=/etc/kubernetes/admin.conf + mkdir -p {{.Home}}/.kube + cp -f $KUBECONFIG {{.Home}}/.kube/config + chown -R {{.User}} {{.Home}}/.kube +probes: +- description: "kubeadm to be installed" + script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v kubeadm >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "kubeadm is not installed yet" + exit 1 + fi + hint: | + See "/var/log/cloud-init-output.log". in the guest +- description: "kubeadm to be completed" + script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 300s bash -c "until test -f /etc/kubernetes/admin.conf; do sleep 3; done"; then + echo >&2 "k8s is not running yet" + exit 1 + fi + hint: | + The k8s kubeconfig file has not yet been created. +- description: "kubernetes cluster to be running" + script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 300s bash -c "until kubectl version >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "kubernetes cluster is not up and running yet" + exit 1 + fi +- description: "coredns deployment to be running" + script: | + #!/bin/bash + set -eux -o pipefail + kubectl wait -n kube-system --timeout=180s --for=condition=available deploy coredns +copyToHost: +- guest: "/etc/kubernetes/admin.conf" + host: "{{.Dir}}/copied-from-guest/kubeconfig.yaml" + deleteOnStop: true +message: | + To run `kubectl` on the host (assumes kubectl is installed), run the following commands: + ------ + export KUBECONFIG="{{.Dir}}/copied-from-guest/kubeconfig.yaml" + kubectl ... + ------ diff --git a/lima/share/lima/templates/opensuse.yaml b/lima/share/lima/templates/opensuse.yaml new file mode 100644 index 0000000..b6a74ec --- /dev/null +++ b/lima/share/lima/templates/opensuse.yaml @@ -0,0 +1,11 @@ +# This template requires Lima v0.7.0 or later +images: +# Hint: run `limactl prune` to invalidate the "Current" cache +- location: "https://download.opensuse.org/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2" + arch: "x86_64" +- location: "https://download.opensuse.org/distribution/leap/15.5/appliances/openSUSE-Leap-15.5-Minimal-VM.aarch64-Cloud.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/oraclelinux-8.yaml b/lima/share/lima/templates/oraclelinux-8.yaml new file mode 100644 index 0000000..7f74949 --- /dev/null +++ b/lima/share/lima/templates/oraclelinux-8.yaml @@ -0,0 +1,25 @@ +# This template requires Lima v0.9.0 or later. +# Oracle image licence: https://www.oracle.com/downloads/licenses/oracle-linux-license.html +# Image source: https://yum.oracle.com/oracle-linux-templates.html + +# NOTE: EL8-based distros are known not to work on M1 chips: https://github.com/lima-vm/lima/issues/841 +# EL9-based distros are known to work. + +images: +- location: "https://yum.oracle.com/templates/OracleLinux/OL8/u9/x86_64/OL8U9_x86_64-kvm-b210.qcow" + arch: "x86_64" + digest: "sha256:1a2764476748c57bcf5bf9a9fcfa445da77b62d06614a87599e4b483426c8758" +- location: "https://yum.oracle.com/templates/OracleLinux/OL8/u9/aarch64/OL8U9_aarch64-kvm-b47.qcow" + arch: "aarch64" + digest: "sha256:f6ea4019b67e873606fc47b88639da1a52320d7bc6453d918915b22a77247be5" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +firmware: + # Oracle Linux 8 still requires legacyBIOS, while AlmaLinux 8 and Rocky Linux 8 do not. + legacyBIOS: true +cpuType: + # Workaround for "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac + # https://bugs.launchpad.net/qemu/+bug/1838390 + x86_64: "Haswell-v4" diff --git a/lima/share/lima/templates/oraclelinux-9.yaml b/lima/share/lima/templates/oraclelinux-9.yaml new file mode 100644 index 0000000..721941c --- /dev/null +++ b/lima/share/lima/templates/oraclelinux-9.yaml @@ -0,0 +1,18 @@ +# This template requires Lima v0.11.3 or later. +# Oracle image licence: https://www.oracle.com/downloads/licenses/oracle-linux-license.html +# Image source: https://yum.oracle.com/oracle-linux-templates.html + +images: +- location: "https://yum.oracle.com/templates/OracleLinux/OL9/u3/x86_64/OL9U3_x86_64-kvm-b211.qcow" + arch: "x86_64" + digest: "sha256:b37061c50d341d01b674455eca404d0bdcf2c8391665eca7e601cbd4aef456f8" +- location: "https://yum.oracle.com/templates/OracleLinux/OL9/u3/aarch64/OL9U3_aarch64-kvm-b50.qcow" + arch: "aarch64" + digest: "sha256:14428b531c1e2c76cd33bdbd69acc4d65ec9c12dd5eef7c8c1de2119adc3f8c8" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +firmware: + # Oracle Linux 9 still requires legacyBIOS, while AlmaLinux 9 and Rocky Linux 9 do not. + legacyBIOS: true diff --git a/lima/share/lima/templates/oraclelinux.yaml b/lima/share/lima/templates/oraclelinux.yaml new file mode 100644 index 0000000..721941c --- /dev/null +++ b/lima/share/lima/templates/oraclelinux.yaml @@ -0,0 +1,18 @@ +# This template requires Lima v0.11.3 or later. +# Oracle image licence: https://www.oracle.com/downloads/licenses/oracle-linux-license.html +# Image source: https://yum.oracle.com/oracle-linux-templates.html + +images: +- location: "https://yum.oracle.com/templates/OracleLinux/OL9/u3/x86_64/OL9U3_x86_64-kvm-b211.qcow" + arch: "x86_64" + digest: "sha256:b37061c50d341d01b674455eca404d0bdcf2c8391665eca7e601cbd4aef456f8" +- location: "https://yum.oracle.com/templates/OracleLinux/OL9/u3/aarch64/OL9U3_aarch64-kvm-b50.qcow" + arch: "aarch64" + digest: "sha256:14428b531c1e2c76cd33bdbd69acc4d65ec9c12dd5eef7c8c1de2119adc3f8c8" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +firmware: + # Oracle Linux 9 still requires legacyBIOS, while AlmaLinux 9 and Rocky Linux 9 do not. + legacyBIOS: true diff --git a/lima/share/lima/templates/podman-rootful.yaml b/lima/share/lima/templates/podman-rootful.yaml new file mode 100644 index 0000000..3e89811 --- /dev/null +++ b/lima/share/lima/templates/podman-rootful.yaml @@ -0,0 +1,70 @@ +# A template to use Podman instead of containerd & nerdctl +# $ limactl start ./podman-rootful.yaml +# $ limactl shell podman-rootful sudo podman run -it -v $HOME:$HOME --rm docker.io/library/alpine + +# To run `podman` on the host (assumes podman-remote is installed): +# $ export CONTAINER_HOST=$(limactl list podman-rootful --format 'unix://{{.Dir}}/sock/podman.sock') +# $ podman --remote ... + +# To run `docker` on the host (assumes docker-cli is installed): +# $ export DOCKER_HOST=$(limactl list podman-rootful --format 'unix://{{.Dir}}/sock/podman.sock') +# $ docker ... + +# This template requires Lima v0.20.0 or later +images: +- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2" + arch: "x86_64" + digest: "sha256:ac58f3c35b73272d5986fa6d3bc44fd246b45df4c334e99a07b3bbd00684adee" +- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/aarch64/images/Fedora-Cloud-Base-Generic.aarch64-40-1.14.qcow2" + arch: "aarch64" + digest: "sha256:ebdce26d861a9d15072affe1919ed753ec7015bd97b3a7d0d0df6a10834f7459" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +containerd: + system: false + user: false +provision: +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v podman >/dev/null 2>&1 && exit 0 + if [ ! -e /etc/systemd/system/podman.socket.d/override.conf ]; then + mkdir -p /etc/systemd/system/podman.socket.d + cat <<-EOF >/etc/systemd/system/podman.socket.d/override.conf + [Socket] + SocketUser={{.User}} + EOF + fi + if [ ! -e /etc/tmpfiles.d/podman.conf ]; then + mkdir -p /etc/tmpfiles.d + echo "d /run/podman 0700 {{.User}} -" > /etc/tmpfiles.d/podman.conf + fi + dnf -y install podman +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + systemctl --system enable --now podman.socket +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v podman >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "podman is not installed yet" + exit 1 + fi + hint: See "/var/log/cloud-init-output.log" in the guest +portForwards: +- guestSocket: "/run/podman/podman.sock" + hostSocket: "{{.Dir}}/sock/podman.sock" +message: | + To run `podman` on the host (assumes podman-remote is installed), run the following commands: + ------ + podman system connection add lima-{{.Name}} "unix://{{.Dir}}/sock/podman.sock" + podman system connection default lima-{{.Name}} + podman{{if eq .HostOS "linux"}} --remote{{end}} run quay.io/podman/hello + ------ diff --git a/lima/share/lima/templates/podman.yaml b/lima/share/lima/templates/podman.yaml new file mode 100644 index 0000000..9133444 --- /dev/null +++ b/lima/share/lima/templates/podman.yaml @@ -0,0 +1,59 @@ +# A template to use Podman instead of containerd & nerdctl +# $ limactl start ./podman.yaml +# $ limactl shell podman podman run -it -v $HOME:$HOME --rm docker.io/library/alpine + +# To run `podman` on the host (assumes podman-remote is installed): +# $ export CONTAINER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock') +# $ podman --remote ... + +# To run `docker` on the host (assumes docker-cli is installed): +# $ export DOCKER_HOST=$(limactl list podman --format 'unix://{{.Dir}}/sock/podman.sock') +# $ docker ... + +# This template requires Lima v0.8.0 or later +images: +- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2" + arch: "x86_64" + digest: "sha256:ac58f3c35b73272d5986fa6d3bc44fd246b45df4c334e99a07b3bbd00684adee" +- location: "https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/aarch64/images/Fedora-Cloud-Base-Generic.aarch64-40-1.14.qcow2" + arch: "aarch64" + digest: "sha256:ebdce26d861a9d15072affe1919ed753ec7015bd97b3a7d0d0df6a10834f7459" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +containerd: + system: false + user: false +provision: +- mode: system + script: | + #!/bin/bash + set -eux -o pipefail + command -v podman >/dev/null 2>&1 && exit 0 + dnf -y install podman +- mode: user + script: | + #!/bin/bash + set -eux -o pipefail + systemctl --user enable --now podman.socket +probes: +- script: | + #!/bin/bash + set -eux -o pipefail + if ! timeout 30s bash -c "until command -v podman >/dev/null 2>&1; do sleep 3; done"; then + echo >&2 "podman is not installed yet" + exit 1 + fi + hint: See "/var/log/cloud-init-output.log" in the guest +portForwards: +- guestSocket: "/run/user/{{.UID}}/podman/podman.sock" + hostSocket: "{{.Dir}}/sock/podman.sock" +message: | + To run `podman` on the host (assumes podman-remote is installed), run the following commands: + ------ + podman system connection add lima-{{.Name}} "unix://{{.Dir}}/sock/podman.sock" + podman system connection default lima-{{.Name}} + podman{{if eq .HostOS "linux"}} --remote{{end}} run quay.io/podman/hello + ------ diff --git a/lima/share/lima/templates/rocky-8.yaml b/lima/share/lima/templates/rocky-8.yaml new file mode 100644 index 0000000..f40cd5c --- /dev/null +++ b/lima/share/lima/templates/rocky-8.yaml @@ -0,0 +1,26 @@ +# This template requires Lima v0.8.3 or later. + +# NOTE: EL8-based distros are known not to work on M1 chips: https://github.com/lima-vm/lima/issues/841 +# EL9-based distros are known to work. + +images: +- location: "https://dl.rockylinux.org/pub/rocky/8.9/images/x86_64/Rocky-8-GenericCloud-Base-8.9-20231119.0.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:d17f15a7649dd064795306c114b90fc5062e7d5fefa9e9f0bd6b7ce1aeac3ae5" +- location: "https://dl.rockylinux.org/pub/rocky/8.9/images/aarch64/Rocky-8-GenericCloud-Base-8.9-20231119.0.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:801c1afc27b8d200702193312c342f39f1418ed37f8501e6f07e9f707196df44" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://dl.rockylinux.org/pub/rocky/8/images/x86_64/Rocky-8-GenericCloud.latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://dl.rockylinux.org/pub/rocky/8/images/aarch64/Rocky-8-GenericCloud.latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +cpuType: + # Workaround for "vmx_write_mem: mmu_gva_to_gpa XXXXXXXXXXXXXXXX failed" on Intel Mac + # https://bugs.launchpad.net/qemu/+bug/1838390 + x86_64: "Haswell-v4" diff --git a/lima/share/lima/templates/rocky-9.yaml b/lima/share/lima/templates/rocky-9.yaml new file mode 100644 index 0000000..9140f67 --- /dev/null +++ b/lima/share/lima/templates/rocky-9.yaml @@ -0,0 +1,19 @@ +# This template requires Lima v0.11.1 or later. + +images: +- location: "https://dl.rockylinux.org/pub/rocky/9.3/images/x86_64/Rocky-9-GenericCloud-Base-9.3-20231113.0.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:7713278c37f29b0341b0a841ca3ec5c3724df86b4d97e7ee4a2a85def9b2e651" +- location: "https://dl.rockylinux.org/pub/rocky/9.3/images/aarch64/Rocky-9-GenericCloud-Base-9.3-20231113.0.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:1948a5e00786dbf3230335339cf96491659e17444f5d00dabac0f095a7354cc1" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://dl.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://dl.rockylinux.org/pub/rocky/9/images/aarch64/Rocky-9-GenericCloud.latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/rocky.yaml b/lima/share/lima/templates/rocky.yaml new file mode 100644 index 0000000..9140f67 --- /dev/null +++ b/lima/share/lima/templates/rocky.yaml @@ -0,0 +1,19 @@ +# This template requires Lima v0.11.1 or later. + +images: +- location: "https://dl.rockylinux.org/pub/rocky/9.3/images/x86_64/Rocky-9-GenericCloud-Base-9.3-20231113.0.x86_64.qcow2" + arch: "x86_64" + digest: "sha256:7713278c37f29b0341b0a841ca3ec5c3724df86b4d97e7ee4a2a85def9b2e651" +- location: "https://dl.rockylinux.org/pub/rocky/9.3/images/aarch64/Rocky-9-GenericCloud-Base-9.3-20231113.0.aarch64.qcow2" + arch: "aarch64" + digest: "sha256:1948a5e00786dbf3230335339cf96491659e17444f5d00dabac0f095a7354cc1" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://dl.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2" + arch: "x86_64" +- location: "https://dl.rockylinux.org/pub/rocky/9/images/aarch64/Rocky-9-GenericCloud.latest.aarch64.qcow2" + arch: "aarch64" +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/ubuntu-lts.yaml b/lima/share/lima/templates/ubuntu-lts.yaml new file mode 100644 index 0000000..30dbd34 --- /dev/null +++ b/lima/share/lima/templates/ubuntu-lts.yaml @@ -0,0 +1,20 @@ +# This template requires Lima v0.7.0 or later. +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/ubuntu.yaml b/lima/share/lima/templates/ubuntu.yaml new file mode 100644 index 0000000..30dbd34 --- /dev/null +++ b/lima/share/lima/templates/ubuntu.yaml @@ -0,0 +1,20 @@ +# This template requires Lima v0.7.0 or later. +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true diff --git a/lima/share/lima/templates/vmnet.yaml b/lima/share/lima/templates/vmnet.yaml new file mode 100644 index 0000000..69ffadb --- /dev/null +++ b/lima/share/lima/templates/vmnet.yaml @@ -0,0 +1,40 @@ +# A template to enable vmnet.framework. + +# Usage: +# brew install socket_vmnet +# limactl sudoers >etc_sudoers.d_lima +# sudo install -o root etc_sudoers.d_lima /etc/sudoers.d/lima +# limactl start template://vmnet + +# This template requires Lima v0.7.0 or later. +# Older versions of Lima were using a different syntax for supporting vmnet.framework. +images: +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +mounts: +- location: "~" +- location: "/tmp/lima" + writable: true +networks: +# The instance can get routable IP addresses from the vmnet framework using +# https://github.com/lima-vm/socket_vmnet (since Lima v0.12). +# +# Available networks are defined in +# $LIMA_HOME/_config/networks.yaml. Supported network types are "host", +# "shared", or "bridged". +# +# Interface "lima0": shared mode (IP is assigned by macOS's bootpd) +- lima: shared +# Interface "lima1": bridged mode (IP is assigned by a DHCP server on the physical network) +# - lima: bridged diff --git a/lima/share/man/man1/lima.1 b/lima/share/man/man1/lima.1 new file mode 100644 index 0000000..3d86a61 --- /dev/null +++ b/lima/share/man/man1/lima.1 @@ -0,0 +1,26 @@ +.nh +.TH LIMA 1 + +.SH NAME +.PP +lima - Lima: Linux virtual machines + + +.SH SYNOPSIS +.PP +\fBlima\fP [\fICOMMAND\fP\&...] + + +.SH DESCRIPTION +.PP +lima is an alias for "limactl shell default". +The instance name ("default") can be changed by specifying $LIMA_INSTANCE. + +.PP +The shell and initial workdir inside the instance can be specified via $LIMA_SHELL +and $LIMA_WORKDIR. + + +.SH SEE ALSO +.PP +\fBlimactl\fP(1) diff --git a/lima/share/man/man1/limactl-completion-bash.1 b/lima/share/man/man1/limactl-completion-bash.1 new file mode 100644 index 0000000..31825cf --- /dev/null +++ b/lima/share/man/man1/limactl-completion-bash.1 @@ -0,0 +1,72 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-completion-bash - Generate the autocompletion script for bash + + +.SH SYNOPSIS +.PP +\fBlimactl completion bash\fP + + +.SH DESCRIPTION +.PP +Generate the autocompletion script for the bash shell. + +.PP +This script depends on the 'bash-completion' package. +If it is not installed already, you can install it via your OS's package manager. + +.PP +To load completions in your current shell session: + +.EX +source <(limactl completion bash) +.EE + +.PP +To load completions for every new session, execute once: + +.SS Linux: +.EX +limactl completion bash > /etc/bash_completion.d/limactl +.EE + +.SS macOS: +.EX +limactl completion bash > $(brew --prefix)/etc/bash_completion.d/limactl +.EE + +.PP +You will need to start a new shell for this setup to take effect. + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for bash + +.PP +\fB--no-descriptions\fP[=false] + disable completion descriptions + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-completion(1)\fP diff --git a/lima/share/man/man1/limactl-completion-fish.1 b/lima/share/man/man1/limactl-completion-fish.1 new file mode 100644 index 0000000..016c58b --- /dev/null +++ b/lima/share/man/man1/limactl-completion-fish.1 @@ -0,0 +1,62 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-completion-fish - Generate the autocompletion script for fish + + +.SH SYNOPSIS +.PP +\fBlimactl completion fish [flags]\fP + + +.SH DESCRIPTION +.PP +Generate the autocompletion script for the fish shell. + +.PP +To load completions in your current shell session: + +.EX +limactl completion fish | source +.EE + +.PP +To load completions for every new session, execute once: + +.EX +limactl completion fish > ~/.config/fish/completions/limactl.fish +.EE + +.PP +You will need to start a new shell for this setup to take effect. + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for fish + +.PP +\fB--no-descriptions\fP[=false] + disable completion descriptions + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-completion(1)\fP diff --git a/lima/share/man/man1/limactl-completion-powershell.1 b/lima/share/man/man1/limactl-completion-powershell.1 new file mode 100644 index 0000000..e89d8cc --- /dev/null +++ b/lima/share/man/man1/limactl-completion-powershell.1 @@ -0,0 +1,56 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-completion-powershell - Generate the autocompletion script for powershell + + +.SH SYNOPSIS +.PP +\fBlimactl completion powershell [flags]\fP + + +.SH DESCRIPTION +.PP +Generate the autocompletion script for powershell. + +.PP +To load completions in your current shell session: + +.EX +limactl completion powershell | Out-String | Invoke-Expression +.EE + +.PP +To load completions for every new session, add the output of the above command +to your powershell profile. + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for powershell + +.PP +\fB--no-descriptions\fP[=false] + disable completion descriptions + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-completion(1)\fP diff --git a/lima/share/man/man1/limactl-completion-zsh.1 b/lima/share/man/man1/limactl-completion-zsh.1 new file mode 100644 index 0000000..40d2864 --- /dev/null +++ b/lima/share/man/man1/limactl-completion-zsh.1 @@ -0,0 +1,76 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-completion-zsh - Generate the autocompletion script for zsh + + +.SH SYNOPSIS +.PP +\fBlimactl completion zsh [flags]\fP + + +.SH DESCRIPTION +.PP +Generate the autocompletion script for the zsh shell. + +.PP +If shell completion is not already enabled in your environment you will need +to enable it. You can execute the following once: + +.EX +echo "autoload -U compinit; compinit" >> ~/.zshrc +.EE + +.PP +To load completions in your current shell session: + +.EX +source <(limactl completion zsh) +.EE + +.PP +To load completions for every new session, execute once: + +.SS Linux: +.EX +limactl completion zsh > "${fpath[1]}/_limactl" +.EE + +.SS macOS: +.EX +limactl completion zsh > $(brew --prefix)/share/zsh/site-functions/_limactl +.EE + +.PP +You will need to start a new shell for this setup to take effect. + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for zsh + +.PP +\fB--no-descriptions\fP[=false] + disable completion descriptions + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-completion(1)\fP diff --git a/lima/share/man/man1/limactl-completion.1 b/lima/share/man/man1/limactl-completion.1 new file mode 100644 index 0000000..5a97f44 --- /dev/null +++ b/lima/share/man/man1/limactl-completion.1 @@ -0,0 +1,42 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-completion - Generate the autocompletion script for the specified shell + + +.SH SYNOPSIS +.PP +\fBlimactl completion [flags]\fP + + +.SH DESCRIPTION +.PP +Generate the autocompletion script for limactl for the specified shell. +See each sub-command's help for details on how to use the generated script. + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for completion + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP, \fBlimactl-completion-bash(1)\fP, \fBlimactl-completion-fish(1)\fP, \fBlimactl-completion-powershell(1)\fP, \fBlimactl-completion-zsh(1)\fP diff --git a/lima/share/man/man1/limactl-copy.1 b/lima/share/man/man1/limactl-copy.1 new file mode 100644 index 0000000..fe0f7e1 --- /dev/null +++ b/lima/share/man/man1/limactl-copy.1 @@ -0,0 +1,51 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-copy - Copy files between host and guest + + +.SH SYNOPSIS +.PP +\fBlimactl copy SOURCE ... TARGET [flags]\fP + + +.SH DESCRIPTION +.PP +Copy files between host and guest + +.PP +Prefix guest filenames with the instance name and a colon. + +.PP +Example: limactl copy default:/etc/os-release . + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for copy + +.PP +\fB-r\fP, \fB--recursive\fP[=false] + copy directories recursively + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-create.1 b/lima/share/man/man1/limactl-create.1 new file mode 100644 index 0000000..bdcccc4 --- /dev/null +++ b/lima/share/man/man1/limactl-create.1 @@ -0,0 +1,143 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-create - Create an instance of Lima + + +.SH SYNOPSIS +.PP +\fBlimactl create FILE.yaml|URL [flags]\fP + + +.SH DESCRIPTION +.PP +Create an instance of Lima + + +.SH OPTIONS +.PP +\fB--arch\fP="" + machine architecture (x86_64, aarch64, riscv64) + +.PP +\fB--containerd\fP="" + containerd mode (user, system, user+system, none) + +.PP +\fB--cpus\fP=0 + number of CPUs + +.PP +\fB--disk\fP=0 + disk size in GiB + +.PP +\fB--dns\fP=[] + specify custom DNS (disable host resolver) + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for create + +.PP +\fB--list-templates\fP[=false] + list available templates and exit + +.PP +\fB--memory\fP=0 + memory in GiB + +.PP +\fB--mount\fP=[] + directories to mount, suffix ':w' for writable (Do not specify directories that overlap with the existing mounts) + +.PP +\fB--mount-inotify\fP[=false] + enable inotify for mounts + +.PP +\fB--mount-type\fP="" + mount type (reverse-sshfs, 9p, virtiofs) + +.PP +\fB--mount-writable\fP[=false] + make all mounts writable + +.PP +\fB--name\fP="" + override the instance name + +.PP +\fB--network\fP=[] + additional networks, e.g., "vzNAT" or "lima:shared" to assign vmnet IP + +.PP +\fB--plain\fP[=false] + plain mode. Disable mounts, port forwarding, containerd, etc. + +.PP +\fB--rosetta\fP[=false] + enable Rosetta (for vz instances) + +.PP +\fB--set\fP="" + modify the template inplace, using yq syntax + +.PP +\fB--video\fP[=false] + enable video output (has negative performance impact for QEMU) + +.PP +\fB--vm-type\fP="" + virtual machine type (qemu, vz) + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +To create an instance "default" from the default Ubuntu template: +$ limactl create + +To create an instance "default" from a template "docker": +$ limactl create --name=default template://docker + +To create an instance "default" with modified parameters: +$ limactl create --cpus=2 --memory=2 + +To create an instance "default" with yq expressions: +$ limactl create --set='.cpus = 2 | .memory = "2GiB"' + +To see the template list: +$ limactl create --list-templates + +To create an instance "default" from a local file: +$ limactl create --name=default /usr/local/share/lima/templates/fedora.yaml + +To create an instance "default" from a remote URL (use carefully, with a trustable source): +$ limactl create --name=default https://raw.githubusercontent.com/lima-vm/lima/master/examples/alpine.yaml + +To create an instance "local" from a template passed to stdin (--name parameter is required): +$ cat template.yaml | limactl create --name=local - + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-delete.1 b/lima/share/man/man1/limactl-delete.1 new file mode 100644 index 0000000..5eaec26 --- /dev/null +++ b/lima/share/man/man1/limactl-delete.1 @@ -0,0 +1,45 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-delete - Delete an instance of Lima. + + +.SH SYNOPSIS +.PP +\fBlimactl delete INSTANCE [INSTANCE, ...] [flags]\fP + + +.SH DESCRIPTION +.PP +Delete an instance of Lima. + + +.SH OPTIONS +.PP +\fB-f\fP, \fB--force\fP[=false] + forcibly kill the processes + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for delete + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-disk-create.1 b/lima/share/man/man1/limactl-disk-create.1 new file mode 100644 index 0000000..46067a6 --- /dev/null +++ b/lima/share/man/man1/limactl-disk-create.1 @@ -0,0 +1,58 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-disk-create - Create a Lima disk + + +.SH SYNOPSIS +.PP +\fBlimactl disk create DISK [flags]\fP + + +.SH DESCRIPTION +.PP +Create a Lima disk + + +.SH OPTIONS +.PP +\fB--format\fP="qcow2" + specify the disk format + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for create + +.PP +\fB--size\fP="" + configure the disk size + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +To create a new disk: +$ limactl disk create DISK --size SIZE [--format qcow2] + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl-disk(1)\fP diff --git a/lima/share/man/man1/limactl-disk-delete.1 b/lima/share/man/man1/limactl-disk-delete.1 new file mode 100644 index 0000000..a0cc527 --- /dev/null +++ b/lima/share/man/man1/limactl-disk-delete.1 @@ -0,0 +1,57 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-disk-delete - Delete one or more Lima disks + + +.SH SYNOPSIS +.PP +\fBlimactl disk delete DISK [DISK, ...] [flags]\fP + + +.SH DESCRIPTION +.PP +Delete one or more Lima disks + + +.SH OPTIONS +.PP +\fB-f\fP, \fB--force\fP[=false] + force delete + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for delete + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +To delete a disk: +$ limactl disk delete DISK + +To delete multiple disks: +$ limactl disk delete DISK1 DISK2 ... + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl-disk(1)\fP diff --git a/lima/share/man/man1/limactl-disk-list.1 b/lima/share/man/man1/limactl-disk-list.1 new file mode 100644 index 0000000..e2b4fd2 --- /dev/null +++ b/lima/share/man/man1/limactl-disk-list.1 @@ -0,0 +1,54 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-disk-list - List existing Lima disks + + +.SH SYNOPSIS +.PP +\fBlimactl disk list [flags]\fP + + +.SH DESCRIPTION +.PP +List existing Lima disks + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for list + +.PP +\fB--json\fP[=false] + JSONify output + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +To list existing disks: +$ limactl disk list + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl-disk(1)\fP diff --git a/lima/share/man/man1/limactl-disk-resize.1 b/lima/share/man/man1/limactl-disk-resize.1 new file mode 100644 index 0000000..8aeaab2 --- /dev/null +++ b/lima/share/man/man1/limactl-disk-resize.1 @@ -0,0 +1,53 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-disk-resize - Resize existing Lima disk + + +.SH SYNOPSIS +.PP +\fBlimactl disk resize DISK [flags]\fP + + +.SH DESCRIPTION +.PP +Resize existing Lima disk + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for resize + +.PP +\fB--size\fP="" + Disk size + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +Resize a disk: +$ limactl disk resize DISK --size SIZE +.EE + + +.SH SEE ALSO +.PP +\fBlimactl-disk(1)\fP diff --git a/lima/share/man/man1/limactl-disk-unlock.1 b/lima/share/man/man1/limactl-disk-unlock.1 new file mode 100644 index 0000000..f51bd84 --- /dev/null +++ b/lima/share/man/man1/limactl-disk-unlock.1 @@ -0,0 +1,55 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-disk-unlock - Unlock one or more Lima disks + + +.SH SYNOPSIS +.PP +\fBlimactl disk unlock DISK [DISK, ...] [flags]\fP + + +.SH DESCRIPTION +.PP +Unlock one or more Lima disks + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for unlock + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +Emergency recovery! If an instance is force stopped, it may leave a disk locked while not actually using it. + +To unlock a disk: +$ limactl disk unlock DISK + +To unlock multiple disks: +$ limactl disk unlock DISK1 DISK2 ... + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl-disk(1)\fP diff --git a/lima/share/man/man1/limactl-disk.1 b/lima/share/man/man1/limactl-disk.1 new file mode 100644 index 0000000..e33bb50 --- /dev/null +++ b/lima/share/man/man1/limactl-disk.1 @@ -0,0 +1,57 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-disk - Lima disk management + + +.SH SYNOPSIS +.PP +\fBlimactl disk [flags]\fP + + +.SH DESCRIPTION +.PP +Lima disk management + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for disk + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + Create a disk: + $ limactl disk create DISK --size SIZE [--format qcow2] + + List existing disks: + $ limactl disk ls + + Delete a disk: + $ limactl disk delete DISK + + Resize a disk: + $ limactl disk resize DISK --size SIZE +.EE + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP, \fBlimactl-disk-create(1)\fP, \fBlimactl-disk-delete(1)\fP, \fBlimactl-disk-list(1)\fP, \fBlimactl-disk-resize(1)\fP, \fBlimactl-disk-unlock(1)\fP diff --git a/lima/share/man/man1/limactl-edit.1 b/lima/share/man/man1/limactl-edit.1 new file mode 100644 index 0000000..701bc7b --- /dev/null +++ b/lima/share/man/man1/limactl-edit.1 @@ -0,0 +1,85 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-edit - Edit an instance of Lima + + +.SH SYNOPSIS +.PP +\fBlimactl edit INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +Edit an instance of Lima + + +.SH OPTIONS +.PP +\fB--cpus\fP=0 + number of CPUs + +.PP +\fB--dns\fP=[] + specify custom DNS (disable host resolver) + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for edit + +.PP +\fB--memory\fP=0 + memory in GiB + +.PP +\fB--mount\fP=[] + directories to mount, suffix ':w' for writable (Do not specify directories that overlap with the existing mounts) + +.PP +\fB--mount-inotify\fP[=false] + enable inotify for mounts + +.PP +\fB--mount-type\fP="" + mount type (reverse-sshfs, 9p, virtiofs) + +.PP +\fB--mount-writable\fP[=false] + make all mounts writable + +.PP +\fB--network\fP=[] + additional networks, e.g., "vzNAT" or "lima:shared" to assign vmnet IP + +.PP +\fB--rosetta\fP[=false] + enable Rosetta (for vz instances) + +.PP +\fB--set\fP="" + modify the template inplace, using yq syntax + +.PP +\fB--video\fP[=false] + enable video output (has negative performance impact for QEMU) + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-factory-reset.1 b/lima/share/man/man1/limactl-factory-reset.1 new file mode 100644 index 0000000..a259713 --- /dev/null +++ b/lima/share/man/man1/limactl-factory-reset.1 @@ -0,0 +1,41 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-factory-reset - Factory reset an instance of Lima + + +.SH SYNOPSIS +.PP +\fBlimactl factory-reset INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +Factory reset an instance of Lima + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for factory-reset + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-info.1 b/lima/share/man/man1/limactl-info.1 new file mode 100644 index 0000000..af3bf04 --- /dev/null +++ b/lima/share/man/man1/limactl-info.1 @@ -0,0 +1,41 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-info - Show diagnostic information + + +.SH SYNOPSIS +.PP +\fBlimactl info [flags]\fP + + +.SH DESCRIPTION +.PP +Show diagnostic information + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for info + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-list.1 b/lima/share/man/man1/limactl-list.1 new file mode 100644 index 0000000..cc7e412 --- /dev/null +++ b/lima/share/man/man1/limactl-list.1 @@ -0,0 +1,81 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-list - List instances of Lima. + + +.SH SYNOPSIS +.PP +\fBlimactl list [flags] [INSTANCE]...\fP + + +.SH DESCRIPTION +.PP +List instances of Lima. + +.PP +The output can be presented in one of several formats, using the --format flag. + +.PP +--format json - output in json format + --format yaml - output in yaml format + --format table - output in table format + --format '{{ }}' - if the format begins and ends with '{{ }}', then it is used as a go template. + +.PP +These functions are available to go templates: + +.PP +indent : add spaces to beginning of each line + missing : return message if the text is empty + +.PP +The following legacy flags continue to function: + --json - equal to '--format json' + + +.SH OPTIONS +.PP +\fB--all-fields\fP[=false] + Show all fields + +.PP +\fB-f\fP, \fB--format\fP="table" + output format, one of: json, yaml, table, go-template + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for list + +.PP +\fB--json\fP[=false] + JSONify output + +.PP +\fB--list-fields\fP[=false] + List fields available for format + +.PP +\fB-q\fP, \fB--quiet\fP[=false] + Only show names + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-protect.1 b/lima/share/man/man1/limactl-protect.1 new file mode 100644 index 0000000..fba7c59 --- /dev/null +++ b/lima/share/man/man1/limactl-protect.1 @@ -0,0 +1,42 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-protect - Protect an instance to prohibit accidental removal + + +.SH SYNOPSIS +.PP +\fBlimactl protect INSTANCE [INSTANCE, ...] [flags]\fP + + +.SH DESCRIPTION +.PP +Protect an instance to prohibit accidental removal via the 'limactl delete' command. +The instance is not being protected against removal via '/bin/rm', Finder, etc. + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for protect + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-prune.1 b/lima/share/man/man1/limactl-prune.1 new file mode 100644 index 0000000..f790174 --- /dev/null +++ b/lima/share/man/man1/limactl-prune.1 @@ -0,0 +1,41 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-prune - Prune garbage objects + + +.SH SYNOPSIS +.PP +\fBlimactl prune [flags]\fP + + +.SH DESCRIPTION +.PP +Prune garbage objects + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for prune + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-shell.1 b/lima/share/man/man1/limactl-shell.1 new file mode 100644 index 0000000..68b7383 --- /dev/null +++ b/lima/share/man/man1/limactl-shell.1 @@ -0,0 +1,59 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-shell - Execute shell in Lima + + +.SH SYNOPSIS +.PP +\fBlimactl shell [flags] INSTANCE [COMMAND...]\fP + + +.SH DESCRIPTION +.PP +Execute shell in Lima + +.PP +lima command is provided as an alias for limactl shell $LIMA_INSTANCE. $LIMA_INSTANCE defaults to "default". + +.PP +By default, the first 'ssh' executable found in the host's PATH is used to connect to the Lima instance. +A custom ssh alias can be used instead by setting the $SSH environment variable. + +.PP +Hint: try --debug to show the detailed logs, if it seems hanging (mostly due to some SSH issue). + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for shell + +.PP +\fB--shell\fP="" + shell interpreter, e.g. /bin/bash + +.PP +\fB--workdir\fP="" + working directory + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-show-ssh.1 b/lima/share/man/man1/limactl-show-ssh.1 new file mode 100644 index 0000000..651cb8e --- /dev/null +++ b/lima/share/man/man1/limactl-show-ssh.1 @@ -0,0 +1,82 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-show-ssh - Show the ssh command line (DEPRECATED; use \fBssh -F\fR instead) + + +.SH SYNOPSIS +.PP +\fBlimactl show-ssh [flags] INSTANCE\fP + + +.SH DESCRIPTION +.PP +Show the ssh command line (DEPRECATED) + +.PP +WARNING: 'limactl show-ssh' is deprecated. +Instead, use 'ssh -F ~/.lima/default/ssh.config lima-default' . + + +.SH OPTIONS +.PP +\fB-f\fP, \fB--format\fP="cmd" + Format: cmd, args, options, config + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for show-ssh + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + + "cmd" format (default): Full ssh command line. + $ limactl show-ssh --format=cmd default + ssh -o IdentityFile="/Users/example/.lima/_config/user" -o User=example -o Hostname=127.0.0.1 -o Port=60022 lima-default + + "args" format: Similar to the cmd format but omits "ssh" and the destination address + $ limactl show-ssh --format=args default + -o IdentityFile="/Users/example/.lima/_config/user" -o User=example -o Hostname=127.0.0.1 -o Port=60022 + + "options" format: ssh option key value pairs + $ limactl show-ssh --format=options default + IdentityFile="/Users/example/.lima/_config/user" + User=example + Hostname=127.0.0.1 + Port=60022 + + "config" format: ~/.ssh/config format + $ limactl show-ssh --format=config default + Host lima-default + IdentityFile "/Users/example/.lima/_config/user " + User example + Hostname 127.0.0.1 + Port 60022 + + To show the config file path: + $ limactl ls --format='{{.SSHConfigFile}}' default + /Users/example/.lima/default/ssh.config + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-snapshot-apply.1 b/lima/share/man/man1/limactl-snapshot-apply.1 new file mode 100644 index 0000000..a462f42 --- /dev/null +++ b/lima/share/man/man1/limactl-snapshot-apply.1 @@ -0,0 +1,45 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-snapshot-apply - Apply (load) a snapshot + + +.SH SYNOPSIS +.PP +\fBlimactl snapshot apply INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +Apply (load) a snapshot + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for apply + +.PP +\fB--tag\fP="" + name of the snapshot + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-snapshot(1)\fP diff --git a/lima/share/man/man1/limactl-snapshot-create.1 b/lima/share/man/man1/limactl-snapshot-create.1 new file mode 100644 index 0000000..33870d1 --- /dev/null +++ b/lima/share/man/man1/limactl-snapshot-create.1 @@ -0,0 +1,45 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-snapshot-create - Create (save) a snapshot + + +.SH SYNOPSIS +.PP +\fBlimactl snapshot create INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +Create (save) a snapshot + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for create + +.PP +\fB--tag\fP="" + name of the snapshot + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-snapshot(1)\fP diff --git a/lima/share/man/man1/limactl-snapshot-delete.1 b/lima/share/man/man1/limactl-snapshot-delete.1 new file mode 100644 index 0000000..8c4f1fc --- /dev/null +++ b/lima/share/man/man1/limactl-snapshot-delete.1 @@ -0,0 +1,45 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-snapshot-delete - Delete (del) a snapshot + + +.SH SYNOPSIS +.PP +\fBlimactl snapshot delete INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +Delete (del) a snapshot + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for delete + +.PP +\fB--tag\fP="" + name of the snapshot + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-snapshot(1)\fP diff --git a/lima/share/man/man1/limactl-snapshot-list.1 b/lima/share/man/man1/limactl-snapshot-list.1 new file mode 100644 index 0000000..ea116af --- /dev/null +++ b/lima/share/man/man1/limactl-snapshot-list.1 @@ -0,0 +1,45 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-snapshot-list - List existing snapshots + + +.SH SYNOPSIS +.PP +\fBlimactl snapshot list INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +List existing snapshots + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for list + +.PP +\fB-q\fP, \fB--quiet\fP[=false] + Only show tags + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl-snapshot(1)\fP diff --git a/lima/share/man/man1/limactl-snapshot.1 b/lima/share/man/man1/limactl-snapshot.1 new file mode 100644 index 0000000..30eca23 --- /dev/null +++ b/lima/share/man/man1/limactl-snapshot.1 @@ -0,0 +1,41 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-snapshot - Manage instance snapshots + + +.SH SYNOPSIS +.PP +\fBlimactl snapshot [flags]\fP + + +.SH DESCRIPTION +.PP +Manage instance snapshots + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for snapshot + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP, \fBlimactl-snapshot-apply(1)\fP, \fBlimactl-snapshot-create(1)\fP, \fBlimactl-snapshot-delete(1)\fP, \fBlimactl-snapshot-list(1)\fP diff --git a/lima/share/man/man1/limactl-start-at-login.1 b/lima/share/man/man1/limactl-start-at-login.1 new file mode 100644 index 0000000..809b3ff --- /dev/null +++ b/lima/share/man/man1/limactl-start-at-login.1 @@ -0,0 +1,45 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-start-at-login - Register/Unregister an autostart file for the instance + + +.SH SYNOPSIS +.PP +\fBlimactl start-at-login INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +Register/Unregister an autostart file for the instance + + +.SH OPTIONS +.PP +\fB--enabled\fP[=true] + Automatically start the instance when the user logs in + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for start-at-login + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-start.1 b/lima/share/man/man1/limactl-start.1 new file mode 100644 index 0000000..24d3109 --- /dev/null +++ b/lima/share/man/man1/limactl-start.1 @@ -0,0 +1,136 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-start - Start an instance of Lima + + +.SH SYNOPSIS +.PP +\fBlimactl start NAME|FILE.yaml|URL [flags]\fP + + +.SH DESCRIPTION +.PP +Start an instance of Lima + + +.SH OPTIONS +.PP +\fB--arch\fP="" + [limactl create] machine architecture (x86_64, aarch64, riscv64) + +.PP +\fB--containerd\fP="" + [limactl create] containerd mode (user, system, user+system, none) + +.PP +\fB--cpus\fP=0 + [limactl create] number of CPUs + +.PP +\fB--disk\fP=0 + [limactl create] disk size in GiB + +.PP +\fB--dns\fP=[] + [limactl create] specify custom DNS (disable host resolver) + +.PP +\fB--foreground\fP[=false] + run the hostagent in the foreground + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for start + +.PP +\fB--list-templates\fP[=false] + [limactl create] list available templates and exit + +.PP +\fB--memory\fP=0 + [limactl create] memory in GiB + +.PP +\fB--mount\fP=[] + [limactl create] directories to mount, suffix ':w' for writable (Do not specify directories that overlap with the existing mounts) + +.PP +\fB--mount-inotify\fP[=false] + [limactl create] enable inotify for mounts + +.PP +\fB--mount-type\fP="" + [limactl create] mount type (reverse-sshfs, 9p, virtiofs) + +.PP +\fB--mount-writable\fP[=false] + [limactl create] make all mounts writable + +.PP +\fB--name\fP="" + [limactl create] override the instance name + +.PP +\fB--network\fP=[] + [limactl create] additional networks, e.g., "vzNAT" or "lima:shared" to assign vmnet IP + +.PP +\fB--plain\fP[=false] + [limactl create] plain mode. Disable mounts, port forwarding, containerd, etc. + +.PP +\fB--rosetta\fP[=false] + [limactl create] enable Rosetta (for vz instances) + +.PP +\fB--set\fP="" + [limactl create] modify the template inplace, using yq syntax + +.PP +\fB--timeout\fP=10m0s + duration to wait for the instance to be running before timing out + +.PP +\fB--video\fP[=false] + [limactl create] enable video output (has negative performance impact for QEMU) + +.PP +\fB--vm-type\fP="" + [limactl create] virtual machine type (qemu, vz) + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +To create an instance "default" (if not created yet) from the default Ubuntu template, and start it: +$ limactl start + +To create an instance "default" from a template "docker", and start it: +$ limactl start --name=default template://docker + +\&'limactl start' also accepts the 'limactl create' flags such as '--set'. +See the examples in 'limactl create --help'. + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-stop.1 b/lima/share/man/man1/limactl-stop.1 new file mode 100644 index 0000000..7e6ae34 --- /dev/null +++ b/lima/share/man/man1/limactl-stop.1 @@ -0,0 +1,45 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-stop - Stop an instance + + +.SH SYNOPSIS +.PP +\fBlimactl stop INSTANCE [flags]\fP + + +.SH DESCRIPTION +.PP +Stop an instance + + +.SH OPTIONS +.PP +\fB-f\fP, \fB--force\fP[=false] + force stop the instance + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for stop + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-sudoers.1 b/lima/share/man/man1/limactl-sudoers.1 new file mode 100644 index 0000000..e5a5efc --- /dev/null +++ b/lima/share/man/man1/limactl-sudoers.1 @@ -0,0 +1,60 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-sudoers - Generate the content of the /etc/sudoers.d/lima file + + +.SH SYNOPSIS +.PP +\fBlimactl sudoers [--check [SUDOERSFILE-TO-CHECK]] [flags]\fP + + +.SH DESCRIPTION +.PP +Generate the content of the /etc/sudoers.d/lima file for enabling vmnet.framework support. +The content is written to stdout, NOT to the file. +This command must not run as the root. +See /usr/local/share/doc/lima/docs/network.md for the usage. + + +.SH OPTIONS +.PP +\fB--check\fP[=false] + check that the sudoers file is up-to-date with "~/.lima/_config/networks.yaml" + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for sudoers + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + +To generate the /etc/sudoers.d/lima file: +$ limactl sudoers | sudo tee /etc/sudoers.d/lima + +To validate the existing /etc/sudoers.d/lima file: +$ limactl sudoers --check /etc/sudoers.d/lima + +.EE + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-unprotect.1 b/lima/share/man/man1/limactl-unprotect.1 new file mode 100644 index 0000000..1337c4d --- /dev/null +++ b/lima/share/man/man1/limactl-unprotect.1 @@ -0,0 +1,41 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-unprotect - Unprotect an instance + + +.SH SYNOPSIS +.PP +\fBlimactl unprotect INSTANCE [INSTANCE, ...] [flags]\fP + + +.SH DESCRIPTION +.PP +Unprotect an instance + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for unprotect + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl-validate.1 b/lima/share/man/man1/limactl-validate.1 new file mode 100644 index 0000000..4b57b53 --- /dev/null +++ b/lima/share/man/man1/limactl-validate.1 @@ -0,0 +1,41 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +limactl-validate - Validate YAML files + + +.SH SYNOPSIS +.PP +\fBlimactl validate FILE.yaml [FILE.yaml, ...] [flags]\fP + + +.SH DESCRIPTION +.PP +Validate YAML files + + +.SH OPTIONS +.PP +\fB-h\fP, \fB--help\fP[=false] + help for validate + + +.SH OPTIONS INHERITED FROM PARENT COMMANDS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH SEE ALSO +.PP +\fBlimactl(1)\fP diff --git a/lima/share/man/man1/limactl.1 b/lima/share/man/man1/limactl.1 new file mode 100644 index 0000000..1b36e1b --- /dev/null +++ b/lima/share/man/man1/limactl.1 @@ -0,0 +1,57 @@ +.nh +.TH "LIMACTL" "1" "May 2024" "" "" + +.SH NAME +.PP +limactl - Lima: Linux virtual machines + + +.SH SYNOPSIS +.PP +\fBlimactl [flags]\fP + + +.SH DESCRIPTION +.PP +Lima: Linux virtual machines + + +.SH OPTIONS +.PP +\fB--debug\fP[=false] + debug mode + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for limactl + +.PP +\fB--log-level\fP="" + Set the logging level [trace, debug, info, warn, error] + +.PP +\fB--tty\fP[=false] + Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation. + + +.SH EXAMPLE +.EX + Start the default instance: + $ limactl start + + Open a shell: + $ lima + + Run a container: + $ lima nerdctl run -d --name nginx -p 8080:80 nginx:alpine + + Stop the default instance: + $ limactl stop + + See also template YAMLs: /usr/local/share/lima/templates +.EE + + +.SH SEE ALSO +.PP +\fBlimactl-completion(1)\fP, \fBlimactl-copy(1)\fP, \fBlimactl-create(1)\fP, \fBlimactl-delete(1)\fP, \fBlimactl-disk(1)\fP, \fBlimactl-edit(1)\fP, \fBlimactl-factory-reset(1)\fP, \fBlimactl-info(1)\fP, \fBlimactl-list(1)\fP, \fBlimactl-protect(1)\fP, \fBlimactl-prune(1)\fP, \fBlimactl-shell(1)\fP, \fBlimactl-show-ssh(1)\fP, \fBlimactl-snapshot(1)\fP, \fBlimactl-start(1)\fP, \fBlimactl-start-at-login(1)\fP, \fBlimactl-stop(1)\fP, \fBlimactl-sudoers(1)\fP, \fBlimactl-unprotect(1)\fP, \fBlimactl-validate(1)\fP diff --git a/lima/share/zsh/site-functions/_limactl b/lima/share/zsh/site-functions/_limactl new file mode 100644 index 0000000..e1bb8fb --- /dev/null +++ b/lima/share/zsh/site-functions/_limactl @@ -0,0 +1,212 @@ +#compdef limactl +compdef _limactl limactl + +# zsh completion for limactl -*- shell-script -*- + +__limactl_debug() +{ + local file="$BASH_COMP_DEBUG_FILE" + if [[ -n ${file} ]]; then + echo "$*" >> "${file}" + fi +} + +_limactl() +{ + local shellCompDirectiveError=1 + local shellCompDirectiveNoSpace=2 + local shellCompDirectiveNoFileComp=4 + local shellCompDirectiveFilterFileExt=8 + local shellCompDirectiveFilterDirs=16 + local shellCompDirectiveKeepOrder=32 + + local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder + local -a completions + + __limactl_debug "\n========= starting completion logic ==========" + __limactl_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CURRENT location, so we need + # to truncate the command-line ($words) up to the $CURRENT location. + # (We cannot use $CURSOR as its value does not work when a command is an alias.) + words=("${=words[1,CURRENT]}") + __limactl_debug "Truncated words[*]: ${words[*]}," + + lastParam=${words[-1]} + lastChar=${lastParam[-1]} + __limactl_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" + + # For zsh, when completing a flag with an = (e.g., limactl -n=) + # completions must be prefixed with the flag + setopt local_options BASH_REMATCH + if [[ "${lastParam}" =~ '-.*=' ]]; then + # We are dealing with a flag with an = + flagPrefix="-P ${BASH_REMATCH}" + fi + + # Prepare the command to obtain completions + requestComp="${words[1]} __complete ${words[2,-1]}" + if [ "${lastChar}" = "" ]; then + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go completion code. + __limactl_debug "Adding extra empty parameter" + requestComp="${requestComp} \"\"" + fi + + __limactl_debug "About to call: eval ${requestComp}" + + # Use eval to handle any environment variables and such + out=$(eval ${requestComp} 2>/dev/null) + __limactl_debug "completion output: ${out}" + + # Extract the directive integer following a : from the last line + local lastLine + while IFS='\n' read -r line; do + lastLine=${line} + done < <(printf "%s\n" "${out[@]}") + __limactl_debug "last line: ${lastLine}" + + if [ "${lastLine[1]}" = : ]; then + directive=${lastLine[2,-1]} + # Remove the directive including the : and the newline + local suffix + (( suffix=${#lastLine}+2)) + out=${out[1,-$suffix]} + else + # There is no directive specified. Leave $out as is. + __limactl_debug "No directive found. Setting do default" + directive=0 + fi + + __limactl_debug "directive: ${directive}" + __limactl_debug "completions: ${out}" + __limactl_debug "flagPrefix: ${flagPrefix}" + + if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then + __limactl_debug "Completion received error. Ignoring completions." + return + fi + + local activeHelpMarker="_activeHelp_ " + local endIndex=${#activeHelpMarker} + local startIndex=$((${#activeHelpMarker}+1)) + local hasActiveHelp=0 + while IFS='\n' read -r comp; do + # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) + if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then + __limactl_debug "ActiveHelp found: $comp" + comp="${comp[$startIndex,-1]}" + if [ -n "$comp" ]; then + compadd -x "${comp}" + __limactl_debug "ActiveHelp will need delimiter" + hasActiveHelp=1 + fi + + continue + fi + + if [ -n "$comp" ]; then + # If requested, completions are returned with a description. + # The description is preceded by a TAB character. + # For zsh's _describe, we need to use a : instead of a TAB. + # We first need to escape any : as part of the completion itself. + comp=${comp//:/\\:} + + local tab="$(printf '\t')" + comp=${comp//$tab/:} + + __limactl_debug "Adding completion: ${comp}" + completions+=${comp} + lastComp=$comp + fi + done < <(printf "%s\n" "${out[@]}") + + # Add a delimiter after the activeHelp statements, but only if: + # - there are completions following the activeHelp statements, or + # - file completion will be performed (so there will be choices after the activeHelp) + if [ $hasActiveHelp -eq 1 ]; then + if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then + __limactl_debug "Adding activeHelp delimiter" + compadd -x "--" + hasActiveHelp=0 + fi + fi + + if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then + __limactl_debug "Activating nospace." + noSpace="-S ''" + fi + + if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then + __limactl_debug "Activating keep order." + keepOrder="-V" + fi + + if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then + # File extension filtering + local filteringCmd + filteringCmd='_files' + for filter in ${completions[@]}; do + if [ ${filter[1]} != '*' ]; then + # zsh requires a glob pattern to do file filtering + filter="\*.$filter" + fi + filteringCmd+=" -g $filter" + done + filteringCmd+=" ${flagPrefix}" + + __limactl_debug "File filtering command: $filteringCmd" + _arguments '*:filename:'"$filteringCmd" + elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then + # File completion for directories only + local subdir + subdir="${completions[1]}" + if [ -n "$subdir" ]; then + __limactl_debug "Listing directories in $subdir" + pushd "${subdir}" >/dev/null 2>&1 + else + __limactl_debug "Listing directories in ." + fi + + local result + _arguments '*:dirname:_files -/'" ${flagPrefix}" + result=$? + if [ -n "$subdir" ]; then + popd >/dev/null 2>&1 + fi + return $result + else + __limactl_debug "Calling _describe" + if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then + __limactl_debug "_describe found some completions" + + # Return the success of having called _describe + return 0 + else + __limactl_debug "_describe did not find completions." + __limactl_debug "Checking if we should do file completion." + if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then + __limactl_debug "deactivating file completion" + + # We must return an error code here to let zsh know that there were no + # completions found by _describe; this is what will trigger other + # matching algorithms to attempt to find completions. + # For example zsh can match letters in the middle of words. + return 1 + else + # Perform file completion + __limactl_debug "Activating file completion" + + # We must return the result of this command, so it must be the + # last command, or else we must store its result to return it. + _arguments '*:filename:_files'" ${flagPrefix}" + fi + fi + fi +} + +# don't run the completion function when being source-ed or eval-ed +if [ "$funcstack[1]" = "_limactl" ]; then + _limactl +fi diff --git a/python-sandbox.py b/python-sandbox.py new file mode 100644 index 0000000..1c2dff1 --- /dev/null +++ b/python-sandbox.py @@ -0,0 +1,62 @@ +from sandbox import * +import sys, pickle, os + +def main(): + if not os.path.exists(os.path.join(os.getcwd(), "sandbox_overseer.pickle")): + overseer = sandbox_overseer() + else: + with open('sandbox_overseer.pickle', 'rb') as file: + # Deserialize and load the object from the file + overseer = pickle.load(file) + args = sys.argv + if len(args) == 2 and args[-1] in ["-h", "--h", "--help", "-help"]: + print("python-sandbox usage instructions") + print("1. To start a NEW sandbox BOXNAME:") + print("python python-sandbox.py start BOX_NAME") + print("1. To restart a sandbox BOXNAME:") + print("python python-sandbox.py restart BOX_NAME") + print("2. To pip install pacakges on sandbox BOXNAME:") + print("python python-sandbox.py BOX_NAME pip install ARGS") + print("3. To run a python file on sandbox BOXNAME:") + print("python python-sandbox.py BOX_NAME python PYFILE.py ARGS...") + print("4. To stop a sandbox BOXNAME:") + print("python python-sandbox.py stop BOX_NAME") + print("5. To show all sandboxes ") + print("python python-sandbox.py show-all") + elif len(args) == 2 and args[-1] == "show-all": + if overseer.running_sandbox is None and len(overseer.halted_sandboxes) == 0: + print("There is no sandbox") + if overseer.running_sandbox is not None: + print(f"{overseer.running_sandbox}---->RUNNING") + for stopped_box in overseer.halted_sandboxes: + print(f"{stopped_box}---->STOPPED") + elif len(args) == 3 and args[1] == "start": + box_name = args[-1] + if len(box_name) < 3: + print(f"Chosen box name {box_name} is too short") + return + box = sandbox(name=box_name, overseer=overseer) + overseer.add_box(box) + assert overseer.boxes[box_name].start() + elif len(args) == 3 and args[1] == "restart": + box_name = args[-1] + assert overseer.restart_sandbox(box_name) + elif len(args) == 3 and args[1] == "stop": + box_name = args[-1] + assert overseer.boxes[box_name].stop() + elif len(args) > 3 and args[3].endswith(".py") and args[2] == "python": + box_name = args[1] + py_args = args[3:] + assert overseer.boxes[box_name].run_py(" ".join(py_args)) + elif len(args) > 4 and args[-3] == "pip" and args[-2] == "install": + box_name = args[1] + pip_args = args[4:] + assert overseer.boxes[box_name].run_pip_install(" ".join(pip_args)) + else: + print("Can't understand your instruction, please use --help to get more info") + + with open('sandbox_overseer.pickle', 'wb') as file: + pickle.dump(overseer, file) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/python-sandbox.yml b/python-sandbox.yml new file mode 100644 index 0000000..6b98080 --- /dev/null +++ b/python-sandbox.yml @@ -0,0 +1,24 @@ +images: +# Try to use release-yyyyMMdd image if available. Note that release-yyyyMMdd will be removed after several months. +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" + digest: "sha256:32a9d30d18803da72f5936cf2b7b9efcb4d0bb63c67933f17e3bdfd1751de3f3" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + digest: "sha256:c841bac00925d3e6892d979798103a867931f255f28fefd9d5e07e3e22d0ef22" +# Fallback to the latest release image. +# Hint: run `limactl prune` to invalidate the cache +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" + arch: "x86_64" +- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img" + arch: "aarch64" + +cpus: 4 +memory: 4GiB +disk: 4GiB + +mounts: +- location: "~" + writable: true +- location: "/tmp/lima" + writable: true \ No newline at end of file diff --git a/samples/.DS_Store b/samples/.DS_Store new file mode 100644 index 0000000..2031ca4 Binary files /dev/null and b/samples/.DS_Store differ diff --git a/samples/1st.gif b/samples/1st.gif new file mode 100644 index 0000000..7c28249 Binary files /dev/null and b/samples/1st.gif differ diff --git a/samples/gorillaVM.gif b/samples/gorillaVM.gif new file mode 100644 index 0000000..0b8c411 Binary files /dev/null and b/samples/gorillaVM.gif differ diff --git a/sandbox.py b/sandbox.py new file mode 100644 index 0000000..8fb65e1 --- /dev/null +++ b/sandbox.py @@ -0,0 +1,157 @@ +import os +import subprocess + +class sandbox_overseer: + def __init__(self, lima_bin_loc=None): + # currently only one sandbox is allowed at a time + self.boxes = dict() + self.running_sandbox = None + self.halted_sandboxes = set() + lima_bin_path = os.path.join(os.getcwd(), "lima", "bin") + self.limactl = os.path.join(lima_bin_path, "limactl") if lima_bin_loc is None else os.path.join(lima_bin_loc, "limactl") + + def add_box(self, box): + self.boxes[box.name] = box + + def run_command(self, command: str): + result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if result.returncode != 0: + print(f"Error executing command: {command}") + return False + else: + return True + + def process_command_request(self, sandbox_name: str, command: str): + # Currently only running sandbox's command would be processed + # More policies should be updated + if sandbox_name != self.running_sandbox: + print("Invalid sandbox") + return False + else: + self.run_command(command) + return True + + def process_vm_script_request(self, sandbox_name: str, shell_script: str): + if sandbox_name != self.running_sandbox: + print("Invalid sandbox") + return False + result = subprocess.run(f"{self.limactl} shell {sandbox_name} {shell_script}", shell=True) + if result.returncode != 0: + print(f"Error executing command: {shell_script}") + return False + else: + return True + + def create_sandbox(self, sandbox_name: str): + if sandbox_name in self.halted_sandboxes or sandbox_name == self.running_sandbox: + print("Sandbox name already used") + return False + # Default home directory ~/.lima + home_dir = os.path.expanduser("~") + sandbox_path = os.path.join(home_dir, ".lima", sandbox_name) + if not os.path.exists(sandbox_path): + self.run_command(f"{self.limactl} create python-sandbox.yml --name={sandbox_name}") + print(f"{sandbox_name} created successfully!") + return True + else: + print(f"{sandbox_name} had already instantiated") + return True + + def start_sandbox(self, sandbox_name: str): + if not self.create_sandbox(sandbox_name): + return False + print(f"Starting sandbox {sandbox_name}!") + if sandbox_name == self.running_sandbox: + print(f"Sandbox {sandbox_name} already started") + return True + if not self.run_command(f"{self.limactl} start {sandbox_name}"): + print(f"Sandbox {sandbox_name} failed to start") + return False + print(f"Sandbox {sandbox_name} started successfully!") + self.running_sandbox = sandbox_name + return True + + def restart_sandbox(self, sandbox_name: str): + if not self.running_sandbox is None: + print(f"Sandbox {self.running_sandbox} is running, can't restart {sandbox_name}") + return False + if not sandbox_name in self.halted_sandboxes: + print(f"Sandbox {sandbox_name} doesn't exist in stopped list") + return False + print(f"Restarting sandbox {sandbox_name}") + if not self.run_command(f"{self.limactl} start {sandbox_name}"): + print(f"Sandbox {sandbox_name} failed to restart") + return False + print(f"Sandbox {sandbox_name} restarted successfully!") + self.running_sandbox = sandbox_name + self.halted_sandboxes.remove(sandbox_name) + return True + + def stop_sandbox(self, sandbox_name: str): + if sandbox_name != self.running_sandbox: + print("Invalid sandbox") + return False + print(f"Stoping sandbox {sandbox_name}!") + if sandbox_name in self.halted_sandboxes: + print(f"Sandbox {sandbox_name} already stopped") + return True + if not self.run_command(f"{self.limactl} stop {sandbox_name}"): + print(f"Sandbox {sandbox_name} can't be stopped") + return False + print(f"Sandbox {sandbox_name} stoped successfully!") + self.running_sandbox = None + self.halted_sandboxes.add(sandbox_name) + return True + +class sandbox: + def __init__(self, name: str, overseer: sandbox_overseer): + self.name = name + self.venv_name = self.name + "_venv" + self.venv_created = False + self.overseer = overseer + + def command_request(self, command: str): + # sandbox's command request to overseer should be approved + return self.overseer.process_command_request(self.name, command) + + def vm_script_request(self, script: str): + # sandbox's vm script request to overseer should be approved + return self.overseer.process_vm_script_request(self.name, script) + + def start(self): + if not self.overseer.start_sandbox(self.name): + return False + # every python sandbox should have a virtual environment + if not self.venv_created: + if not self.setup_venv(): + print(f"Sandbox {self.name} can't create a virtual env.") + return False + else: + self.venv_created = True + return True + + def stop(self): + return self.overseer.stop_sandbox(self.name) + + def run_py(self, py_script): + # check if venv installed + if not self.venv_created: + print("Virtual environment has not created") + return False + print(f"Executing Python script {py_script} in VM") + return self.vm_script_request(f"{self.venv_name}/bin/python3 {py_script}") + + def run_pip_install(self, pip_script): + # check if venv installed + if not self.venv_created: + print("Virtual environment has not created") + return False + return self.vm_script_request(f"{self.venv_name}/bin/pip3 install {pip_script}") + + def setup_venv(self): + if not self.vm_script_request(f"mkdir -p {self.venv_name}"): return False + if not self.vm_script_request("sudo apt-get upgrade"): return False + if not self.vm_script_request("sudo apt-get install python3-venv"): return False + if not self.vm_script_request(f"python3 -m venv {self.venv_name}"): return False + if not self.vm_script_request(f"source {self.venv_name}/bin/activate"): return False + return True \ No newline at end of file