Skip to content

fix(qemu): fix terminal mess up in qemu based deployment#459

Merged
cmainas merged 1 commit into
urunc-dev:main-pr459from
ishaanxgupta:ishaan/qemu
Feb 20, 2026
Merged

fix(qemu): fix terminal mess up in qemu based deployment#459
cmainas merged 1 commit into
urunc-dev:main-pr459from
ishaanxgupta:ishaan/qemu

Conversation

@ishaanxgupta

Copy link
Copy Markdown
Contributor

Description

With QEMU, -nographic doesn’t just “disable graphics”; it also redirects the emulated VGA/serial output to the controlling terminal (stdio) and can multiplex the QEMU monitor/serial on the same stream. That output often contains control characters / escape sequences and QEMU can leave your terminal in a weird state when it exits (so you need reset / stty sane).

Replaced -nographic with:

  • display none (or -vga none -display none)
  • serial stdio
  • monitor none

Related issues

LLM usage

N/A

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

@netlify

netlify Bot commented Feb 7, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 0cec303
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6998733bfe576d000887eefa

@ishaanxgupta

Copy link
Copy Markdown
Contributor Author

as per discussion in #440 (comment)
@cmainas please have a look

@spline2hg

spline2hg commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

Hi @ishaanxgupta, thanks for working on this.
Would it be possible to add screen recordings showing the behavior before and after the change?
That would make the change easier to understand.

Also, u need to format the code with go fmt.

@ishaanxgupta

Copy link
Copy Markdown
Contributor Author

Sure @spline2hg

@ishaanxgupta

Copy link
Copy Markdown
Contributor Author

@cmainas please have a look, the tests should pass this time

@cmainas

cmainas commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Hello @ishaanxgupta ,

you will need to rebase over urunc's main branch so we can merge this.

@cmainas

cmainas commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Hello @ishaanxgupta ,

it seems there is an issue with docker. For example:

$ sudo docker run --rm -it --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/redis-qemu-linux-raw:latest
Unable to find image 'harbor.nbfc.io/nubificus/urunc/redis-qemu-linux-raw:latest' locally
latest: Pulling from nubificus/urunc/redis-qemu-linux-raw
f18232174bc9: Pull complete 
9826632aa5dd: Pull complete 
2e7279224f08: Pull complete 
b782747b1d52: Pull complete 
878a56611471: Pull complete 
4f4fb700ef54: Pull complete 
64136cebabc3: Pull complete 
3eab733900b0: Pull complete 
e3a1471f3424: Pull complete 
2d0ac744b2c2: Pull complete 
Digest: sha256:2b350986ba047f80fca90f28868c0d3c5f290f7b1922e67a5fddcb7438dac72e
Status: Downloaded newer image for harbor.nbfc.io/nubificus/urunc/redis-qemu-linux-raw:latest
[2026-02-16T18:18:01Z INFO  virtiofsd] Waiting for vhost-user socket connection...
[2026-02-16T18:18:01Z INFO  virtiofsd] Client connected, servicing requests
qemu-system-x86_64: -serial stdio: cannot use stdio by multiple character devices
qemu-system-x86_64: -serial stdio: could not connect serial device to character backend 'stdio'
[2026-02-16T18:18:01Z INFO  virtiofsd] Client disconnected, shutting down

@ishaanxgupta

Copy link
Copy Markdown
Contributor Author

@cmainas sorry, the issue is a duplicate -serial stdio flag. This PR changed qemu.go from -nographic to -display none -vga none -serial stdio -monitor null, but linux.go - MonitorCli() also appends -serial stdio -nodefaults as extra args. QEMU rejects two character devices bound to the same stdio backend.

@cmainas

cmainas commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

@cmainas sorry, the issue is a duplicate -serial stdio flag. This PR changed qemu.go from -nographic to -display none -vga none -serial stdio -monitor null, but linux.go - MonitorCli() also appends -serial stdio -nodefaults as extra args. QEMU rejects two character devices bound to the same stdio backend.

Yeah that is totally correct. You can remove it from Linux then.

@cmainas

cmainas commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Also, please squash your commits.

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello @ishaanxgupta ,

the changes look good. I only have a question and a rebase will be required for merging.

Comment thread pkg/unikontainers/unikernels/linux.go
@ishaanxgupta
ishaanxgupta force-pushed the ishaan/qemu branch 2 times, most recently from eb34cc0 to 671078f Compare February 20, 2026 03:26
@ishaanxgupta

ishaanxgupta commented Feb 20, 2026

Copy link
Copy Markdown
Contributor Author

@cmainas rebased, can we merge this now?

@cmainas

cmainas commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Could you please squash your commits? One commit introduces a change that another reverts. This is not helpful for the commit history.

Also, please fix the commit linter issues


Signed-off-by: Ishaan Gupta <ishaankone@gmail.com>
✖   subject may not be empty [subject-empty]
✖   type may not be empty [type-empty]

✖   found 2 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

@ishaanxgupta

ishaanxgupta commented Feb 20, 2026

Copy link
Copy Markdown
Contributor Author

Sure, hopefully this is complete now 😊

Signed-off-by: Ishaan Gupta <ishaankone@gmail.com>
@urunc-bot
urunc-bot Bot changed the base branch from main to main-pr459 February 20, 2026 15:34

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @ishaanxgupta for the fix!

@cmainas
cmainas merged commit 6aabe20 into urunc-dev:main-pr459 Feb 20, 2026
34 checks passed
github-actions Bot pushed a commit that referenced this pull request Feb 20, 2026
PR: #459
Signed-off-by: Ishaan Gupta <ishaankone@gmail.com>
Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
urunc-bot Bot pushed a commit that referenced this pull request Feb 20, 2026
PR: #459
Signed-off-by: Ishaan Gupta <ishaankone@gmail.com>
Reviewed-by: Charalampos Mainas <cmainas@nubificus.co.uk>
Approved-by: Charalampos Mainas <cmainas@nubificus.co.uk>
@ishaanxgupta
ishaanxgupta deleted the ishaan/qemu branch February 20, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix terminal mess up in Qemu based deployments

3 participants