How to Fix Raspberry Pi's 'Cannot Currently Show the Desktop' Error
You get this error when trying to connect via VNC.
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.
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.
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.
Stay On the Cutting Edge: Get the Tom's Hardware Newsletter
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.
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.
3. Reboot.
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.