How to Fix Raspberry Pi's 'Cannot Currently Show the Desktop' Error

Raspberry Pi
(Image credit: Tom's Hardware)

 It’s a truly frustrating error you may encounter when you try to connect to your Raspberry Pi remotely using VNC. After you’ve done a Raspberry Pi headless install, you try getting remote access to the desktop environment, but VNC viewer (or some other client) gives you a black screen and with the message “Cannot currently show the desktop” on it. 

You may get this error when you attempt to connect to your Raspberry Pi via VNC. (Image credit: Tom's Hardware)

 

There are a couple of possible solutions for the “Cannot currently show the desktop” error message when connecting to your Raspberry Pi. Try each and see if it resolves the issue. All of the solutions below involve using the command prompt, either by directly connecting a keyboard and mouse to your Raspberry Pi or by using a remote SSH connection to get to the terminal. Massive hat tip to the folks in this forum thread who offered solutions and inspired this article.

 Change Your Screen Resolution

 Even though it should have a working default setting, often changing resolution at the command prompt.will solve the “Cannot currently show the desktop” error. To do this: 

1.  Launch raspi-config. 

sudo raspi-config

2.  Select Advanced Options-> Resolution. 

Raspberry PI Cannot Currently Show the Desktop Error Fix

(Image credit: Tom's Hardware)

3.  Choose a resolution. We recommend at least 1280 x 720, but some users report that choosing the highest possible (usually 1920 x 1080) is what they needed to do. 

Raspberry PI Cannot Currently Show the Desktop Error Fix

(Image credit: Tom's Hardware)

 You’ll need to reboot your Raspberry Pi for this change to take effect. 

 Install or Reinstall LXSession

 One reason that Raspberry Pi might be giving you the “cannot show the desktop” error is that there’s a problem with your session manager or it’s just not installed. 

To install LXsession, type:

sudo apt-get install lxsession

If LXSession is already installed, you should try reinstalling LXSession and the libgtk2.0-0 library: 

sudo apt-get install --reinstall libgtk2.0-0
sudo apt-get install --reinstall lxsession

 Boot to Desktop Mode

 If your Raspberry Pi has LXDE, the desktop environment installed, but it’s set to boot to command prompt, you won’t be able to view the desktop via VNC. To change Raspberry PI’s boot mode:

sudo raspi-config

2.  Select Boot Options->Desktop / ClI-> Desktop Autologin then hit Enter and select Finish to exit the software. 

Raspberry PI Cannot Currently Show the Desktop Error Fix

(Image credit: Tom's Hardware)

3.  Reboot.

Raspberry PI Cannot Currently Show the Desktop Error Fix

(Image credit: Tom's Hardware)

 Clear Space in Root Partition

 It’s always possible that your desktop isn’t available, because you’ve run out of disk space. The way to find out is to type the following at the command prompt: 

df -h

 You’ll see a list of partitions and their amount of free space. If your root partition has no or almost no free space, that could be the problem and you should consider uninstalling some stuff or moving to a larger microSD card.

Raspberry PI Cannot Currently Show the Desktop Error Fix

(Image credit: Tom's Hardware)
Avram Piltch
Avram Piltch is Tom's Hardware's editor-in-chief. When he's not playing with the latest gadgets at work or putting on VR helmets at trade shows, you'll find him rooting his phone, taking apart his PC or coding plugins. With his technical knowledge and passion for testing, Avram developed many real-world benchmarks, including our laptop battery test.
  • DEJHy
    Changing the resolution to 1920x1280 worked fine for me. Thanks.
    Reply
  • DerrickPhon
    DMT Mode 35 1280x1024 60Hz 5:4 works for me, Thanks for the solution!
    Reply
  • paja
    Changing resolution on DMT 35 1280x 1024 via SSH on RaspPi helps me as well. Thank you.
    Reply
  • ashk98
    I was working on installing maven on my raspberry pi3b+ and when I rebooted it, it asked me to enter my password again. Upon entering the password a message pops up: Cannot currently show the desktop".
    I tried the following but nothing worked:
    a) changed the screen resolution to 1280 x 720 and 1920 x 1080
    b) installed and reinstalled Lx session
    c) booted to desktop mode
    d) cleared some space
    Reply
  • IceBotYT
    I changed it to autologin to desktop, but now I can't SSH into it or use VNC. Help?!
    Reply
  • M7D
    If doesn't fix try sudo dpkg-reconfigure lightdm it worked with me
    Reply