6

So, the problem is as follows: To quote emg from raspberry pi forums, I've installed x11vnc and set it up like this:

- sudo apt-get install x11vnc
- x11vnc -storepasswd

create autostart entry
- cd .config
- mkdir autostart
- cd autostart
- nano x11vnc.desktop
- paste following text:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer
StartupNotify=false
Terminal=false
Hidden=false

After doing that, vnc finally works and displays what is on the main display. However, when I'm running it without HDMI cable connected, it sets itself to an awkward 656x416 resolution.

How can I force another resolution to be used when HDMI is not connected?

5 Answers 5

6

From this Raspberry Pi forum post:

In /boot/config.txt, I set

hdmi_force_hotplug=1

and

hdmi_group=2 hdmi_mode=16 (1024x768@60Hz)

Then I ran x11vnc with -configure 1024x600, which is the resolution of my netbook screen


If you cannot get that to work, I would recommend using a different VNC server altogether. The one I use is TightVNC, and it works very well.

To install:

$ sudo apt-get install tightvncserver
$ vncserver :1 -geometry 1920x1080 -depth 24
6

Set or uncomment, the following lines, in /boot/config.txt

hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=16 # (or any other pi resolution you want, 16 is for 1080p)

Reboot your Pi (sudo reboot)

and done!

0
1

I added the following lines to my config.txt file in /boot.

# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=82
#hdmi_safe=1

This forces the headless pi to 1080p. I've seen other similar posts but this is what is working for me.

look at these settings for other resolutions: https://www.raspberrypi.org/documentation/configuration/config-txt.md

0

This may only be indirectly applicable to your case, but if you are using a raspberry pi with a kali linux image (XFCE desktop) and the config.txt file does not exist, create it using "nano /boot/config.txt" (you may need to add sudo in front of that if you are not logged in as root) and add the following two lines: (from a post by apb2006 re:config.txt - see original file call outs) I have used this on several different implementations on raspPi with success.

framebuffer_width=1280

framebuffer_height=720

Complete the edit using [Ctrl][O}, press enter to save the file, then [Ctrl][x] to exit the editor. Reboot the raspberry pi. Your remote desktop will now be 1280x720. A side affect is the local (HDMI connected) desktop may also be limited to this resolution).

0

I stumbled over similar issue when setting up RasPad. Trying to select a particular HDMI mode and to enforce hotplug or similar didn't help. In my case, the cause was obviously related to an additional driver set up in the /boot/config.txt file.

I found these lines:

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

and changed them to this:

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
#max_framebuffers=2

After next reboot display size was detected properly, even without selecting some HDMI mode in particular.

There is only one thing I don't understand. Next to the failing RasPad there is a second one and that one has those lines enabled while resolution is picked properly. So this isn't the end of the journey apparently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.