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

LXDE black screen on Xenial #2489

Closed
cefn opened this issue Mar 21, 2016 · 8 comments
Closed

LXDE black screen on Xenial #2489

cefn opened this issue Mar 21, 2016 · 8 comments
Assignees

Comments

@cefn
Copy link

cefn commented Mar 21, 2016

$ sudo sh /media/removable/crouton/bin/edit-chroot -all
name: xenial
encrypted: no
Entering /media/removable/crouton/chroots/xenial...
crouton: version 1-20160206234800~master:daa872a0
release: xenial
architecture: amd64
xmethod: xorg
targets: keyboard,extension,lxde-desktop,lxde
host: version 7647.84.0 (Official Build) stable-channel swanky 
kernel: Linux localhost 3.10.18 #1 SMP Thu Feb 18 00:27:11 PST 2016 x86_64 x86_64 x86_64 GNU/Linux
freon: yes
Unmounting /media/removable/crouton/chroots/xenial...

Please describe your issue:

Although Xenial seemed stable even through power cycles, (running off a USB 3.0 128GB Lexar S45 key), and I began migrating to it, I have recently found that after a few minutes of idleness (or working in ChromeOS, switching to the Crouton VT screen finds it just black and the whole system becomes unresponsive.

If known, describe the steps to reproduce the issue:

Initially when the build seemed stable I was running it with just the lxde target. Recently I...

  • ...added additional targets - don't know why x11 is listed twice BTW or if this matters
$ sudo more /media/removable/crouton/chroots/xenial/.crouton-targets 
keyboard
x11
xorg
x11
audio
core
extension
lxde-desktop
lxde
gtk-extra
post-common
  • ...installed but then removed profile-sync-daemon
  • Added my user to the 'serial' group and started using the distro's Arduino IDE.

It's hard to think of anything else going on which could create the problem, although I've put a few packages in the chroot - e.g. Arduino, Google Earth, Google Chrome, Chromium, Geany, Webstorm, Komodo Edit.

Since I experienced the problem I tried removing xscreensaver and light-locker - assuming it was somehow to do with bad sleeping behaviour. However, this did not cure the problem.

@cefn
Copy link
Author

cefn commented Mar 22, 2016

I've confirmed that the screen blanking and host hanging issue doesn't appear with a Trusty chroot deployed in the same way (also on external USB within the same crouton installation on the same SWANKY platform). I've switched back to Trusty running on the external key and migrated my home folder there for now. However, revealingly the Trusty LXDE target causes a screensaver to kick in after a period of sleep.

Within the chroot I believe that xscreensaver is launched by the corresponding line in /etc/xdg/lxsession/LXDE/autostart so I've reinstalled xscreensaver and removed the autostart line instead in my xenial build (I guess there might be complications from the session autostart trying to run a binary which isn't there, and hopefully this should prevent any screensaver logic from kicking in after waking from a long sleep cycle). I've done the same thing in my Trusty build too for comparison.

Will try a long sleep cycle again overnight in xenial to see if the system can remain stable with this lightly modified configuration.

Happy to experiment with other changes or gather whatever logs people think would be relevant for diagnosing the Xenial issue. Ideally I'd migrate to Xenial when it is released to cover the next LTS cycle.

@TsinghuaMike
Copy link

I'm not sure what Xenial is, but I might have the same problem. (with Unity). I updated my chrome os, and ran into a strange problem where my chroot was taking forever to log in. I found it was just stuck on a black screen and then after about 45 seconds it would load. And then signing out was taking a similarly long time. So I updated the chroot, it gave me an error. So to sign in I get a script like this:

chronos@localhost / $ sudo startunity
Entering /mnt/stateful_partition/crouton/chroots/trusty...
A chroot setup script still exists inside the chroot.
The chroot may not be fully set up.
Would you like to finish the setup? [Y/n/d] y
Preparing chroot environment...
Installing target core...
Preparing environment...
Preparing software sources...
Ign http://cran.rstudio.com trusty/ InRelease
Ign http://dl.google.com stable InRelease
Ign http://archive.ubuntu.com trusty InRelease
Hit http://dl.google.com stable Release.gpg
Get:1 http://cran.rstudio.com trusty/ Release.gpg [473 B]
Hit http://archive.ubuntu.com trusty-updates InRelease
Hit http://cran.rstudio.com trusty/ Release
Ign http://cran.rstudio.com trusty/ Release
Hit http://dl.google.com stable Release
Hit http://archive.ubuntu.com trusty-security InRelease
Ign http://cran.rstudio.com trusty/ Packages/DiffIndex
Hit http://dl.google.com stable/main amd64 Packages
Hit http://archive.ubuntu.com trusty-backports InRelease
Hit http://archive.ubuntu.com trusty Release.gpg
Hit http://cran.rstudio.com trusty/ Packages
Hit http://archive.ubuntu.com trusty-updates/main Sources
Get:2 https://download.01.org trusty InRelease
Ign https://download.01.org trusty InRelease
Hit http://archive.ubuntu.com trusty-updates/restricted Sources
Get:3 https://download.01.org trusty/main amd64 Packages/DiffIndex
Ign https://download.01.org trusty/main amd64 Packages/DiffIndex
Hit http://archive.ubuntu.com trusty-updates/universe Sources
Ign https://download.01.org trusty/main i386 Packages/DiffIndex
Ign http://cran.rstudio.com trusty/ Translation-en
Hit http://archive.ubuntu.com trusty-updates/multiverse Sources
Hit http://archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/universe amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/main i386 Packages
Hit http://archive.ubuntu.com trusty-updates/restricted i386 Packages
Hit http://archive.ubuntu.com trusty-updates/universe i386 Packages
Hit http://archive.ubuntu.com trusty-updates/multiverse i386 Packages
Hit http://archive.ubuntu.com trusty-updates/main Translation-en
Hit http://archive.ubuntu.com trusty-updates/multiverse Translation-en
Hit http://archive.ubuntu.com trusty-updates/restricted Translation-en
Hit http://archive.ubuntu.com trusty-updates/universe Translation-en
Hit https://download.01.org trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty-security/main Sources
Hit https://download.01.org trusty/main i386 Packages
Hit http://archive.ubuntu.com trusty-security/restricted Sources
Hit http://archive.ubuntu.com trusty-security/universe Sources
Get:4 https://download.01.org trusty/main Translation-en
Ign https://download.01.org trusty/main Translation-en
Hit http://archive.ubuntu.com trusty-security/multiverse Sources
Hit http://archive.ubuntu.com trusty-security/main amd64 Packages
Hit http://archive.ubuntu.com trusty-security/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-security/universe amd64 Packages
Hit http://archive.ubuntu.com trusty-security/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty-security/main i386 Packages
Hit http://archive.ubuntu.com trusty-security/restricted i386 Packages
Hit http://archive.ubuntu.com trusty-security/universe i386 Packages
Hit http://archive.ubuntu.com trusty-security/multiverse i386 Packages
Hit http://archive.ubuntu.com trusty-security/main Translation-en
Hit http://archive.ubuntu.com trusty-security/multiverse Translation-en
Hit http://archive.ubuntu.com trusty-security/restricted Translation-en
Hit http://archive.ubuntu.com trusty-security/universe Translation-en
Hit http://archive.ubuntu.com trusty-backports/main amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/universe amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/main i386 Packages
Hit http://archive.ubuntu.com trusty-backports/restricted i386 Packages
Hit http://archive.ubuntu.com trusty-backports/multiverse i386 Packages
Hit http://archive.ubuntu.com trusty-backports/universe i386 Packages
Hit http://archive.ubuntu.com trusty-backports/main Translation-en
Hit http://archive.ubuntu.com trusty-backports/multiverse Translation-en
Hit http://archive.ubuntu.com trusty-backports/restricted Translation-en
Hit http://archive.ubuntu.com trusty-backports/universe Translation-en
Hit http://archive.ubuntu.com trusty Release
Hit http://archive.ubuntu.com trusty/main Sources
Hit http://archive.ubuntu.com trusty/restricted Sources
Hit http://archive.ubuntu.com trusty/universe Sources
Hit http://archive.ubuntu.com trusty/multiverse Sources
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Hit http://archive.ubuntu.com trusty/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty/main i386 Packages
Hit http://archive.ubuntu.com trusty/restricted i386 Packages
Hit http://archive.ubuntu.com trusty/universe i386 Packages
Hit http://archive.ubuntu.com trusty/multiverse i386 Packages
Hit http://archive.ubuntu.com trusty/main Translation-en
Hit http://archive.ubuntu.com trusty/multiverse Translation-en
Hit http://archive.ubuntu.com trusty/restricted Translation-en
Hit http://archive.ubuntu.com trusty/universe Translation-en
Fetched 4142 B in 27s (153 B/s)
W: GPG error: http://cran.rstudio.com trusty/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51716619E084DAB9
W: GPG error: https://download.01.org trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A902DDA375E52366
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.
Ensuring system is up-to-date...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
i965-va-driver va-driver-all vdpau-va-driver
The following packages will be upgraded:
coreutils gir1.2-javascriptcoregtk-3.0 gir1.2-webkit-3.0
google-chrome-stable initramfs-tools initramfs-tools-bin libgraphite2-3
libjavascriptcoregtk-1.0-0 libjavascriptcoregtk-3.0-0 libpam-modules
libpam-modules-bin libpam-runtime libpam0g libtiff5 libtiff5:i386 libva1
libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libwebkitgtk-3.0-0
libwebkitgtk-3.0-common linux-libc-dev linux-libc-dev:i386 openjdk-7-jre
openjdk-7-jre-headless r-base r-base-core r-base-dev r-base-html r-cran-nlme
r-doc-html r-recommended tzdata tzdata-java
33 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 134 MB of archives.
After this operation, 2587 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
i965-va-driver libva1 r-base-core r-cran-nlme r-base r-recommended
r-base-dev r-doc-html va-driver-all r-base-html
E: There are problems and -y was used without --force-yes
Failed to complete chroot setup.
The chroot setup script may be broken. Your chroot is not fully configured.
Removing the chroot setup script. You may want to update your chroot again.

_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

X.Org X Server 1.15.1
Release Date: 2014-04-13
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-76-generic x86_64 Ubuntu
Current Operating System: Linux localhost 3.14.0 #1 SMP Thu Mar 10 03:29:27 PST 2016 x86_64
Kernel command line: cros_secure console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1 dm="1 vroot none ro 1,0 2506752 verity payload=PARTUUID=74b79f02-a964-1b40-82c8-ae6626237ec2/PARTNROFF=1 hashtree=PARTUUID=74b79f02-a964-1b40-82c8-ae6626237ec2/PARTNROFF=1 hashstart=2506752 alg=sha1 root_hexdigest=daded2d9d3644f197505201d56a2ddf01f8b227a salt=cd55aed31c3cbd618dab65efa24b5031df860779666f252d59f05277f75771aa" noinitrd vt.global_cursor_default=0 kern_guid=74b79f02-a964-1b40-82c8-ae6626237ec2 add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic i915.enable_psr=1
Build Date: 12 February 2015 02:49:29PM
xorg-server 2:1.15.1-0ubuntu2.7 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.30.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/tmp/Xorg.crouton.1.log", Time: Fri Mar 25 20:02:57 2016
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension DRI3
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension XFree86-VidModeExtension
Initializing built-in extension XFree86-DGA
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension GLX
xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)
Error executing command as another user: Not authorized

This incident has been reported.
crouton: version 1-20160206234800~master:daa872a0
release: trusty
architecture: amd64
xmethod: xorg
targets: keyboard,touch,unity,extension
host: version 7834.60.0 (Official Build) stable-channel samus
kernel: Linux localhost 3.14.0 #1 SMP Thu Mar 10 03:29:27 PST 2016 x86_64 x86_64 x86_64 GNU/Linux
freon: yes
No Chromium OS X server is available.
Cannot open /sys/class/tty/tty0/active: No such file or directory
Error: target STRING not available
(II) AIGLX: Suspending AIGLX clients for VT switch
(II) AIGLX: Suspending AIGLX clients for VT switch
(II) AIGLX: Suspending AIGLX clients for VT switch

I'm currently logged in, but something is not quite right. It is too slow to start and log out.

@drinkcat drinkcat added the P1 label Oct 11, 2016
@drinkcat drinkcat modified the milestone: Fixit Oct 2016 Oct 11, 2016
@dnschneid dnschneid changed the title Xenial Black Screen LXDE black screen on Xenial Oct 29, 2016
@drinkcat drinkcat self-assigned this Mar 9, 2017
@drinkcat
Copy link
Collaborator

drinkcat commented Mar 9, 2017

Seen occasional issues... #3130 helps a bit, but then I always get "No session for pid zyx", and only after I press a random key (otherwise the screen in black).

Lots of scary splats in dmesg too:

[72378.368684] systemd-logind[11706]: Failed to enable subscription: Launch helper exited with unknown return code 1
[72378.368710] systemd-logind[11706]: Failed to fully start up daemon: Input/output error
[72378.385192] systemd-logind[11711]: Failed to enable subscription: Launch helper exited with unknown return code 1
[72378.385222] systemd-logind[11711]: Failed to fully start up daemon: Input/output error
[72383.605030] systemd-logind[12020]: Failed to enable subscription: Launch helper exited with unknown return code 1
[72383.605060] systemd-logind[12020]: Failed to fully start up daemon: Input/output error

@drinkcat
Copy link
Collaborator

drinkcat commented Mar 9, 2017

Ok, so lxde is a bit broken, probably something to do with policykit, and first starts as black string. Pressing any key, then clicking Ok on the "no session for pid xyz" then leads to a functional lxde.

@drinkcat drinkcat added P2 and removed P1 labels Mar 9, 2017
@DennisLfromGA
Copy link
Collaborator

lxde is my goto desktop so I've been dealing with this for a while.
I get the 'no session' error and pressing any key or clicking ok moves on to the desktop.

I didn't know if this was an upstream bug or not so I took the lazy route and ignored it.
I'll let you know if #3130 helps when I update.

@picostove
Copy link
Collaborator

lxsession has a built-in polkit agent, and that is unfortunately trying to find its logind session. Which doesn't work, because after trusty logind depends on systemd running :(

@drinkcat drinkcat assigned picostove and unassigned drinkcat Mar 15, 2017
@cefn
Copy link
Author

cefn commented Oct 9, 2017

I am trying once again to run crouton with LXDE (I gave up after SD mounts were failing through suspend/resume cycles). However, the same issue remains.

There seemed to be an upstream issue resolved here... https://ubuntuforums.org/showthread.php?t=2178645 ...but the config file change looks like it forces the PAM session to be required, which would never work on crouton given no systemd I imagine. @smibarber were you able to map out any options for preventing this issue?

@d2cmath
Copy link

d2cmath commented May 22, 2018

Hi everyone, after some hacks and slash I think I found a solution/workaround for this long-standing issue. First of all, the problem has nothing to do with LXDE nor its polkit agent lxpolkit, but rather the way policykit daemon of new systems (Xenial, Artful, Bionic, Stretch, Sid/Buster) are bound to systemd. And the problem manifests itself in the way that you cannot use graphical applications that require admin privileges like Synaptic, or mount USB drives or SD cards.

Here are two reasons of the problem in my understanding:

R1 The Polkit daemon (package policykit-1) and its libraries were hard-compiled to systemd, so it requires a running systemd to check the authenticity of processes (eg. if they are invoked from a valid user session).

R2 Systemd refuses to run unless it has PID 1, so it cannot be executed inside chroot. Interestingly, we can see a broken logind daemon running inside chroot (the exact process id can be found with ps -fax | grep logind): it has no session, nor active user. For example,

loginctl list-sessions

returns a broken message, or an empty list.

So my workaround contains two parts which fixe R1 and R2 respectively. The second part of fixing R2 is optional, but it will allow the desktop environment (LXDE, XFCE, etc.) to properly create their session.

Note: I used Xenial, but at least I tested the first part and made it work (with some tweaks because of missing packages from the official repository) for Stretch, Buster/Sid, and Bionic.

PART I

We will recompile and install policykit-1 packages for non-systemd. Thus, the polkit daemon will have to communicate with another dbus service called ConsoleKit to checking the user-session validity.

1. Enter chroot and prepare a folder for compilation:

mkdir build-policykit-1
cd build-policykit-1
apt-get source policykit-1

this should download some files and a source folder named policykit-1-<version> (the exact <version> depends on your system), enter that source folder:

cd <name of the source folder>

2. Open debian/rules file in a text editor (eg. vim, nano, gedit) and look for the lines that set SYSTEMD_CONFIG_FLAG at the begining. Mines are:

ifeq (linux,$(DEB_HOST_ARCH_OS))
  SYSTEMD_CONFIG_FLAG = --enable-systemd
else
  SYSTEMD_CONFIG_FLAG = --disable-systemd
endif

Then add # in front of each line except the one with --disable-systemd:

#ifeq (linux,$(DEB_HOST_ARCH_OS))
#  SYSTEMD_CONFIG_FLAG = --enable-systemd
#else
   SYSTEMD_CONFIG_FLAG = --disable-systemd
#endif

3. (optional step) Open debian/control, under "Depends" of "Package: policykit-1" section, there should be a mention of consolekit with option [!linux-any], remove the "!" in that option to add consolekit to the dependency of this policykit-1 build.

4. Prepare build environment and dependencies

sudo apt-get install dpkg-dev
sudo apt-get build-dep policykit-1

5. Make new .deb packages

dpkg-buildpackage -uc -us

this should create new packages outside the source folder. We are interested in only 3 of them:
policykit-1-<version>.deb,
libpolkit-backend-1-0_<version>.deb, and
libpolkit-gobject-1-0_<version>.deb.

6. Install consolekit (if not yet installed) and the custom built packages

sudo apt-get install consolekit
sudo dpkg -i <full name of the policykit-1 package created>
sudo dpkg -i <full name of the libpolkit-backend-1 package created>
sudo dpkg -i <full name of the libpolkit-gobject-1 package created>

On Buster/Sid, Artful or Bionic, you will not have access to ConsoleKit, but you can download it and two of its dependences libck-connector0 and libpam-ck-connector from another/older distribution to install with "dpkg -i" instead, eg. I tested Bionic with the consolekit package (+ its dependences) from Stretch and it works.

7. Mark the custom packages to protect them from future updates

sudo apt-mark hold policykit-1
sudo apt-mark hold libpolkit-backend-1-0
sudo apt-mark hold libpolkit-gobject-1-0

8. Exit and relog to chroot to test the system. In a chroot terminal,

ck-list-sessions

should give the detail of your session. Then admin privilege applications should now work properly if you have a polkit agent installed and (auto-)started for your desktop environment. For example, in XFCE I installed lxpolkit (replacing the default gnome one) and there is an option to enable it in: Applications > Settings > Sessions and Startup > Startup applications.

Still, the session record of the system does not work properly yet, eg.

loginctl list-sessions

is probably broken, or running

echo $XDG_SESSION_ID

inside a terminal of the desktop environment would still return an empty string.

PART II

We will revert the chroot to sysv instead of systemd.

1. On Xenial, I don't have access to sysvinit-core package from the repository, so I downloaded the .deb package from Debian [Stretch] instead. The file name looks like sysvinit-core_<version>.deb. You should find it by googling "sysvinit-core debian stretch".

2. Remove the conflicting packages:

sudo apt-get purge --remove --auto-remove systemd-sysv
sudo apt-get purge --remove --auto-remove upstart-sysv

This will probably prompt a warning message of a harmful action since we will remove "init" package. But we will replace it with sysvinit-core anyway, and we are not booting the whole machine to the chroot, so no harm. Just follow the instruction, typing "Yes, do as I say!".

3. Install sysvinit-core and protect it from future update

sudo dpkg -i <full name of the sysvinit-core package downloaded>
sudo apt-mark hold sysvinit-core

(use apt-get install instead of dpkg -i if you system has access to sysinit-core package directly, for example in Debian [Stretch])

4. Exit and relog to chroot test to the new system:

loginctl list-sessions

should give you a proper list now (mine has 3 items in it), and inside a terminal of a desktop environment

echo $XDG_SESSION_ID

should give you a non-empty string (mine is "c3" for session3).

Completing this part actually fixes an issue I have with xfce4-power-manger 1.4.4 on Stretch that does not load (it seems this user service communicates with logind on dbus to acquire permissions).

Edit: fixed some typos as I re-read this to apply to my new chromebook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants