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: gtk initialization failed #183

Open
mikoday opened this issue Oct 29, 2024 · 1 comment
Open

Qemu stderr: gtk initialization failed #183

mikoday opened this issue Oct 29, 2024 · 1 comment
Labels
stage/needs-verification Issue needs verifying it still exists

Comments

@mikoday
Copy link

mikoday commented Oct 29, 2024

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

I'm trying to prepare a Windows image to use on maas,
I also described my issue here:
canonical/packer-maas#272

Reproduction Steps

/home/maas/packer-maas/windows# make windows ISO=/home/maas/en-us_windows_11_business_editions_version_24h2_x64.iso VERSION=11 windows.json PACKER_LOG=1

Plugin and Packer version

v1.1.0

Simplified Packer Buildfile

If the file is longer than a few dozen lines, please include the URL to the
gist of the log or use the Github detailed
format

instead of posting it directly in the issue.

Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.

Log Fragments and crash.log files

2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Started Qemu. Pid: 2153
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr: WARNING: Image format was not specified for '/tmp/packer65686085' and probing guessed raw.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr:          Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr:          Specify the 'raw' format explicitly to remove the restrictions.
2024/10/28 15:49:37 packer-plugin-qemu_v1.1.0_x5.0_linux_amd64 plugin: 2024/10/28 15:49:37 Qemu stderr: gtk initialization failed

Set the env var PACKER_LOG=1 for maximum log detail.

@mikoday mikoday added the bug label Oct 29, 2024
@lbajolet-hashicorp
Copy link
Contributor

Hi @mikoday,

By default the display option is set to GTK for the plugin, so if you're trying to run a build on a Windows machine, chances are it'll fail.

You can change that by setting the display option to none, which will default to what the local binary supports.

We can probably change the default value to be none for future releases, but I'm concerned this is a potential breaking change for existing templates, so this will likely not happen soon.
In the meantime I suggest changing this to none, or one of the other supported values, which you can get from the help for qemu: qemu --help | grep display should list the possibilities for your implementation.

Also if you don't need to run the build with a visual window for qemu, you can run headless (with headless = true in the configs) and use VNC to connect to the machine independently, the logs give you a URI/port for that purpose.

@lbajolet-hashicorp lbajolet-hashicorp added stage/needs-verification Issue needs verifying it still exists and removed bug labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-verification Issue needs verifying it still exists
Projects
None yet
Development

No branches or pull requests

2 participants