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

play: wire up stdin to qemu to make serial work #1

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

stapelberg
Copy link
Contributor

With this change:

  1. gokrazy’s serial port starts working in qemu,
    i.e. you can press Enter and get a shell prompt.

  2. qemu’s monitor key bindings start working,
    i.e. you don’t quit using Ctrl+C, but by using Ctrl+a x

@stapelberg
Copy link
Contributor Author

@damdo I find myself wishing for an easy way to run gokrazy instances in qemu more and more. Aside from this PR, do you mind if I merged some of gom into a gok qemu subcommand?

@damdo damdo force-pushed the stdin branch 2 times, most recently from ce10292 to 88aa086 Compare July 1, 2024 12:45
With this change:

1. gokrazy’s serial port starts working in qemu,
   i.e. you can press Enter and get a shell prompt.

2. qemu’s monitor key bindings start working,
   i.e. you don’t quit using Ctrl+C, but by using Ctrl+a x
@damdo
Copy link
Owner

damdo commented Jul 1, 2024

Hey @stapelberg, yes for sure, it'd be awesome to have gom into gok, that was my plan all along!
What parts of it would you like to include?
I should be able to help with this in a bit

@damdo damdo merged commit 92e9182 into damdo:main Jul 1, 2024
1 check passed
@stapelberg
Copy link
Contributor Author

Hey @stapelberg, yes for sure, it'd be awesome to have gom into gok, that was my plan all along!
What parts of it would you like to include?
I should be able to help with this in a bit

Cool!

I think the first milestone I would want to see is a command to build and run the specified gokrazy instance in a VM.

Conceptually, I’d suggest a “vm” subcommand in gok, which can then have its own subcommands. I suggest “run” as the first subcommand. The vm subcommand would be in the “deploy and update” group.

So, gok vm run should build the instance and execute qemu with the right flags. We can then expand from there, but I think that’s the least controversial and most useful thing in the whole VM space.

Out of scope for now: deploying VMs to services, both commerial (e.g. Google Cloud, AWS, Azure) or self-hosted (e.g. Proxmox). We can add that later, perhaps as a command that requires additional installation if you want to target a specific VM service provider (similar to the OCI plugin approach).

@stapelberg
Copy link
Contributor Author

So, gok vm run should build the instance and execute qemu with the right flags. We can then expand from there, but I think that’s the least controversial and most useful thing in the whole VM space.

FYI, I have submitted a gok vm run implementation with commit gokrazy/tools@b8ffcd4

Next up is including the EFI firmware (like you did) and then we can expand from there :)

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