genie icon indicating copy to clipboard operation
genie copied to clipboard

System slow, or even stuck

Open giovannimasi opened this issue 3 years ago • 5 comments

Windows version (build number): Find this by running winver Windows 11 21H2 build 22000.613

Linux distribution: i.e. Debian bullseye, Ubuntu focal, etc. If your distro was not installed from the Microsoft Store, please indicate source and method of installation. Ubuntu (Microsoft Store, the generic one updated to 22.04 LTS)

Kernel version: The output of cat /proc/sys/kernel/osrelease 5.10.16.3-microsoft-standard-WSL2

Genie version: The output of genie --version genie 2.3

Describe the bug A clear and concise description of what the bug is. At first, genie seems to work with no problems: I used it in Ubuntu 20.04 but when upgraded to Ubuntu 22.04 appeared the problem I'm going to explain, so, since I had to reinstall Ubuntu, I did the 22.04 upgrade as the first thing, thei I installed genie and it worked, but while installing ubuntu-desktop (the gnome desktop environment via apt) the problem started another time. This is the problem: the system slows down, and it's slow enough to appear stuck.

Confirm that you are running inside the bottle: The output of genie -b. While checking if I am inside the bottle...he actually said 'outside' but the suffix is still present in the username...

Screenshots If applicable, add screenshots to help explain your problem. image (Each exclamation point lasts for a very long time, not just 1 sec. as it should) image (it's stuck here)

I confirm that I have read the ENTIRE supplied readme file and checked for relevant information on the repository wiki before raising this issue, and that if the solution to this issue is found in either location, it will be closed without further comment:

  • [x] Yes.

giovannimasi avatar Apr 28 '22 15:04 giovannimasi

I also had this issue on with the below info. Uninstalling Ubuntu and doing a fresh install of Ubuntu Focal followed by upgrading to Jammy BEFORE installing genie or dotnet-runtime seems to have fixed the problem

Windows version (build number): 11 21H2 Build 2200.795

Linux distribution: started with Ubuntu Focal from Microsoft store; genie was working as expected

upgraded to Ubuntu Jammy; genie is having the below issues (believed to be the same as Issue #265 except with genie 2.4)

Then upgraded to dotnet-runtime-6.0 and issues persisted

Kernel version: 5.10.102.1-microsoft-standard-WSL2

Genie version: genie 2.4

Ctrl-C was performed after at least 300 seconds. Entering WSL via command line after (without --shutdown) showed systemd running in unknown state and genie -b output was "outside" (https://user-images.githubusercontent.com/110206937/181789178-c8583c7c-72a1-4ede-a614-e43db006def2.png)

Kirkyelise avatar Jul 29 '22 15:07 Kirkyelise

.... and then broke again when I installed kubuntu-desktop image image

screenshot taken after a good 5 - 10 minutes

I also had this issue on with the below info. Uninstalling Ubuntu and doing a fresh install of Ubuntu Focal followed by upgrading to Jammy BEFORE installing genie or dotnet-runtime seems to have fixed the problem

Windows version (build number): 11 21H2 Build 2200.795

Linux distribution: started with Ubuntu Focal from Microsoft store; genie was working as expected

upgraded to Ubuntu Jammy; genie is having the below issues (believed to be the same as Issue #265 except with genie 2.4)

Then upgraded to dotnet-runtime-6.0 and issues persisted

Kernel version: 5.10.102.1-microsoft-standard-WSL2

Genie version: genie 2.4

Ctrl-C was performed after at least 300 seconds. Entering WSL via command line after (without --shutdown) showed systemd running in unknown state and genie -b output was "outside" (https://user-images.githubusercontent.com/110206937/181789178-c8583c7c-72a1-4ede-a614-e43db006def2.png)

Kirkyelise avatar Jul 29 '22 16:07 Kirkyelise

What does the top say?

Also, after such a failed start, try entering the bottle manually, using:

sudo nsenter -a -t {pid} bash

where {pid} is the pid of systemd. Then use systemctl (systemctl status, systemctl --failed, etc.) to examine the systemd state, which should tell you which units are causing problems.

cerebrate avatar Jul 29 '22 17:07 cerebrate


PS C:\Users\kirst> wsl
kirk@Kirk-Sus:/mnt/c/Users/kirst$ c
c: command not found
kirk@Kirk-Sus:/mnt/c/Users/kirst$ cd
kirk@Kirk-Sus:~$ genie -i -v
genie: starting bottle
genie: generating new hostname
genie: external hostname is Kirk-Sus
genie: setting new hostname to Kirk-Sus-wsl
genie: updating hosts file
genie: unmounting binfmt_misc filesystem before proceeding
genie: AppArmor not available in kernel; attempting to continue without AppArmor namespace
genie: starting systemd with command line:
daemonize /usr/bin/unshare -fp --propagation shared --mount-proc -- systemd
Waiting for systemd....!!!!!^CTraceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/genie/genie/__main__.py", line 581, in <module>
  File "/usr/lib/genie/genie/__main__.py", line 564, in entrypoint
  File "/usr/lib/genie/genie/__main__.py", line 351, in do_initialize
  File "/usr/lib/genie/genie/__main__.py", line 295, in inner_do_initialize
  File "/usr/lib/genie/genie/helpers.py", line 35, in get_systemd_state
  File "/usr/lib/python3.10/subprocess.py", line 503, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.10/subprocess.py", line 1149, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.10/subprocess.py", line 2000, in _communicate
    ready = selector.select(timeout)
  File "/usr/lib/python3.10/selectors.py", line 416, in select
    fd_event_list = self._selector.poll(timeout)
KeyboardInterrupt

kirk@Kirk-Sus:~$ top
top - 18:15:49 up 9 min,  0 users,  load average: 1.03, 0.92, 0.51
Tasks:  15 total,   2 running,  13 sleeping,   0 stopped,   0 zombie
%Cpu(s): 11.1 us,  2.9 sy,  0.0 ni, 86.0 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st
MiB Mem :   7795.0 total,   7111.3 free,    266.6 used,    417.1 buff/cache
MiB Swap:   2048.0 total,   2048.0 free,      0.0 used.   7299.5 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
     37 root      20   0   21956  11532   8488 R 100.0   0.1   8:54.17 systemd
     84 root      19  -1  412376 262708 261712 S  23.3   3.3   2:09.71 systemd-journal
      1 root      20   0    1756   1088   1016 S   0.0   0.0   0:00.01 init
      7 root      20   0    1756     88      0 S   0.0   0.0   0:00.00 init
      8 root      20   0    1756     88      0 S   0.0   0.0   0:00.00 init
      9 kirk      20   0    9108   5240   3464 S   0.0   0.1   0:00.05 bash
     36 root      20   0    6184    952    860 S   0.0   0.0   0:00.00 unshare
    119 root      20   0   23168   6776   4548 S   0.0   0.1   0:00.33 systemd-udevd
    124 root      20   0    4492    192     48 S   0.0   0.0   0:00.00 snapfuse
    125 root      20   0    4492    160     12 S   0.0   0.0   0:00.00 snapfuse
    126 root      20   0    4492    200     52 S   0.0   0.0   0:00.00 snapfuse
    159 systemd+  20   0   16112   8144   7144 S   0.0   0.1   0:00.03 systemd-network
    508 kirk      20   0   10768   3756   3156 R   0.0   0.0   0:00.00 top
    515 root      20   0   23168   4104   1860 S   0.0   0.1   0:00.00 systemd-udevd
    516 root      20   0   23168   4104   1860 S   0.0   0.1   0:00.00 systemd-udevd








kirk@Kirk-Sus:~$ sudo nsenter -t 37 bash
[sudo] password for kirk:
root@Kirk-Sus-wsl:/home/kirk# systemctl --failed
Failed to list units: Transport endpoint is not connected
root@Kirk-Sus-wsl:/home/kirk#

Kirkyelise avatar Jul 29 '22 22:07 Kirkyelise

not sure if this is helpful info or just expected. IIRC, systemd is all about parallel processes, but which services does it run first? It doesn't seem to be making it very far

root@Kirk-Sus-wsl:/home/kirk# systemd --system
Can't run system mode unless PID 1.
root@Kirk-Sus-wsl:/home/kirk# systemd --user
Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.
root@Kirk-Sus-wsl:/home/kirk# systemd --test
Don't run test mode as root.
root@Kirk-Sus-wsl:/home/kirk# login
Kirk-Sus-wsl login: kirk
"System is booting up. Unprivileged users are not permitted to log in yet. Please come back later. For technical details, see pam_nologin(8)."

Kirkyelise avatar Jul 29 '22 22:07 Kirkyelise