Vnc raspberry cannot currently show the desktop

If you have currently just installed a new Rasberry Pi 4 OS and try to remote in via VNC without attached the Pi to a monitor, you might face the problem below:

Vnc raspberry cannot currently show the desktop

To solve the issue, you can update your screen resolution. Run the command below and enter Raspberry Pi Software Configuration Tool

sudo raspi-config

Select 2 Display Options, then Resolution. Choose the 1280×720 or 1920×1080 and proceed to reboot. This should be can solve the problem.

Vnc raspberry cannot currently show the desktop

I tried everything, changing resolution, forcing HDMI output, pi auto login. Nothing seems to work. Using Raspberry Pi 4. (Version 11.3, bullseye 64bit OS)

1

Basically should be sufficient to specify a HDMI mode. I have a Raspberry Pi4 headless, this is my configuration in /boot/config.txt

# For more options and information see # http://rpf.io/configtxt # Some settings may impact device functionality. See link above for details # uncomment if you get no picture on HDMI for a default "safe" mode #hdmi_safe=1 # uncomment this if your display has a black border of unused pixels visible # and your display can output without overscan disable_overscan=1 # uncomment the following to adjust overscan. Use positive numbers if console # goes off screen, and negative if there is too much border #overscan_left=16 #overscan_right=16 #overscan_top=16 #overscan_bottom=16 # uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 # uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=2 hdmi_mode=82 # uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes #hdmi_drive=2 # uncomment to increase signal to HDMI, if you have interference, blanking, or # no display #config_hdmi_boost=4 # uncomment for composite PAL #sdtv_mode=2 #uncomment to overclock the arm. 700 MHz is the default. #arm_freq=800 # Uncomment some or all of these to enable the optional hardware interfaces dtparam=i2c_arm=on #dtparam=i2s=on #dtparam=spi=on # Uncomment this to enable infrared communication. #dtoverlay=gpio-ir,gpio_pin=17 #dtoverlay=gpio-ir-tx,gpio_pin=18 # Additional overlays and parameters are documented /boot/overlays/README # Enable audio (loads snd_bcm2835) dtparam=audio=on [pi4] # Enable DRM VC4 V3D driver on top of the dispmanx display stack dtoverlay=vc4-fkms-v3d max_framebuffers=2 [all] #dtoverlay=vc4-fkms-v3d gpu_mem=128 start_x=1 enable_uart=1 #hdmi_enable_4kp60=1

Then I disabled encryption and set a VNC password. In addition, if you to see the raspistill/raspivid preview through VNC you have to enable this: RealVNC Viewer > Menu > Options > Troubleshooting > Optimize screen capture - select 'Enable direct capture mode'

waayne Posts: 4 Joined: Mon Jun 25, 2018 9:42 pm

Mon Jun 25, 2018 9:46 pm

Hey, I have a problem with my Pi 3+. I activated the VNC server and tried to connect to it on my tablet via the VNCViewer app. But when I am connected to it there is an error (see attachment).

What can I do to fix that?

Attachments Screenshot_20180625-234118.png (47.06 KiB) Viewed 281942 times

klricks Posts: 8443 Joined: Sat Jan 12, 2013 3:01 am Location: Grants Pass, OR, USA

Tue Jun 26, 2018 1:23 am

waayne wrote: ↑

Mon Jun 25, 2018 9:46 pm

Hey, I have a problem with my Pi 3+. I activated the VNC server and tried to connect to it on my tablet via the VNCViewer app. But when I am connected to it there is an error (see attachment).

What can I do to fix that?

The RPi must be set to boot to desktop (service mode). If a HDMI monitor is not attached then you need to specify a screen resolution in config.txt Use GUI config tool or sudo raspi-config to do that.

If not booting to desktop then you need to use virtual mode. (Run vncserver from the command line).

Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

coldsprite Posts: 2 Joined: Thu Jul 05, 2018 9:25 pm

Thu Jul 05, 2018 9:27 pm

I have same problem. I enabled service mode desktop auto login, and default resolution. Still see same "Cannot currently show the desktop" error on VNC.

Thanks

klricks Posts: 8443 Joined: Sat Jan 12, 2013 3:01 am Location: Grants Pass, OR, USA

Thu Jul 05, 2018 9:38 pm

coldsprite wrote: ↑

Thu Jul 05, 2018 9:27 pm

I have same problem. I enabled service mode desktop auto login, and default resolution. Still see same "Cannot currently show the desktop" error on VNC.

Thanks

Do not use default resolution. Choose something else.

Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

jkellogg11 Posts: 1 Joined: Sun Jul 08, 2018 11:21 pm

Sun Jul 08, 2018 11:34 pm

You need to install a window manager. Check out this post.

viewtopic.php?f=66&t=133691

My .xsession-errors file showed this. After installing LXDE I could login. root@raspberrypi:~# cat .xsession-errors Xsession: X session started for root at Wed 18 Apr 13:50:07 UTC 2018 Xsession: unable to start X session --- no "/root/.xsession" file, no "/root/.Xsession" file, no session managers, no window managers, and no

terminal emulators found; aborting.

pk_rulz Posts: 1 Joined: Fri Aug 31, 2018 8:57 am

Fri Aug 31, 2018 9:54 am

If everything was working fine and it stopped suddenly then there is possibility that you might have run out of space on the SD card. I am listing it down to help someone who have such a problem The following thread should help you to fix that issue

https://www.raspberrypi.org/forums/view ... hp?t=71520

In a nutshell

If you can connect over ssh, this should show you if your /dev/root is full


If it is, this should help you locate the culprit folder/file. Remove it and vnc should work fine.

Code: Select all

sudo du -xh / | grep -P "G\t"

For more advanced options the thread link at the stop should help

demian Posts: 1 Joined: Tue Oct 08, 2013 6:28 am

Thu Oct 04, 2018 7:09 am

In my case... I installed lxsession(sudo apt-get install lxsession)

, then work OK.

nikitakaps Posts: 1 Joined: Fri May 24, 2019 3:42 pm

Fri May 24, 2019 3:47 pm

I tried everything mentioned in this thread, but nothing worked. What helped me was deleting the /home/pi/.profile using sudo rm .profile
After rebooting I was automatically logged in and everything worked as before. Hope this helps!

Anantasak Posts: 1 Joined: Sun Jun 09, 2019 7:30 am

Sun Jun 09, 2019 7:37 am

For some case: Found that problem cause by lxsession file damage. Try PD by running lxsession and find out which package broken then reinstall specific package.

pi@raspberrypi:~ $ lxsession
lxsession: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/libgtk-x11-2.0.so.0: nonzero padding in e_ident

Fixed by checking md5 libgtk-x11-2.0.so.0 a.k.a libgtk-x11-2.0.so.0.2400.31

pi@raspberrypi:/usr/lib/arm-linux-gnueabihf $ md5sum libgtk-x11-2.0.so.0.2400.31
845a355f212cfb3ac3e9cb6926002615 libgtk-x11-2.0.so.0.2400.31

then rerun install package

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

to resolved lxsession

pi@raspberrypi:/usr/lib/arm-linux-gnueabihf $ lxsession ** Message: main.vala:102: Session is (null) ** Message: main.vala:103: DE is (null) ** Message: main.vala:107: No session set, fallback to LXDE session

** Message: main.vala:113: No desktop environnement set, fallback to LXDE

Vnc raspberry cannot currently show the desktop

RottenRonnie Posts: 8 Joined: Thu Feb 26, 2015 1:15 am Location: Charlottetown PE, Canada

Fri Jun 14, 2019 4:45 pm

I used these steps to get the RealVNC server to work after reading the posts above: (Note that resetting the max resolution in raspi-config had no effect and I was still seeing the error message.)

Code: Select all

ron@raspberrypi:~ $ cat .xsession-errors

The error that I saw:

Code: Select all

/usr/bin/x-session-manager: 33: exec: /usr/bin/lxsession: not found

Code: Select all

ron@raspberrypi:~ $ ls /usr/share/xsessions lightdm-xsession.desktop openbox.desktop ron@raspberrypi:~ $ cat /usr/share/xsessions/lightdm-xsession.desktop [Desktop Entry] Version=1.0 Name=Default Xsession Exec=default Icon= Type=Application ron@raspberrypi:~ $ sudo apt-get install --reinstall lxsession

Success!!! I'm currently logged into the regular pixel desktop.
Vnc raspberry cannot currently show the desktop

Andyroo

Wed Jun 26, 2019 2:19 pm

macd2point0 wrote: ↑ Changing the resolution worked for me. That's all i got.

N Buster it seems that you need to set the resolution before using VNC either by the GUI or command line raspi-config.

seandex Posts: 2 Joined: Sun Dec 10, 2017 11:08 am Location: Los Angeles - Korea Town

Thu Jun 27, 2019 7:46 am

klricks wrote: ↑

Tue Jun 26, 2018 1:23 am

waayne wrote: ↑

Mon Jun 25, 2018 9:46 pm

Hey, I have a problem with my Pi 3+. I activated the VNC server and tried to connect to it on my tablet via the VNCViewer app. But when I am connected to it there is an error (see attachment).

What can I do to fix that?

The RPi must be set to boot to desktop (service mode). If a HDMI monitor is not attached then you need to specify a screen resolution in config.txt Use GUI config tool or sudo raspi-config to do that.

If not booting to desktop then you need to use virtual mode. (Run vncserver from the command line).

Where is the example for the config.txt?

Whoever put his meth-face on as profile picture should get banned. not the humourous signature.

Man in a van Posts: 328 Joined: Sat Dec 27, 2014 2:41 pm Location: Staffordshire, UK.

Thu Jun 27, 2019 10:51 am

seandex wrote: ↑

Thu Jun 27, 2019 7:46 am

klricks wrote: ↑

Tue Jun 26, 2018 1:23 am

waayne wrote: ↑

Mon Jun 25, 2018 9:46 pm

Hey, I have a problem with my Pi 3+. I activated the VNC server and tried to connect to it on my tablet via the VNCViewer app. But when I am connected to it there is an error (see attachment).

What can I do to fix that?

The RPi must be set to boot to desktop (service mode). If a HDMI monitor is not attached then you need to specify a screen resolution in config.txt Use GUI config tool or sudo raspi-config to do that.

If not booting to desktop then you need to use virtual mode. (Run vncserver from the command line).

Where is the example for the config.txt?

Code: Select all

sudo raspi-config

Select 7 Advanced Operations

Select 5 Resolution

Andyroo

Thu Jun 27, 2019 11:27 am

The entries in config.txt are three lines

Code: Select all

# uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 # uncomment to force a specific HDMI mode (this will force VGA) hdmi_group=2 hdmi_mode=35

But the values differ depending on the mode and are set by lines 1539 onwards of raspi-config (as of the time of this posting). BUT it is getting more complex with additions for the Pi 4 (HDMI vs Composite) so I would just follow Man in a vans process above

I cannot remember if the GUI version of the configuration tool has resolution controls and the Pi computers I can get to at the mo are running Lite.

Shad0w1and Posts: 1 Joined: Fri Jul 05, 2019 12:07 am

Fri Jul 05, 2019 12:09 am

Man in a van wrote: ↑

Thu Jun 27, 2019 10:51 am

seandex wrote: ↑

Thu Jun 27, 2019 7:46 am

klricks wrote: ↑

Tue Jun 26, 2018 1:23 am

The RPi must be set to boot to desktop (service mode). If a HDMI monitor is not attached then you need to specify a screen resolution in config.txt Use GUI config tool or sudo raspi-config to do that.

If not booting to desktop then you need to use virtual mode. (Run vncserver from the command line).

Where is the example for the config.txt?

Code: Select all

sudo raspi-config

Select 7 Advanced Operations

Select 5 Resolution

Thanks, this worked for me!

gufronra Posts: 1 Joined: Thu Aug 29, 2019 1:03 am

Thu Aug 29, 2019 1:10 am

I had the same problem. just reboot your raspberry (don't close vnc session that show black screen "Cannot currently show the desktop") and wait a minute till raspberry full loaded the desktop

Vnc raspberry cannot currently show the desktop

The German Posts: 11 Joined: Sun Feb 08, 2015 9:49 pm

Sun Sep 08, 2019 11:35 pm

I could not switch away from GNOME to KDE or another desktop, the automatic logon did not work anymore and VNC never worked after the initial installation and updates. I like to tinker, but "Buster" is a piece of crap that should not have been released with all the bugs and incompatibilities. The PI 4 is pretty much useless to me as there is no real compatible and stable OS. Disappointing.

ohilton576 Posts: 1 Joined: Sun Sep 29, 2019 8:12 pm

Sun Sep 29, 2019 8:14 pm

Why are you trying to use VNC anyway?
I found that good old windows RDP (Remote Desktop) works just fine. Use port 3389. Sorted. No need for any additional apps like vnc or anydesk.

ahammedx007 Posts: 1 Joined: Thu Oct 10, 2019 11:10 am

Thu Oct 10, 2019 11:16 am

Code: Select all sudo raspi-config Select 7 Advanced Operations Then Select 5 Resolution

Thanks, this worked for me!

Return to “Troubleshooting”