Top
Best
New

Posted by binsquare 8 hours ago

Show HN: Smol machines – subsecond coldstart, portable virtual machines(github.com)
200 points | 83 commentspage 2
lambdanodecore 6 hours ago|
Basically any open source project nowadays run their software stack in containers often requiring docker compose. Unfortunatley Smol machines do not support Docker inside the microvms and they also do not support nested VMs for things that use Vagrant. I think this is a big drawback.
binsquare 6 hours ago||
I can support docker - will ship a compatible kernel with the necessary flags in the next release.
lambdanodecore 6 hours ago||
I tried something like this already, also including nested kvm. I think this will increase the boot time quiet a bit.

Also libkrun is not secure by default. From their README.md:

> The libkrun security model is primarily defined by the consideration that both the guest and the VMM pertain to the same security context. For many operations, the VMM acts as a proxy for the guest within the host. Host resources that are accessible to the VMM can potentially be accessed by the guest through it.

> While defining the security implementation of your environment, you should think about the guest and the VMM as a single entity. To prevent the guest from accessing host's resources, you need to use the host's OS security features to run the VMM inside an isolated context. On Linux, the primary mechanism to be used for this purpose is namespaces. Single-user systems may have a more relaxed security policy and just ensure the VMM runs with a particular UID/GID.

> While most virtio devices allow the guest to access resources from the host, two of them require special consideration when used: virtio-fs and virtio-vsock+TSI.

> When exposing a directory in a filesystem from the host to the guest through virtio-fs devices configured with krun_set_root and/or krun_add_virtiofs, libkrun does not provide any protection against the guest attempting to access other directories in the same filesystem, or even other filesystems in the host.

fqiao 4 hours ago|||
Thanks so much for the feedbacks. Yes these are valid concerns around libkrun security, We are planning and developing features around them actually, and hopefully that could alleviate the conerns.

for virtio-fs, yes the risk of exposing the host fs struture exists, and we plan to:

1. creating staging directory for each vm and bind-mount the host dir onto them

2. having private mount namespaces for vms

they are both tracked in our github issues:

https://github.com/smol-machines/smolvm/issues/152 https://github.com/smol-machines/smolvm/issues/151

2 may need much more efforts than we imagine, but we will ensure to call this out in our doc.

For the concern around TSI, we are developing virtio-net in-parallel, it is also tracked in our github and will be released soon: https://github.com/smol-machines/smolvm/issues/91

Would like to collect mroe suggestions on how to make this safer. Thanks!

binsquare 4 hours ago|||
Security is a broad topic.

Here's how my perspective:

smolvm operates on the same shared responsibility model as other virtual machines.

VM provides VM-level isolation.

If the user mounts a directory with the capability of symlinks or a host OS with a path for guest software that is designed to escape - that is the responsibility of the user rather than the VM.

Security is not guaranteed by using a specific piece of software, it's a process that requires different pieces for different situations. smolvm can be a part of that process.

genxy 5 hours ago||
So Vagrant is launching the VM locally, is that why it needs nesting?

Would you be ok with a trampoline that launched the VM as a sibling to the Vagrant VM?

ukuina 6 hours ago||
Doesn't Docker's sbx do this?

https://docs.docker.com/reference/cli/sbx/

binsquare 6 hours ago|
sandboxing is one of the features of virtual machines.

I'm building a different virtual machine.

ccrone 1 hour ago||
Neat! I work with the team on sbx. We built our own cross-platform VMM after running into limitations with the existing options. Happy to chat more about what you’ve built and what we’re doing: christopher<dot>crone@docker.com
dimitry12 2 hours ago||
https://github.com/earendil-works/gondolin is another project addressing a similar use-case.
isterin 6 hours ago||
We’re using smolmachines to create environments for our agents to execute code. It’s been great so far and the team is super responsive. The dev ergonomics are also great.
fqiao 5 hours ago|
Really appreciate it! Would love to work together to make this easier to use.
0cf8612b2e1e 7 hours ago||
This looks very cool. Does the VM machinery still work if I run it in a bubblewrap? Can it talk to a GPU?

Can you pipe into one? It would be cute if I could wget in machine 1 and send that result to offline machine 2 for processing.

binsquare 7 hours ago|
Haven't tried with bubblewrap - but it should.

Yes! GPU passthrough is being actively worked on and will land in next major release: https://github.com/smol-machines/smolvm/pull/96

Yea just tried piping, it works:

``` smolvm machine exec --name m1 -- wget -qO- https://example.com/data.csv \ | smolvm machine exec --name m2 -i -- python3 process.py ```

bch 7 hours ago||
see too[0][1] for projects of a similar* vein, incl historical account.

*yes, FreeBSD is specifically developed against Firecracker which is specifically avoided w "Smol machines", but interesting nonetheless

[0] https://github.com/NetBSDfr/smolBSD

[1] https://www.usenix.org/publications/loginonline/freebsd-fire...

binsquare 6 hours ago|
that was one of my inspirations but I don't think they went far enough in innovation.

microvm space is still underserved.

bch 6 hours ago||
> that was one of my inspirations

Colins FreeBSD work or Emiles NetBSD work?

binsquare 3 hours ago||
netBSD, I love that focus on a minimal and simple, reproducible binaries.

You'll see that philosophy in this project as well (i hope).

freeBSD focuses on features, which is great too.

rkagerer 4 hours ago||
I see you support Linux and MacOS hosts. Any Windows support planned?
binsquare 2 hours ago|
Yeah it's feasible, I don't have windows to test. Can you help? :D
fqiao 8 hours ago||
Give it a try folks. Would really love to hear all the feedbacks!

Cheers!

leetrout 7 hours ago|
why did you seemingly create two HN accounts?

Edit: I see this appears to be a contributor to the project as well. It was not obvious to me.

fqiao 7 hours ago|||
this is me: https://github.com/phooq

@binsquare is this one: https://github.com/BinSquare

fqiao 4 hours ago|||
No worry at all! Thanks!
parasitid 5 hours ago||
hi! congrats for your work that's really nice.

question: why do you report that qemu is 15s<x<30s? for instance with katacontainers, you can run fast microvms, and even faster with unikernels. what was your setup?

thanks a lot

nonameiguess 5 hours ago|
What are you actually doing on top of libkrun? Providing really small machine images that boot quickly? If I run the smolvm run --image alpine example, what is "alpine?" Where is that image coming from? Does this have some built-in default registry of machine images it pulls from? Does it need an Internet connection that allows outbound access to wherever this registry runs? Is it one of a default set of pre-built images that comes with the software itself and is stored on my own filesystem? Where are the builds for these images? Where do these machine images end up? ~/.local/share/smolvm/?
binsquare 4 hours ago||
i run a custom fork of libkrun, libkrunfw (linux kernel), etc etc: https://github.com/orgs/smol-machines/repositories

Got a lot of questions on how I spin up linux VM's so quickly

Explanation is pretty straight forward.

Linux was built in the 90s. Hardware improved more than a 1000x. Linux virtual machine startup times stayed relatively the same.

Turns out we kept adding junk to the linux kernel + bootup operations.

So all I did was cut and remove unnecessary parts until it still worked. This ended up also getting boot up times to under 1s.

Big part of it was systemd btw.

binsquare 4 hours ago||
those images are pulling from the public docker registry.
More comments...