Page 1 of 3

VNC GUI

Posted: Sun Dec 29, 2019 3:21 am
by hua5e34qhuae
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!

Re: VNC GUI

Posted: Sun Dec 29, 2019 3:43 am
by hua5e34qhuae
Well, this is embarrassing. I promise I searched for this before but I found the answer only after posting a question. :roll:

In /DietPi/config.txt, un-remark:

hdmi_safe=1

Re: VNC GUI

Posted: Sun Dec 29, 2019 11:23 am
by Joulinar
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
viewtopic.php?f=8&t=5&start=80#p4149

Desktop resolution settings for VNC can be found in DietPi config file "/DietPi/dietpi.txt"

Check for section

Code: Select all

#------------------------------------------------------------------------------------------------------
# D I E T - P I
# DietPi-Software settings
#------------------------------------------------------------------------------------------------------
there you will have

Code: Select all

#VNC Server Options
SOFTWARE_VNCSERVER_WIDTH=1280
SOFTWARE_VNCSERVER_HEIGHT=720
SOFTWARE_VNCSERVER_DEPTH=16

Re: VNC GUI

Posted: Sun Dec 29, 2019 7:40 pm
by killakuh
hua5e34qhuae wrote:
Sun Dec 29, 2019 3:21 am
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.
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

Re: VNC GUI

Posted: Sun Dec 29, 2019 7:48 pm
by killakuh
hua5e34qhuae wrote:
Sun Dec 29, 2019 3:43 am
Well, this is embarrassing. I promise I searched for this before but I found the answer only after posting a question. :roll:

In /DietPi/config.txt, un-remark:

hdmi_safe=1
big thanks!

Re: VNC GUI

Posted: Sun Jan 19, 2020 1:08 am
by Len
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!!
:)

Re: VNC GUI

Posted: Sun Jan 19, 2020 1:39 am
by Joulinar
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.

Re: VNC GUI

Posted: Sun Jan 19, 2020 3:24 am
by Len
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!

Re: VNC GUI

Posted: Sun Jan 19, 2020 4:07 pm
by Joulinar
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:
  1. Find the local IP Address of your PRi running VNC Server
  2. Login to your router’s web interface (e.g. http://192.168.1.1)
  3. Find the “Port Forwarding” section of your router
  4. 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)
  5. Run the GRC ShieldsUP Port Scanner to see if the port is open and listening

Re: VNC GUI

Posted: Sun Jan 19, 2020 4:12 pm
by Len
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! :)