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

[Advice] Unable to log-in to newly created image using user-data.basic config? Try this: #33

Closed
agusserraa98 opened this issue Apr 24, 2023 · 4 comments
Assignees
Labels
Community Advice Resources from the community Discussion documentation Improvements or additions to documentation

Comments

@agusserraa98
Copy link

agusserraa98 commented Apr 24, 2023

For context, I created my user-data file using the user-data.basic as a base.

I created the image but I can't log in to the server at all with the created user.

I thought it was my configuration but I used the user-data.basic and still can't login.

Anyone with a similar problem?

@cloudymax
Copy link
Owner

Thanks for letting me know that there was an issue, I'll look into this after work today. 👍

Could you share the command you used to generate your image?

@cloudymax cloudymax self-assigned this Apr 25, 2023
@cloudymax cloudymax changed the title Problem Unable to log-in to newly created image using user-data.basic config Apr 25, 2023
@agusserraa98
Copy link
Author

Hello Max!

Thank you very much for your help
I use the following command:

docker run --cpus 3 --privileged --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) deserializeme/pxeless -a -k -u user-data.basic -s ubuntu-22.04.2-live-server-amd64.iso -d unatended.iso -x /data

@cloudymax
Copy link
Owner

Thanks for providing this and my apologies for the delay, work is rough this week but tomorrow is a national holiday here in The Netherlands so I'll have the time to test a fix 👍

@cloudymax
Copy link
Owner

cloudymax commented Apr 26, 2023

@agusserraa98 I tried to run the command you provided:

docker run --cpus 3 --privileged \
--rm --volume "$(pwd):/data" \
--user $(id -u):$(id -g) \
deserializeme/pxeless -a -k -u user-data.basic  -s ubuntu-22.04.2-live-server-amd64.iso -d unatended.iso -x /data

and it failed with a permissions error:

sudo: you do not exist in the passwd database

This prompted me to do some experimenting and it looks like I made an error in the documentation due to some incorrect assumptions about the permissions required to mount a squashfs in a container. Please accept my apologies for not catching that issue earlier 😅

It turns out that we cannot use --user $(id -u):$(id -g) when also using the -x option because your user id is not in the sudoers file of the container, and we need to use sudo to mount the squashfs. This could be fixed by me adding a user account to the container that has been granted password-less sudo access and then explicitly running the docker command with that user's id and group - but that's work i will have to do at a later date. Ive opened a ticket for myself here: #34

For now, I slightly modified the command to remove the option mentioned previously, and ran it using the latest and v0.0.7 image tags:

docker run --cpus 16 --privileged \
--rm --volume "$(pwd):/data"  \
deserializeme/pxeless -a -k -u user-data.basic  -s ubuntu-22.04.2-live-server-amd64.iso -d unatended.iso -x /data

I was able to install the ISO and login using the basic profile credentials

Screenshot 2023-04-26 at 22 18 08

I also now see that we don't need to use --privileged to mount the squashfs in the container, only sudo. So that flag can also be dropped. 😅

If that still does not work for you, and you are using a USB drive and not a VM - try another USB drive. I have had multiple instances where a drive has failed to properly hold an ISO when imaged via dd/rufus/etcher towards the end of its life. Ive also had this happen with some drives I ordered in bulk from ali-express, so if you have a spare - try it out.

Let me know if you still have issues 👍

@cloudymax cloudymax added bug Something isn't working documentation Improvements or additions to documentation labels Apr 27, 2023
@cloudymax cloudymax changed the title Unable to log-in to newly created image using user-data.basic config [Bug] Unable to log-in to newly created image using user-data.basic config Apr 27, 2023
@cloudymax cloudymax added Community Advice Resources from the community Discussion and removed bug Something isn't working labels Jun 2, 2023
@cloudymax cloudymax changed the title [Bug] Unable to log-in to newly created image using user-data.basic config [Advice] Unable to log-in to newly created image using user-data.basic config? Try this: Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Advice Resources from the community Discussion documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants