Changing CT UID mappings led to: timeout in locking authority file /home/username/.Xauthority and file /home/username/.Xauthority does not exist

Artem1231

New Member
Jan 5, 2020
2
0
1
28
A little background: I have a ZFS dataset that I want to share across my LXCs, I need to be able to write to that dataset from the LXCs.

What I've done:
  1. In the config of the container from which I intended to write to the dataset, I added mp0: /data/set,mp=/mnt/point,backup=0. I realized that I didn't have write permissions. Then I found this article and...
    Note: This container already had the "artem" user that I later created in proxmox.
  2. Created a new proxmox user.
  3. Changed the owner of the dataset to the new user.
  4. Added the following to the LXC config:
    Code:
    lxc.idmap = u 0 100000 1000lxc.idmap = g 0 100000 1000
    lxc.idmap = u 1000 1000 1
    lxc.idmap = g 1000 1000 1
    lxc.idmap = u 1001 101001 64534
    lxc.idmap = g 1001 101001 64534
    Note: the uid and gid of the new user is 1000.
  5. In /etc/subuid, I added root:1000:1. There are 3 lines now:
    Code:
    root:1000:1
    root:100000:65536
    artem:165536:65336
  6. In /etc/subgid, I added root:1000:1. There are the same three lines now as in /etc/subuid.
The problems:

1.
I now have write access to the dataset as the new user, but when I ssh into the container, it takes some time before I can log in and when I finally log in, I get the following:
Code:
/usr/bin/xauth:  timeout in locking authority file /home/artem/.Xauthority
I have tried logging in multiple times and it always took a long time to log in and I got that error. I found some a thread where somebody had a similar message, and the solution was to remove the file. When I tried to delete it as root, I got the "Permission denied" error. I thought that I should've made the changes to the config file before creating the user and tried that. I have a slightly different but similar problem now.

2. I have since created a new container, added the mp and uid mapping to the config, THEN added the "artem" user to the container. I get the following now:
Code:
/usr/bin/xauth:  file /home/artem/.Xauthority does not exist
ls -a /home/artem shows that this file exists
stat /home/artem/.Xauthority's output:
Code:
File: /home/artem/.Xauthority
  Size: 51              Blocks: 1          IO Block: 512    regular file
Device: 48h/72d Inode: 22863       Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/   artem)   Gid: ( 1000/   artem)
Access: 2020-01-05 11:07:43.863121606 +0000
Modify: 2020-01-05 11:07:43.863121606 +0000
Change: 2020-01-05 11:07:43.863121606 +0000
Birth: -

I got this far, and tried to log in into the new container again and tinhere was no such error anymore... I think it's still worth posting as this may be helpful to others. But if anyone knows what I did wrong, please let me know. That would be highly appreciated.
 
Last edited: