ubuntu / WSL

Ubuntu WSL image build and launcher code.
MIT License
151 stars 45 forks source link

Do not prompt to create a user when it is already created by cloud-init #469

Closed jibel closed 1 month ago

jibel commented 6 months ago

cmd /c ver

Microsoft Windows [Version 10.0.22631.3527]

wsl --status

Default Distribution: Ubuntu-20.04 Default Version: 2

Did the problem occur during installation?

What happened?

I've the following cloud-init configuration file

#cloud-config
locale: fr_FR
users:
- name: u
  gecos: Ubuntu User
  groups: [adm,dialout,cdrom,floppy,sudo,audio,dip,video,plugdev,netdev]
  sudo: ALL=(ALL) NOPASSWD:ALL
  shell: /bin/bash

write_files:
- path: /etc/wsl.conf
  append: true
  content: |
    [user]
    default=u

packages: [hello]

It creates a default user. If I install wsl with wsl --install ubuntu-24.04 then I'm prompted to create a default user too. This is unnecessary since the user is created by cloud-init.

What was expected?

Do not prompt to add a default user

Steps to reproduce

run wsl --install ubuntu-24.04 with the cloud-init configuration above in .cloud-init/ubuntu-24.04.user-data

Additional information

No response

CarlosNihelton commented 1 month ago

Closed by #478 and #491, which are included in the latest versions published in the store.