mbl-35 / wslctl

Provide a single command wslctl to create, backup and manage WSL (Windows Subsystem for Linux) instances on a windows host
0 stars 1 forks source link

create: alpine user creation error when no password specified #26

Closed mbl-35 closed 1 year ago

mbl-35 commented 1 year ago

When creating a new wsl alpine instance, we get the following error:

PS> wslctl create alpine:3.17 test-alpine
alpine-minirootfs-3.17.1-x86_64.tar.gz (3,1 MB) [==============================================================================================================] 100%
Create wsl instance 'test-alpine' (wsl-version: 2)...
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
v3.17.1-143-g2f30f03909 [https://dl-cdn.alpinelinux.org/alpine/v3.17/main]
v3.17.1-147-gfe0e04d4c8 [https://dl-cdn.alpinelinux.org/alpine/v3.17/community]
OK: 17813 distinct packages available
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
(1/3) Installing linux-pam (1.5.2-r1)
(2/3) Installing shadow (4.13-r0)
(3/3) Installing sudo (1.9.12_p2-r0)
Executing busybox-1.35.0-r29.trigger
OK: 11 MiB in 18 packages
No password has been supplied.
No password has been supplied.
No password has been supplied.
chpasswd: (user <user>) pam_chauthtok() failed, error:
Authentication token manipulation error
chpasswd: (line 1, user <user>password not changed
* test-alpine created

BUT when creating same instance with a command line password, this works:

PS> wslctl create alpine:3.17 test2-alpine --pwd=ChangeMe1
* Create test2-alpine from alpine:3.17
Check import requirements ...
Download distribution 'alpine:3.17' ...
C:\Users\mboyaval\AppData\Local\Wslctl\Registry\canonical\22119834735821167177100116271955598213902185175107.tar.gz
Create wsl instance 'test2-alpine' (wsl-version: 2)...
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
v3.17.1-143-g2f30f03909 [https://dl-cdn.alpinelinux.org/alpine/v3.17/main]
v3.17.1-147-gfe0e04d4c8 [https://dl-cdn.alpinelinux.org/alpine/v3.17/community]
OK: 17813 distinct packages available
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.17/community/x86_64/APKINDEX.tar.gz
(1/3) Installing linux-pam (1.5.2-r1)
(2/3) Installing shadow (4.13-r0)
(3/3) Installing sudo (1.9.12_p2-r0)
Executing busybox-1.35.0-r29.trigger
OK: 11 MiB in 18 packages
* test2-alpine created

wslctl version: 2.3.1