"Invalid MIT-MAGIC-COOKIE-1 key" message while running a program with the Terminal

Ask Ubuntu Asked by Valérie Bibeau on December 4, 2020

I have a problem when running a certain program. The execution works perfectly fine, but there is an additional line that appears before the execution : Invalid MIT-MAGIC-COOKIE-1 key

Is there a way to prevent this message to appear ?
With some research, I tried different commands :

  • Try xhost +local: before running

  • Change the variable DISPLAY with the export command

  • Check if the XAUTHORITY environment exists (it does not)

Do you have any other suggestions that I can try ?

Thank you in advance.

One Answer

This indicates a permission Problem or simply a wrong magic cookie ..

  • what works for me: xhost + for virtual boxes , then in the virtual machine : DISPLAY= dbus-run my-x11-program

  • the MIT-MAGIC-COOKIE is stored in the file .Xauthority of the user who is running the desktop

  • you might have an already wrong-filled .Xauthority ?

  • you could also just "steal" this one (transfer via ssh) or copy on localhost , sometimes sudo works , and su not

  • when everything fails: run via ssh with e.g ssh -YXC [email protected] "the-command"

  • if you encounter failures concerning MPI_init() from openMPI, you should read the mpirun-gui section from the manual there is another thread in the SE community describing what MPI_Init() it does

Answered by Benji over_9000 'benchonaut' on December 4, 2020

Add your own answers!

Related Questions

Ubuntu 20.04 : error when installing Caffe

1  Asked on February 4, 2021 by ignis-oculo


Bash script for copying only modified files

0  Asked on February 4, 2021 by indr0


Ubuntu 20.04 start up screen

0  Asked on February 3, 2021 by pradeep-jha


Accessing Windows 10 files from Ubuntu 20.04

2  Asked on February 2, 2021 by johnw


how prevent ubuntu 18.04 LTS remove apache2 on startup?

0  Asked on January 31, 2021 by sergiomb


9 dots Show Application menu stucks once in a while in ubuntu 20.04.1

0  Asked on January 31, 2021 by jobayer-shajal


Screen rotation shortcuts in login without editing files

1  Asked on January 30, 2021 by schrodigerscatcuriosity


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir