VNC only Chromium

Hi,

Installing VNC propse to install a desktop manager, but I do not need it

Is it possible to have only chromium in kiosk mode instead of a full desktop with the VNC server?

Yes simply select Chromium. This will install all tools needed to run in kiosk mode.

Ok for Kiosk mode, but my RPI is headless and I want the kiosk mode only in VNC

If I try to install TigerVNC I have to select one desktop, not needed in my case
So I would like to remotly connect to my RPI and just have chromium not a full desktop
I’m not sure it is possible

Yes on VNC a desktop is needed

Ah actually it should work to run any X application in VNC. But so far we indeed pull a desktop as dependency.

Does this work?

mkdir /root/.vnc
echo -e '#!/bin/dash\nexec chromium-browser' > /root/.vnc/xstartup
chmod +x /root/.vnc/xstartup

yes it works but not in fullscreen, it seems to be in 800x600. How to change it?

see: https://dietpi.com/docs/software/remote_desktop/#realvnc-server

Resolution settings

The following shows an example how to run VNC server on screen :1 by creating a new desktop with 1280x720 resolution by editing /boot/dietpi.txt:

nano /boot/dietpi.txt

and change the following settings:

SOFTWARE_VNCSERVER_WIDTH=1280
SOFTWARE_VNCSERVER_HEIGHT=720
SOFTWARE_VNCSERVER_DEPTH=32
SOFTWARE_VNCSERVER_DISPLAY_INDEX=1

At last restart the service to activate the new settings:

systemctl restart vncserver

ok it changes the vnc resolution but not the chromium display
this one is still limited to a 800x600 area in the vnc desktop

Another option could be to use chromium with x11 forwarding
but can’t get it working I get “Missing X server or $DISPLAY”

This can be handled with the flags for chromium:
--window-size=x,y --window-position=x,y

1 Like

this would need to be set inside /root/.vnc/xstartup

works as expeted now with --window-size=1920,1080 --window-position=0,0

for ssh x11 forwarding do you have some tips for me to resolve the display ?

echo $DISPLAY is empty and if I export one I still have the issue

usually there is no active desktop running. VNC will just create one on demand, if I’m not mistaken.

Chromium does not start a desktop, but an X session, as a desktop does. I didn’t use SSH X11 forwarding since a longer time. You mean --window-size=1920,1080 doesn’t work on this case? Is it probably possible to define the (max) resolution in Xming/X server?

Sorry if it’s not clear

VNC desktop is running well, chromium only from vnc also running well with your help

I just try to setup X11 for another usecase, and it doesn’t work (mousepad for example)

You mean starting mousepad directly via VNC? Probably it makes sense to test first whether it starts well from console:

xinit mousepad

or

startx mousepad

Not sure whether some applications may require some more supporting environment.

no just start any apps from ssh terminal with x11 forwarding set in sshd config

mousepad was an example

➤ SSH session to dietpi@x.x.x.x
│ • Direct SSH : :heavy_check_mark:
│ • SSH compression : ✘
│ • SSH-browser : :heavy_check_mark:
│ • X11-forwarding : ✘ (disabled or not supported by server)

X11 forwarding is also enabled in sshd_config? It should be by default thought.

it was not enabled by default, I changed the settings in this file to enable it
but it is not enough to work

Finally get it working, the option “X11UseLocalhost no” must be added