I wanted to create a kiosk Ubuntu, then I followed this instruction: https://web.archive.org/web/20131210161955/http://phunehehe.is-great.org/2010/run-linux-with-a-bare-window-manager/

Add a custom session by creating a file at /usr/share/xsessions/metacity-session.desktop. This file tells the login manager about your session. content:

[Desktop Entry]
Comment=Metacity without GNOME

Create the file to be executed by the session added in (1) /usr/local/bin/metacity-session.

if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval `dbus-launch --sh-syntax --exit-with-session`
metacity --replace ccp & wmpid=$!
sleep 1
if [ -f ~/.metacity-session ]; then
source ~/.metacity-session &
xterm &
# Wait for WM
wait $wmpid

Create the user-specific config file ~/.metacity-session. This file will be executed by the file added in (2). The content should be the program you want to run, followed by an ampersand, for example

 firefox &

But when I did logout then wanted to login with metacity-session it didn't work(a black screen for a second and then back to login page again). Then I decided to restart my computer and then, I couldn't login even with my Ubuntu default desktop! Because when I try to login, after entering password and logging in, I have no menu and nothing! only default background pic shows and mouse pointer, nothing else!

Then I tried to install Putty on my other laptop with Win10, then connecting via SSH to Ubuntu laptop and remove all 3 files I did create before(3 files that the above instruction says). But nothing happened and I can not use my Ubuntu, because after logging in there is nothing! only background pic without any menu.

EDIT: I tried these but didn't work:

sudo apt-get update
sudo apt-get remove --purge ubuntu-desktop
sudo apt-get remove --purge unity
sudo apt-get install ubuntu-desktop
sudo apt-get install unity
  • What were you trying to do? What desktop environment were you using? What instruction is that and where did you put the quoted code? Please update the question to be more informative.
    – Deuxis
    Oct 20, 2017 at 8:29
  • @Deuxis: Sorry ...I corrected it
    – WDR
    Oct 20, 2017 at 9:25

1 Answer 1


This looks like you have accidentally overwritten some of your default session code (one of the three files, for your normal session). Ensure that this isn't just a delay caused by metacity which refreshes its cache after a different session, by simply logging in and waiting a few minutes.

If this does not help, reinstall (via apt) your desktop environment (unity or gnome, might be called unity-desktop or gnome-desktop). First try simply apt-get install --reinstall <packagename>, if this does not help, apt-get remove --purge <packagename> and then normal install. The latter will wipe all configuration and local data related to the DE so you'll probably need to reconfigure.

Secondly, following 7 years old tutorials that don't exist anymore generally isn't the best of ideas. Even asking here would've been a better choice.

Thirdly, if you want to create a kiosk system, you don't actually need such a heavy window manager. If you just want one program with one window, simply put exec firefox (or whatever the program is) in a script file (the default is ~/.xinitrc, assuming you have a separate user that will only use that session) and launch startx. What startx does is it launches a bare X server and waits for any X clients (anything that wants to display a window) to connect. If all clients exit, it kills the X server and terminates.

If on the other hand you want a few windows but still a minimalistic GUI, try openbox. Openbox is a window manager which is literally a black screen that can display and manage windows. You launch anything by right-clicking on nowhere and choosing the option from the configurable context menu. Arch Wiki is as always an invaluable source of information on that topic.

Fourthly, session-start scripts have two forms of launching applications. firefox & will launch firefox and then fork it into the background, and read further instructions. exec firefox will launch firefox and stop reading. Therefore for launching the "main" application, and not some background process, use the exec syntax.

Fifthly (is that how one is supposed to write it?), scripts that are meant to be executed should be marked as executable, otherwise an error "file x is not executable" may occur, halting whatever you were doing (in this case, launching a graphical session). You can mark a file as executable using chmod +x <filename>. This is what may have caused the black screen in the first place, but we'll never know since you've deleted these files.

  • I did what you said but didn't work!
    – WDR
    Oct 20, 2017 at 13:56
  • When the bare desktop shows, can you open a menu by right-clicking? Or use any (desktop) keyboard shortcuts like Ctrl+Alt+t? Or even X-killing Ctrl+Alt+Backspace? If not, that is extremely weird. If you did everything correctly, something that is not a component of one of the DEs nor a configuration of them is messing with your session. No idea what it might be - try switching to a text console (Ctrl+Alt+F1) and checking dmesg for any errors. Besides that, I'm helpless.
    – Deuxis
    Oct 20, 2017 at 14:24
  • No, nothing work. I also tried to install sudo apt-get install ubuntu-gnome-desktop but only Ubuntu background changed to blank screen... even ctrl+alt+f1 doesn't work now(after installing gnome-desktop) and says: A start job is running for hold until boot process finished up
    – WDR
    Oct 20, 2017 at 15:35
  • That message means that systemd is waiting for something before continuing the boot process and finishing some (my guess is, display manager) start job. Most likely you have accidentally somehow enabled two display managers, one being blocked and therefore making systemd wait forever for it to start. Try booting in rescue mode.
    – Deuxis
    Oct 20, 2017 at 15:40
  • yes, I think gnome desktop installed gdm3, and I selected that then this issue happened. although I changed the window manager to lightdm by dpkg-reconfigure lightdm but previous problem exist and I can not logging in with gnom desktop, also unity desktop has no menu as before!
    – WDR
    Oct 20, 2017 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.