alis icon indicating copy to clipboard operation
alis copied to clipboard

homectl create user fails (Transport endpoint is not conected)

Open Ginner opened this issue 3 years ago • 19 comments

I'm installing with the following relevant (imo) options:

LVM="true"
SYSTEMD_HOMED="true"
SYSTEMD_HOMED_STORAGE="luks"
BOOTLOADER="systemd"

Unfortunately it fails upon homectl create user with Operation on home <user> failed: Transport endpoint is not connected and homectl activate <user> with Operation on home <user> failed: No home for user <user> known and lastly cp -a /home/ginner.home/. /mnt/home/ginner.home fails with No such file or directory.

I think maybe you alludes to this in the code with:

    ### something missing, inside alis this not works, after install the user is in state infixated
    ### after install and reboot this commands work

I tried rebooting and running the commands manually, without luck.

Any help is very appreciated! Thank you for your excellent work on this 'script' :)

Ginner avatar Dec 19 '21 19:12 Ginner

Relevant info to review alis commands with the provided configuration.

https://wiki.archlinux.org/title/Systemd-homed#LUKS_home_directory https://gist.github.com/dbehnke/ad19ca8f1ccf80aebca5

picodotdev avatar Dec 19 '21 20:12 picodotdev

Good info. Now I'm in no way strong in this, but at what point in the code, is the IMAGE_PATH being mounted? Should it be included in the homectl create with the --image-path as briefly described in the first link?

Does it have to be initiated through luks cryptsetup? Maybe in if [ "$SYSTEMD_HOMED_STORAGE" == "luks" ]? Sorry, I'm just spitballing, I hope I'm not adding too much noise...

Ginner avatar Dec 19 '21 20:12 Ginner

I think the problem is that systemd-homed for the luks storage expects the user home directory to be stored in "inside an encrypted LUKS volume inside a loopback file or any removable media".

For create the luks loopback file maybe the gist is usefull and maybe in --image-path/IMAGE_PATH must be specified that loopback file, but not sure also.

picodotdev avatar Dec 19 '21 21:12 picodotdev

Yeah, I think you're exactly right.

Ginner avatar Dec 19 '21 21:12 Ginner

I think now should work as expected.

picodotdev avatar Dec 20 '21 03:12 picodotdev

Wow, You're fast :) I've tested it, but after the password prompt following homectl create <USER> --enforce-password-policy=no --timezone=<TZ> --language=<LANG> --storage=luks --image-path=/mnt/home/<USER>.home --fs-type=ext4 - G wheel,storage,optical it fails with Operation on home <USER> failed: Transport endpoint is not conected.

It seems to me, that /mnt/home/<USER>.home is not mounted.

Ginner avatar Dec 20 '21 07:12 Ginner

Another try to solve Transport endpoint is not conected. Some magic "sleep 5" inserted.

picodotdev avatar Dec 20 '21 10:12 picodotdev

Just tested it, same output.

I see the sleep 5 being run and it waits, however, I don't see a partition/image/filesystem for /home/<USER> being mounted anywhere in the code, is that right?

Ginner avatar Dec 20 '21 13:12 Ginner

homectl create only creates user homed image not mounts it.

I will try again, I do my testing in VirtualBox. Are you trying in a virtual machine?

When fails, What is the output of this command for you? Is that service in good state?

systemctl status systemd-homed.service

picodotdev avatar Dec 20 '21 14:12 picodotdev

No, I'm testing on physical hardware.

Yeah, systemctl status systemd-homed.service returns 'Active (running)'.

Ginner avatar Dec 20 '21 15:12 Ginner

Tested again, no problem in VirtualBox, using this config https://github.com/picodotdev/alis/blob/master/packer/alis-packer-efi-ext4-luks-lvm-systemd-systemdhomed.sh (only has defaults changes). But anyway I incremented the sleep time from 5 to 10.

Can you attach your full configuration file and describe your computer specs?

picodotdev avatar Dec 20 '21 22:12 picodotdev

Same result - Operation on home <USER> failed: Transport endpoint is not conected

Conf file:

alis.conf.txt

Computer specs: ThinkPad X220i, Intel i5, 4 gb ram, ssd... Let me know if you need more than that :)

Ginner avatar Dec 21 '21 15:12 Ginner

Tested in VirtualBox with exact same configuration you provided. There was a error in alis in the shell change to zsh for root user when using systemd-homed that I fixed, but that is a step latter to your case. In any case the system after reboot worked fine.

virtualbox test

I have no clues, need anyone, that what is happening in your ThinkPad. Maybe you can attach a screenshot/photo or if you can do a test in VirtualBox or virtual machine.

picodotdev avatar Dec 21 '21 17:12 picodotdev

Thank you for all the time you're putting into this! Hmm.. It sounds weird - Unfortunately I'm not able to test in a VM rn.

Heres a (rather shitty) picture of the error: alis-fail

Ginner avatar Dec 21 '21 19:12 Ginner

Same error reproduced in VirtualBox with your photo hint!

I think the problem is the password length. Use one longer than test3 like archlinux. I think the password must have a length > 6, dont ask me why is this but maybe there is a policy for this in luks or homectl.

transport endpont

picodotdev avatar Dec 21 '21 19:12 picodotdev

Hmm.. okay. Though, I don't think password length is the issue, the one I took a picture of was the first install with a short password. Previously I've been using long (+12 character) passwords - The testX ones were just for the sake of the photo.

What did you change to reproduce?

Ginner avatar Dec 21 '21 19:12 Ginner

I think use test3 instead archlinux as password for homectl and LUKS_PASSWORD, ROOT_PASSWORD, USER_PASSWORD was the only change that I did, the other case can be that I missed to type test3 or on repeat.

picodotdev avatar Dec 21 '21 19:12 picodotdev

I did one more test using test3 as password, you were right that was not the issue as my test finalized correctly. So, I really dont have clues what happened in the test that failed for me with the same error as you. Also, is strange that for me works and for you fails always in the same point with the same error.

The only thing that I change in this last working test to you configuration was the SWAP_SIZE from 4096 to 1024. But also may be is a false clue.

The only suggestion for you is that you use other configuration if you dont have any new clue.

picodotdev avatar Dec 22 '21 17:12 picodotdev

Yeah, I'm not sure I'll go with homed anyways. Thank you for all your work on this, and thank you for helping me! I'll let you know if I figure it out.

Ginner avatar Dec 22 '21 18:12 Ginner