Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# muvm - run programs from your system in a microVM

`muvm` allows you to run arbitrary programs from your system in a microVM. It's comprised of three small programs:
`muvm` allows you to run arbitrary programs from your system in a microVM. It's comprised of 2 small programs:

- `muvm`: links against [libkrun](https://github.com/containers/libkrun) to create the microVM.

- `muvm-guest`: acts as an entrypoint inside the microVM to set up the environment for running your program.

- `muvm-server`: a server listening for requests to run additional programs. This allows you to run multiple graphical applications inside the same microVM.
- `muvm-guest`: acts as an entrypoint inside the microVM to set up the environment for running your program. It spawns a server listening for requests to run additional programs. This allows you to run multiple graphical applications inside the same microVM.

## Using

``` sh
Usage: muvm [-c=CPU_LIST]... [-e=ENV]... [--mem=MEM] [--vram=VRAM] [--passt-socket=PATH] [-p=
SERVER_PORT] [-f=FEX_IMAGE]... COMMAND [COMMAND_ARGS]...
Usage: muvm [-c=CPU_LIST]... [-e=ENV]... [--mem=MEM] [--vram=VRAM] [--passt-socket=PATH] [-f=
FEX_IMAGE]... [-m] [-i] [-t] [--privileged] [-p=<[[IP:][HOST_PORT]:]GUEST_PORT[/PROTOCOL]>]... [
--emu=EMU] COMMAND [COMMAND_ARGS]...

Available positional items:
COMMAND the command you want to execute in the vm
Expand All @@ -34,19 +33,27 @@ Available options:
Machine Monitor) will attempt to return as many pages as
possible to the host.
[default: 80% of total RAM]
--vram=VRAM The amount of Video RAM, in MiB, that will be available to this
microVM.
The memory configured for the microVM will not be reserved
immediately. Instead, it will be provided as the guest demands
it, and will be returned to the host once the guest releases
the underlying resources.
[default: same as the total amount of RAM in the system]
--vram=VRAM The amount of Video RAM, in MiB, that will reported by userspace in
this microVM.
The userspace drivers will report this amount as heap size
to the clients running in the microVM.
[default: 50% of total RAM]
--passt-socket=PATH Instead of starting passt, connect to passt socket at PATH
-p, --server-port=SERVER_PORT Set the port to be used in server mode
[default: 3334]
-f, --fex-image=FEX_IMAGE Adds an erofs file to be mounted as a FEX rootfs.
May be specified multiple times.
First the base image, then overlays in order.
-m, --merged-rootfs Use merged rootfs for FEX (experimental)
-i, --interactive Attach to the command's stdin/out after starting it
-t, --tty Allocate a tty for the command
--privileged Run the command as root inside the vm.
This notably does not allow root access to the host fs.
-p, --publish=<[[IP:][HOST_PORT]:]GUEST_PORT[/PROTOCOL]>
Publish a guest’s port, or range of ports, to the host.
The syntax is similar to podman/docker.
--emu=EMU Which emulator to use for running x86_64 binaries.
Valid options are "box" and "fex". If this argument is not
present, muvm will try to use FEX, falling back to Box if it
can't be found.
-h, --help Prints help information
```

Expand Down
2 changes: 1 addition & 1 deletion crates/muvm/src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn spawn_monitor() {
fn set_guest_pressure(pressure: GuestPressure) -> Result<()> {
if pressure == GuestPressure::Critical {
debug!("requesting the guest to drop its caches");
// This is a fake command that tells muvm-server to write to "/proc/sys/vm/drop_caches"
// This is a fake command that tells `muvm-guest` server to write to "/proc/sys/vm/drop_caches"
let command = PathBuf::from("/muvmdropcaches");
let command_args = vec![];
let env = HashMap::new();
Expand Down
Loading