-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 298c3e9
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @slp @teohhanhui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Sergio Lopez | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# krun - run programs from your system in a microVM | ||
|
||
`krun` allows you to run arbitrary programs from your system in a microVM. It's comprised of two small programs: | ||
|
||
- `krun`: links against [libkrun](https://github.com/containers/libkrun) to create the microVM. | ||
|
||
- `krun-guest`: acts as an entrypoint inside the microVM to set up the environment for running your program. | ||
|
||
## Using | ||
|
||
``` sh | ||
|
||
Usage: krun [OPTIONS] COMMAND [COMMAND_ARGS...] | ||
OPTIONS: | ||
-h --help Show help | ||
--net=NET_MODE Set network mode | ||
--passt-socket=PATH Instead of starting passt, connect to passt socket at PATHNET_MODE can be either TSI (default) or PASST | ||
|
||
COMMAND: the command you want to execute in the vm | ||
COMMAND_ARGS: arguments of COMMAND | ||
|
||
``` | ||
|
||
## Running graphical applications | ||
|
||
If [sommelier](https://chromium.googlesource.com/chromiumos/platform2/+/master/vm_tools/sommelier) is installed in your system, `krun` will use it to connect to the Wayland session on the hosts, allowing you to run graphical applications in the microVM. | ||
|
||
GPU acceleration is also enabled on systems supporting [DRM native context](https://indico.freedesktop.org/event/2/contributions/53/attachments/76/121/XDC2022_%20virtgpu%20drm%20native%20context.pdf) (freedreno, amdgpu, asahi). | ||
|
||
## Running x86/x86_64 on aarch64 | ||
|
||
If [FEX-Emu](https://fex-emu.com/) is installed in your system, `krun` will configure `binfmt_misc` inside the microVM so x86/x86_64 programs can be run transparently on it. | ||
|
||
## Motivation | ||
|
||
This tool is mainly intended to enable users to easily run programs designed for 4K-page systems on systems with a different page size, with [Asahi Linux](https://asahilinux.org/) being the prime example of this use case. | ||
|
||
Other potential use cases could be software isolation, accessing privileged kernel features (provided by the guest) or local testing. |