Skip to content

Conversation

@slp
Copy link
Collaborator

@slp slp commented Nov 3, 2025

This enables users to easily use VM images by passing them directly as a single argument, like this:

krunkit Fedora-Server-Host-Generic-43-1.6.aarch64.raw

Fixes #81

slp added 4 commits November 1, 2025 15:19
Add "disk_image" as an optional positional argument. If present, this
is attached to the VM as a virtio-blk device.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Set up some safe default values for both cpu and memory so they
become optional arguments.

Signed-off-by: Sergio Lopez <slp@redhat.com>
pub struct Args {
/// Number of vCPUs for the VM.
#[arg(long, short)]
#[arg(long, short, default_value_t = 2)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is max CPUs worth considering?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what sense? As in defaulting to max CPUs?

Copy link
Member

@ericcurtin ericcurtin Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... I mean for most generic usage all cores is what would be desired I think? Using less cores than available seems like the exception rather than the norm...

@ericcurtin
Copy link
Member

Love this btw, I don't recall there ever being a VMM that had single arg execution with reasonable defaults, this is refreshing!

pub struct Args {
/// Number of vCPUs for the VM.
#[arg(long, short)]
#[arg(long, short, default_value_t = 2)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what sense? As in defaulting to max CPUs?


/// Amount of RAM available to VM.
#[arg(long, short)]
#[arg(long, short, default_value_t = 4096)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entry-level M1 Mac Minis only have 8GB of memory. Do we think 50% of that is going to be ok?

Copy link
Member

@ericcurtin ericcurtin Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I wouldn't have it any lower, 4GB is the max it will use right? I mean Chrome on the host is capable of using 8GB but we don't limit it. Plus the M1 Mac Mini is notoriously underspec'd in terms of RAM and like 4 generations old now? M5 is out soon. People can always manually set 2GB, etc. in exceptional cases which in 2025, this probably is an exceptional case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a VM configured with 4GB doesn't necessarily need to be using all its RAM, virtio-balloon is there to return free memory. In addition to this, macOS is very good (TBH, way more than Linux) at managing its swap memory (having an MacBook M1 Air with 8GB myself, I can attest this is the case), so I'd say this is pretty safe.

file.read_exact(&mut buffer)?;

if buffer == QCOW_MAGIC {
println!("Image detected as Qcow2");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a general UX question: How do we decide what should be logged and what should be printed to stdout? In other words, why do we want to print this to stdout instead of using info!(), for example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use println! for logging. This should likely be a debug! rather than println!.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never print, as it messes up the console. The only reason those are there it's because this is just an early draft.

@ericcurtin
Copy link
Member

krunkit run
krunkit stop
krunkit ps
etc.

might be worth considering, this docker/ollama style seems to be popular

@tylerfanelli
Copy link
Member

That'd be a fair amount more work, requiring a management interface for VMs launched with krunkit. What's the use case?

@ericcurtin
Copy link
Member

ericcurtin commented Nov 13, 2025

It's just a consideration I guess, FWIW if it was decided the UX should be like this one could start with only implementing "run" and implement the rest later as/if desired.

@tylerfanelli
Copy link
Member

tylerfanelli commented Nov 13, 2025

I suppose run is fine, because we don't need to manage it after that. But the others require management interfaces.

I'm not against it, but we'd need a clear use-case to justify it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support an "easy mode" for running images

5 participants