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

Ubuntu installation on WSL1 hangs during cloud-init. #12341

Open
1 of 2 tasks
yamam opened this issue Dec 4, 2024 · 7 comments
Open
1 of 2 tasks

Ubuntu installation on WSL1 hangs during cloud-init. #12341

yamam opened this issue Dec 4, 2024 · 7 comments
Labels
emailed-logs Logs have been emailed fixinbound

Comments

@yamam
Copy link

yamam commented Dec 4, 2024

Windows Version

Microsoft Windows [Version 10.0.26100.2314]

WSL Version

2.3.26.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

Ubuntu 24.04

Other Software

No response

Repro Steps

Install Ubuntu as follows:

> wsl --install --enable-wsl1 Ubuntu

After rebooting, execute the following:

> wsl --set-default-version 1

Run Ubuntu.
It remains stuck on the display "Installing, this may take a few minutes..." for over 10 minutes.
When executing the following command in another command prompt:

> wsl -l -v

At first, it shows that it is installing:

  NAME      STATE           VERSION
  Ubuntu    Installing      1

After a while, it becomes clear that the installation is complete:

  NAME      STATE           VERSION
* Ubuntu    Running         1

At this point, run wsl:

> wsl

Check for any processes that seem to be hanging using ps:

# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  10656   744 ?        Ssl  16:39   0:00 /init
root         4  0.0  0.0  10656   580 ?        Sl   16:39   0:00 plan9 --control-socket 6 --log-level 4 --server-fd 7 --
root         9  0.0  0.0  10656   360 tty1     Ss   16:39   0:00 /init
root        10  0.0  0.0  12792  1744 tty1     S    16:39   0:00 /bin/bash -c cloud-init status --wait >/dev/null 2>&1
root        11  1.1  0.2  54160 33184 tty1     S    16:39   0:00 /usr/bin/python3 /usr/bin/cloud-init status --wait
root        13  0.0  0.0  10656   360 tty2     Ss   16:41   0:00 /init
root        14  0.4  0.0  14112  3812 tty2     S    16:41   0:00 -bash
root       103  0.0  0.0  16312  2764 tty2     R    16:41   0:00 ps aux

Since cloud-init seems suspicious, kill it:

# kill 11

Then, the installation proceeds and you will be prompted to enter a username:

Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers

Expected Behavior

The installation should not hang.

Actual Behavior

The installation hangs.

Diagnostic Logs

No response

Copy link

github-actions bot commented Dec 4, 2024

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@yamam
Copy link
Author

yamam commented Dec 4, 2024

/emailed-logs

Copy link

github-actions bot commented Dec 4, 2024

Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

@github-actions github-actions bot added the emailed-logs Logs have been emailed label Dec 4, 2024
@OneBlue
Copy link
Collaborator

OneBlue commented Dec 6, 2024

Thank you for reporting this @yamam. When ubuntu is in this state, could you attach an strace to the cloud-init process so we can see what it's doing ? (strace -p )

Also can you share cloud-init logs (should be in /var/log/cloud-init-output.log)

@yamam
Copy link
Author

yamam commented Dec 7, 2024

# strace -p 11
strace: Process 11 attached
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=354854000}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=355256300}) = 0
write(1, ".", 1)                        = 1
newfstatat(AT_FDCWD, "/run/systemd/system", 0x7fffca73c4b0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/cloud-init/status.json", 0x7fffca73c4b0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/cloud-init/status.json", 0x7fffca73c4b0, 0) = -1 ENOENT (No such file or directory)
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=359197700}) = 0
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, {tv_sec=1755, tv_nsec=609197700}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=610146600}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=610518000}) = 0
write(1, ".", 1)                        = 1
newfstatat(AT_FDCWD, "/run/systemd/system", 0x7fffca73c4b0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/cloud-init/status.json", 0x7fffca73c4b0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/cloud-init/status.json", 0x7fffca73c4b0, 0) = -1 ENOENT (No such file or directory)
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=613855600}) = 0
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, {tv_sec=1755, tv_nsec=863855600}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=864607700}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=864977300}) = 0
write(1, ".", 1)                        = 1
newfstatat(AT_FDCWD, "/run/systemd/system", 0x7fffca73c4b0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/cloud-init/status.json", 0x7fffca73c4b0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/run/cloud-init/status.json", 0x7fffca73c4b0, 0) = -1 ENOENT (No such file or directory)
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1755, tv_nsec=867950800}) = 0
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, {tv_sec=1756, tv_nsec=117950800}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1756, tv_nsec=118960000}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=1756, tv_nsec=119436200}) = 0
write(1, ".", 1)                        = 1
# cat /var/log/cloud-init-output.log
cat: /var/log/cloud-init-output.log: No such file or directory

@sirredbeard
Copy link
Contributor

sirredbeard commented Dec 8, 2024

newfstatat(AT_FDCWD, "/run/systemd/system", 0x7fffca73c4b0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)

/run/systemd/system would not exist if systemd was never started, which it won't be on WSL1.

I wondered if cloud-init is doing something that is failing without systemd but it appears the default cloud-init config for WSL is pretty plain..

I am still suspicious though, I think it might be worth reporting on Ubuntu's wsl-setup repo.

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 13, 2024

Thank you @yamam. We have reported the issue to canonical. They're working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emailed-logs Logs have been emailed fixinbound
Projects
None yet
Development

No branches or pull requests

3 participants