Startup commands

147 views
Skip to first unread message

3be...@gmail.com

unread,
Apr 15, 2018, 3:50:12 PM4/15/18
to TigerVNC User Discussion/Support
I am trying to get vncserver to run some commands when it starts up. If I create a ~/.xsession file, the vncserver command fails (even if .xsession is empty) but any commands in .xsession run. If I create a ~/.vnc/xstartup file, vncserver declares success and the commands in xstartup run, but I get a black screen when I connect with a viewer. I am on the latest Raspbian. Any suggestions?

Pierre Ossman

unread,
Apr 18, 2018, 2:01:38 AM4/18/18
to 3be...@gmail.com, TigerVNC User Discussion/Support
On 15/04/18 21:50, 3be...@gmail.com wrote:
> I am trying to get vncserver to run some commands when it starts up. If I create a ~/.xsession file, the vncserver command fails (even if .xsession is empty) but any commands in .xsession run. If I create a ~/.vnc/xstartup file, vncserver declares success and the commands in xstartup run, but I get a black screen when I connect with a viewer. I am on the latest Raspbian. Any suggestions?
>

How exactly does your startup file look? Those files you've named is the
only thing that will be executed for your session, not just extra
commands. So if you don't have a desktop environment in there then
you'll just get a black screen.

Regards
--
Pierre Ossman Software Development
Cendio AB http://cendio.com
Teknikringen 8 http://twitter.com/ThinLinc
583 30 Linköping http://facebook.com/ThinLinc
Phone: +46-13-214600 http://plus.google.com/+CendioThinLinc

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Jeffrey Barish

unread,
Apr 27, 2018, 5:38:27 PM4/27/18
to Pierre Ossman, TigerVNC User Discussion/Support

On Wednesday, 18 April 2018 00:01:35 MDT Pierre Ossman wrote:

> On 15/04/18 21:50, 3be...@gmail.com wrote:

> > I am trying to get vncserver to run some commands when it starts up. If I

> > create a ~/.xsession file, the vncserver command fails (even if .xsession

> > is empty) but any commands in .xsession run. If I create a

> > ~/.vnc/xstartup file, vncserver declares success and the commands in

> > xstartup run, but I get a black screen when I connect with a viewer. I

> > am on the latest Raspbian. Any suggestions?

 

> How exactly does your startup file look? Those files you've named is the

> only thing that will be executed for your session, not just extra

> commands. So if you don't have a desktop environment in there then

> you'll just get a black screen.

 

I already had an autostart in ~/.config/lxsessions/LXDE-pi/ that was doing a perfectly fine job of starting the session, so I figured that ~/.vnc/xstartup should contain the one additional program I want to autostart when vncserver runs. I understand from your reply that if ~/.vnc/xstartup exists, then autostart is not run, so I need to duplicate the commands in autostart in xstartup. Doing so almost works: I am not getting the black screen anymore. However, my application appears to be mostly offscreen below and to the right of the bottom right corner and its window lacks decoration. Also, I don't get a pointer until I open a terminal window, at which point I get the X pointer.

 

Here's what I have in xstartup now:

 

lxpanel --profile LXDE-pi
pcmanfm --desktop --profile LXDE-pi
xscreensaver -no-splash
point-rpi
<my_app>

 

I lifted the first 4 lines from autostart.

Pierre Ossman

unread,
May 2, 2018, 5:18:41 AM5/2/18
to Jeffrey Barish, TigerVNC User Discussion/Support
On 27/04/18 23:38, Jeffrey Barish wrote:
>
> I already had an autostart in ~/.config/lxsessions/LXDE-pi/ that was doing a perfectly fine
> job of starting the session, so I figured that ~/.vnc/xstartup should contain the one
> additional program I want to autostart when vncserver runs. I understand from your reply
> that if ~/.vnc/xstartup exists, then autostart is not run, so I need to duplicate the
> commands in autostart in xstartup. Doing so almost works: I am not getting the black
> screen anymore. However, my application appears to be mostly offscreen below and to
> the right of the bottom right corner and its window lacks decoration. Also, I don't get a
> pointer until I open a terminal window, at which point I get the X pointer.
>

Autostart is a completely different mechanism that is handled by your
desktop environment (LXDE in this case). It should work fine with
TigerVNC as well.

> Here's what I have in xstartup now:
>
> lxpanel --profile LXDE-pi
>

This doesn't seem like the correct command to start LXDE. AFAIK you
should call startlxde.

Regards
--
Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600 https://plus.google.com/+CendioThinLinc
Reply all
Reply to author
Forward
0 new messages