Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support being used as a binfmt_misc handler. #54

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

WhatAmISupposedToPutHere
Copy link
Collaborator

This series allows krun to be used as a binfmt_misc handler: it uses interactive launch mode to make sure stdin/stdout are going where users expect, passes through the current working directory, expands the number of environment variables that are passed through, and daemonizes the vm process, so a process that waits on the first process launched via krun is not prevented from progressing by others.

asahilina and others added 7 commits September 1, 2024 15:20
Unconditionally forward a range of ports to sockets named
`$XDG_RUNTIME_DIR/krun/socket/port-$PORT`. This allows applications to
dynamically bind to sockets at those paths and have them forwarded to
the guest as vsock ports, after the krun VM is already running.

The port range is currently hardcoded as 50000..50200.

Signed-off-by: Asahi Lina <[email protected]>
Signed-off-by: Sasha Finkelstein <[email protected]>
After launching a process via the server, krun immediately closes and the
launched process' std{in,out,err} go nowhere. Add a --interactive flag that
allocates a pseudo-terminal, routes it to the host and connects to it.

Somewhat like '-it' in docker/podman exec.

Signed-off-by: Sasha Finkelstein <[email protected]>
Aside from just being better UX, some commands are sensitive to it
and will not work correctly without it.

Signed-off-by: Sasha Finkelstein <[email protected]>
This is always what you want if running via binfmt

Signed-off-by: Sasha Finkelstein <[email protected]>
Launches the initial command via the server too.
Server is set to linger for 10 seconds after last command finishes.

Signed-off-by: Sasha Finkelstein <[email protected]>
Change the approach to environment variables to delete ones
that are likely to cause problems instead of only passing through
a pre-approved list.
This will be neccessary to correctly work as a binfmt handler

Fixes: AsahiLinux#52
Signed-off-by: Sasha Finkelstein <[email protected]>
Closes: AsahiLinux#24
Signed-off-by: Sasha Finkelstein <[email protected]>
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.

2 participants