I’m brand new to DietPi and I love the idea of it but I may be too new to Linux for it. When I VNC to my Pi with an HDMI connected to a monitor, I don’t have any problem getting a desktop (I installed Mate). When I do it without an HDMI connected I get “Cannot currently show the desktop”. I ran into this with Raspbian and all I had to do was select a monitor resolution in the raspi-config tool and then I could connect to a desktop via VNC. When I select a resolution in DietPi-Config → Display Options → Display Resolution, it doesn’t make a difference when I unplug the HDMI cable and reboot. I’m 100% sure this is user error but I really am stumped. Any help is appreciated.
I’m happy to get any other information that might be needed to answer this question.
Thanks!
Well, this is embarrassing. I promise I searched for this before but I found the answer only after posting a question.
In /DietPi/config.txt, un-remark:
hdmi_safe=1
Probably I don’t understood you question correctly but VNC has nothing to do with a connect monitor via HDMI or other resolution settings. For VNC you don’t need to install any desktop like Mate. It’s just needed to have a VNC server running and the appropriate VNC client software on your desktop computer.
How it works is described in this post
https://dietpi.com/forum/t/resolved-removing-diversion-of-boot-overlays-readme-err/74/1
Desktop resolution settings for VNC can be found in DietPi config file “/DietPi/dietpi.txt”
Check for section
#------------------------------------------------------------------------------------------------------
# D I E T - P I
# DietPi-Software settings
#------------------------------------------------------------------------------------------------------
there you will have
#VNC Server Options
SOFTWARE_VNCSERVER_WIDTH=1280
SOFTWARE_VNCSERVER_HEIGHT=720
SOFTWARE_VNCSERVER_DEPTH=16
nope, it’s not your fault. until i just recognized this happens even with e new install of the actual RPi Image .26 on a headless system.
bash startx will give you information that no screen can be found.
EDITH: i think you meant, that the vnc server can hold connections, but no desktop appearr.
EDITH2: adding :1 (like 192.168.0.2:1) to your VNC Server Connection will do the thing in a virtual desktop way)
!
grüße
big thanks!
Hi! I have the same problem!
I am new to rasperry, dietpi and linux.
Dietpi works great and everything works except real vnc without a monitor connected.
Can somebody explain for a noob like me what to do excactely?
I would like to connect via realvnc over the internet (not in the same network) and connect automatically to a virtual desktop.
Thank you very much!!
Hi,
what exactly is your issue? Usually VNC Server is working without any monitor attached. I have a RPi3B running in headless mode and I’m able to connect via VNC to it.
Hi,
Like described above in the first post:
A connection is possible but it says „can not currently show a desktop“.
When a monitor is connected: Working in direct mode (not as a virtual desktop).
When I add a virtual desktop manually with terminal it works only in my home network / connecting to the ip xxx.xxx.xxx.xxx:1
Rasperry pi 4 headless
Thank you!
Basically all is working as expected I would say. You have a VNC server running on your RPi and your are able to connect from local network using IP address xxx.xxx.xxx.xxx:1 correct?
To access VNC on a public network (e.g. the Internet), you must forward the appropriate ports through your router/firewall. The exact steps are based on your specific router model. Here’s a basic guide to port-forward VNC Ports:
- Find the local IP Address of your PRi running VNC Server
- Login to your router’s web interface (e.g. http://192.168.1.1)
- Find the “Port Forwarding” section of your router
- Create a new “Port Forwarding” rule
- Set the source and destination ports to TCP 5901
- Set the destination IP Address to the IP Address of your RPi (found in Step 1)
- Run the GRC ShieldsUP Port Scanner to see if the port is open and listening
Hi, thank you for your answer!
The problem is that i have to restart the virtual desktop after every reboot.
Can i change that?
Thank you!
Hi,
this I don’t understand. What you do you mean by
restart the virtual desktop after every reboot
After reboot the VNC Server is already restarted
Or do you mean that you would need to start the VNC service manual?
root@DietPi3:~# systemctl status vncserver
● vncserver.service - Manage VNC Server (DietPi)
Loaded: loaded (/etc/systemd/system/vncserver.service; enabled; vendor preset: enabled)
Active: active (exited) since Sun 2020-01-19 17:23:35 CET; 7min ago
Main PID: 612 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 2229)
Memory: 0B
CGroup: /system.slice/vncserver.service
Jan 19 17:23:35 DietPi3 systemd[1]: Started Manage VNC Server (DietPi).
Jan 19 17:23:35 DietPi3 systemd[612]: pam_unix(login:session): session opened for user root by (uid=0)
root@DietPi3:~#
pls can you restart your system and past the following output
systemctl status vncserver
lsof -iTCP -sTCP:LISTEN
if lsof is not installed, pls do before
G_AGI lsof
can you try to connect to your VNC server as follow
xxx.xxx.xxx.xxx:0
or just
xxx.xxx.xxx.xxx
Do you have autostart enabled for Desktop?
Hi,
works when the pi is connected to a monitor.
When not connected to a monitor the vcn-connection works but only shows: Cannot currently show the desktop.
Desktop autostart is enabeled.
pls disable Desktop autostart and set it back to 0 : Manual login (default)
what IP do you use to connect? I mean what do you enter in the VNC Client as VNC Server?
Working now…
I don’t know what changed!?
I can connect to xx.xx.xx.xx:1