pinion
Posts: 18
Joined: Thu Jun 26, 2014 11:07 pm

VNC viewing or RPi prompt from Windows

Sun Jan 06, 2019 10:18 pm

Hi,

Got an RPi3 with Raspian Stretch hooked up to a monitor with HDMI, works fine with sound.

I installed Real VNC server and client on the RPi and a client on Windows using the typical install. I can remote into the Pi with VNC when it's in desktop mode but when I boot into terminal I cannot VNC in, I only get a black screen.
I can SSH into the Pi from windows with Putty and can issue commands, I just can't seem to get VNC to connect when the Pi is at CLI prompt.
Is VNC only for desktop sessions? I had a look around the web but can't see this called out anywhere.

Any help is appreciated. Thank you.

fruitoftheloom
Posts: 20194
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: VNC viewing or RPi prompt from Windows

Sun Jan 06, 2019 10:25 pm

pinion wrote:
Sun Jan 06, 2019 10:18 pm
Hi,

Got an RPi3 with Raspian Stretch hooked up to a monitor with HDMI, works fine with sound.

I installed Real VNC server and client on the RPi and a client on Windows using the typical install. I can remote into the Pi with VNC when it's in desktop mode but when I boot into terminal I cannot VNC in, I only get a black screen.
I can SSH into the Pi from windows with Putty and can issue commands, I just can't seem to get VNC to connect when the Pi is at CLI prompt.
Is VNC only for desktop sessions? I had a look around the web but can't see this called out anywhere.

Any help is appreciated. Thank you.

""Creating and remoting a virtual desktop""

https://www.realvnc.com/en/connect/docs ... ect-direct
adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

pinion
Posts: 18
Joined: Thu Jun 26, 2014 11:07 pm

Re: VNC viewing or RPi prompt from Windows

Sun Jan 06, 2019 11:12 pm

Thank you fruitoftheloom. That was the same KB I used to install VNC,
When I start the VNC server on the Pi it lists session :1 when I browse to session 1 with the VNC viewer I get the desktop, without the session ID I get a black screen.
Using who -u on the Pi I have two sessions:
pi tty7
pi tty1

session 7 refuses connection, session 1 gives me the desktop despite the Pi being at command prompt in the HDMI monitor.

I should probably add, this Pi has an retropie installation, where that install/script launches to LDXE but defaults down to terminal.
Thank you.

mattmiller
Posts: 2083
Joined: Thu Feb 05, 2015 11:25 pm

Re: VNC viewing or RPi prompt from Windows

Mon Jan 07, 2019 7:26 am

Is VNC only for desktop sessions?
Yes

pinion
Posts: 18
Joined: Thu Jun 26, 2014 11:07 pm

Re: VNC viewing or RPi prompt from Windows

Mon Jan 07, 2019 9:00 pm

Ah okay, thanks for that.

User avatar
sconemad
Posts: 228
Joined: Thu Apr 28, 2016 1:47 pm
Location: Cambridge, UK
Contact: Website

Re: VNC viewing or RPi prompt from Windows

Mon Jan 07, 2019 10:08 pm

mattmiller wrote:
Mon Jan 07, 2019 7:26 am
Is VNC only for desktop sessions?
Yes
Normally yes, VNC servers on Linux typically rely on the X window system to provide remote access to a desktop session.

However, the RealVNC Server on the Pi has a special mode which allows access to the system at the console, without X running. It also allows you to see content that is rendered directly by the GPU, such as Minecraft, the camera preview, and the power and overheat warning symbols.

This isn't enabled by default - to enable it go to the VNC Server options dialog and check "enable experimental direct capture" on the Troubleshooting page. Or, if you don't have a desktop running, you can do this at the command line by editing /root/.vnc/config.d/vncserver-x11 and adding/editing the line:

Code: Select all

CaptureTech=raspi
Hope this helps!

taylorkh
Posts: 104
Joined: Mon Nov 20, 2017 7:57 pm

Re: VNC viewing or RPi prompt from Windows

Tue Jan 08, 2019 6:02 pm

There are a couple of approaches to remote computing - philosophically speaking. "Share my Desktop" i.e. see what you would see when you logon locally to the remote computer with a physical monitor etc. and "Connect to a session on the host "- like a REAL (mainframe) computer :D I have generally taken the second approach. I have several Pi computers running Ubuntu Mate. I run vnc4server on them. To configure them I do the following:

1- install vnc4server
2 - in a terminal run vncserver - this prompts me for a password to protect connection and creates ~/.vnv/xstartup
3 - The xstartup might or might not work. I replace mine with

Code: Select all

[email protected]:~/.vnc$ cat xstartup 
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
i[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
mate-session &
mate-panel &
With Raspian it will be different but if you start with the default file created the first time you run this may provide some hints.
4 - In order to launch the vnc session on the host I have a scrip which does the following

Code: Select all

[email protected]:~/bin$ cat desk.sh
#!/bin/bash
vncserver -kill :1
vncserver :1 -geometry 1600x900 -depth 16
4 - I then connect from my CentOS workstation using the vinagre viewer with the host address in this case t21:1 representing session 1 on host computer 21. The user running the session on the host is me, ken.
NOTE: Just disconnecting will leave the session running on the host. It is protected by requiring a password but it does consume some resources. You can kill it over ssh using the first line of my script.

I can of course configure and run sessions for other users and access them concurrently thus my saying this is like connecting to a REAL computer :D

I hope this provides some help. As far as what SHOULD be in the xstartup file... It is sort of like JCL on MVS. I have only known 3 persons who COULD write a JCL job from scratch and only one who WOULD. Everyone else simply took someone else's job and modified it. I guess there is someone who could write an xstartup file but it is not me :lol:

Ken

User avatar
rin67630
Posts: 399
Joined: Fri Mar 04, 2016 10:15 am

Re: VNC viewing or RPi prompt from Windows

Tue Jan 08, 2019 9:54 pm

pinion wrote:
Sun Jan 06, 2019 10:18 pm
Is VNC only for desktop sessions?
Yes VNC is video from the desktop.
But you can run the terminal from there...

Return to “Troubleshooting”