How to create .Xauthority file in Ubuntu GNOME 17.04

6,801

Note that the GNOME display manager gdm3 does not use ~/.Xauthority so this may require an application-specific answer for VNC Connect. As the manual page says, "Upon session startup, GDM sets the XAUTHORITY environment variable to a session-specific file in /var/run/gdm3. Applications and scripts that assume this file is set to ~/.Xauthority will not work. To access the display you need both DISPLAY and XAUTHORITY variables."

I wound up on this page because the missing .Xauthority issue also arises when trying to run graphical applications as root on Wayland (Ubuntu GNOME 17.10). As described at https://wiki.archlinux.org/index.php/Running_X_apps_as_root, the fallback X server won't work when running programs as root, but you can fix this by first running xhost +local:. Possibly a similar approach will address the VNC Connect issue.

Share:
6,801

Related videos on Youtube

Amolith
Author by

Amolith

I'm a Linux sysadmin and professional multi-instrumentalist as well as the founder and admin of NixNet, a network of sites and services I run for free. I'm also a member of the librehosters network and of UBports' Community Steering Committee.

Updated on September 18, 2022

Comments

  • Amolith
    Amolith over 1 year

    Stressing 17.04.

    I want to use VNC Connect to I can use my computer from my phone. However, I do not have a .Xauthority file. I saw the other question, "How do I create the .Xauthority file?" and it is for Ubuntu 10.10.

    I'm stressing the difference between this question and that question because this isn't a dupe question; the .Xauthority file is bound to be vastly different from 7 years ago.

    I have the .ICEauthority file but no .Xauthority file. I don't know what other information I need to provide, but I will if I can.

    • You'reAGitForNotUsingGit
      You'reAGitForNotUsingGit over 6 years
      AFAIK it's generated by default. If I delete it and restart X, it gets regenerated.
    • Amolith
      Amolith over 6 years
      @AndroidDev What is X?
    • You'reAGitForNotUsingGit
      You'reAGitForNotUsingGit over 6 years
      X11 is the "kernel" of the UI if you will.
    • Amolith
      Amolith over 6 years
      @AndroidDev So how do I restart X11?
    • You'reAGitForNotUsingGit
      You'reAGitForNotUsingGit over 6 years
      I usually go to tty1 and do sudo service lightdm restart
    • Amolith
      Amolith over 6 years
      @AndroidDev What's tty1?
    • You'reAGitForNotUsingGit
      You'reAGitForNotUsingGit over 6 years
      It's one of many virtual terminals. You can access it by pressing CTRL+ALT+F1. And you can get back to the GUI by switching to tty7, with CTRL+ALT+F7
    • Amolith
      Amolith over 6 years