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

Qemu stderr: qemu-system-x86_64: Display 'sdl' is not available. #6136

Closed
lelutin opened this issue Apr 15, 2018 · 13 comments
Closed

Qemu stderr: qemu-system-x86_64: Display 'sdl' is not available. #6136

lelutin opened this issue Apr 15, 2018 · 13 comments
Labels
builder/qemu stage/waiting-on-upstream This issue is waiting on an upstream change

Comments

@lelutin
Copy link

lelutin commented Apr 15, 2018

Hi, I'm having a weird issue: packer has been working great for many hours up to now, but some minutes ago it started refusing to build because of a qemu error: Qemu stderr: qemu-system-x86_64: Display 'sdl' is not available.

I'm using packer 1.1.3 from the debian sid package with qemu 1:2.12~rc3+dfsg-1 also from debian sid

From the logline with the options to qemu, it looks like packer somehow "forgets" to add in the first two numbers in the vnc port (e.g. it chose 5966, but it passes in port 66):

Executing /usr/bin/qemu-system-x86_64: []string{"-name", "centos-6.9-amd64", "-m", "512M", "-netdev", "user,id=user.0,hostfwd=tcp::2701-:22", "-boot", "once=d", "-device", "virtio-net,netdev=user.0", "-vnc", "127.0.0.1:66", "-display", "sdl", "-drive", "file=../packer-centos-6.9-amd64-qemu/centos-6.9-amd64,if=virtio,cache=writeback,discard=ignore,format=qcow2", "-cdrom", "/home/gabster/dev/vagrant-boxes/centos/packer_cache/aaf74b57886035c053bfed4b4ae61a8cf04f6d07f291467677930f200372f1c7.iso", "-machine", "type=pc,accel=kvm"}

as stated above packer was working perfectly fine before that for many hours. I've been running many builds to test out each change in templates, so maybe packer ended up overflowing some state that has to do with the port that it chooses?

the output with PACKER_LOG : https://gist.github.com/lelutin/933793d131a18f3f027055e66997dee3

I'm using this template https://gitlab.com/LeLutin/vagrant-boxes/tree/master/centos -- but I can also reproduce on the debian templates in the same repository (which was also working fine before).

@lelutin
Copy link
Author

lelutin commented Apr 15, 2018

I just realized that version 1.1.3 was not from the debian sid package, but from a previously downloaded version archive from the packer website in /usr/local/bin.

I've just downloaded packer 1.2.2 and it is producing the same issue.

@lelutin
Copy link
Author

lelutin commented Apr 15, 2018

I've tried rebooting my computer to see if it would clear some funky state but the issue is still present.

@SwampDragons
Copy link
Contributor

This looks to me like a QEMU issue -- http://lists.busybox.net/pipermail/buildroot/2017-June/193544.html

You can work around with Packer by setting "use_default_display" to false.

@SwampDragons SwampDragons added stage/waiting-on-upstream This issue is waiting on an upstream change builder/qemu labels Apr 16, 2018
@mwhooker
Copy link
Contributor

mwhooker commented Apr 16, 2018

clarified docs in 747d1eb

@lelutin
Copy link
Author

lelutin commented Apr 17, 2018

Hi, thanks for the quick response!

I've tried setting use_default_display to false as recommended, and it produced exactly the same error.

I've tried chaning it to true, and the build started but no display showed up (and no instruction about which port I should use to connect with vnc since headless is set to false)

If I don't have the use_default_display setting at all, but set "headless" to true, then build proceeds and I get instructions on how to connect to the display with vnc.

... so I have two options to do my builds now, that's great!
however, the workaround for the display bug didn't really bring it back.

The qemu bug report seems to be about a build-time option that needs to needs to be enabled. in my case though this was working well, but then stopped working without a package upgrade or a template change.. so maybe the cause is different.
it might be that it's rather a qemu bug though..

@SwampDragons
Copy link
Contributor

It could absolutely be a Packer bug, but I wouldn't know where to begin reproducing; your build used to work and then stopped working without a change to the version of Packer. The error message you're seeing is coming from qemu, not Packer. I think something changed on your local environment to cause this. If you can figure out what changed we might be able to make Packer resilient to it, but without knowing what caused it I don't know how to begin fixing this.

@lelutin
Copy link
Author

lelutin commented Apr 18, 2018

@SwampDragons you're totally right! the issue is that I have no clue what could have changed.. also it must be something that's being carried on across reboots.

Is qemu keeping any kind of state or cache somewhere?

@lelutin
Copy link
Author

lelutin commented Apr 18, 2018

oh ... I just found out that there were package upgrades on my laptop on the morning that I started having issues (I didn't even remember installing unattended-upgrades!)

qemu was upgraded that morning, so I tried downgrading to the version that was there before and ta-da! sdl display is back.

so that's definitely a regression on the qemu debian packages in sid. I'll report a bug there.

at least now we know that it's not a packer issue!

thanks for your support

@lelutin
Copy link
Author

lelutin commented Apr 18, 2018

to give a bit more of a technical context to the source of the problem, it seems as though the qemu-system-x86 package in debian sid (unstable) recently made a switch from SDL1 to SDL2 and this brought on multiple glitches, crashes and mouse grab issues, so package maintainers decided to disable sdl.

See the changelog especially for version 1:2.12~rc3+dfsg-1 http://metadata.ftp-master.debian.org/changelogs/main/q/qemu/qemu_2.12~rc3+dfsg-2_changelog

I don't know yet if they plan to reenable sdl at some point.

@SwampDragons
Copy link
Contributor

Interesting -- thanks for the follow-up!

@Hnasar
Copy link

Hnasar commented May 8, 2018

To workaround, add this to your packer json file:

            "qemuargs": [
                ["-display", "gtk"]
            ]

@asauber
Copy link

asauber commented Sep 9, 2019

If you're experiencing this on macOS the argument to use is

            "qemuargs": [
                ["-display", "cocoa"]
            ]

@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
builder/qemu stage/waiting-on-upstream This issue is waiting on an upstream change
Projects
None yet
Development

No branches or pull requests

5 participants