[Lazarus] Lazarus on Ubuntu 18.04.4 via VNC cannot find utilities
Bo Berglund
bo.berglund at gmail.com
Mon May 25 12:18:50 CEST 2020
On Mon, 25 May 2020 09:13:42 +0200 (CEST), Michael Van Canneyt via
lazarus <lazarus at lists.lazarus-ide.org> wrote:
>
>
>On Mon, 25 May 2020, Bo Berglund via lazarus wrote:
>
>> On Mon, 25 May 2020 07:36:55 +0200 (CEST), Michael Van Canneyt via
>> lazarus <lazarus at lists.lazarus-ide.org> wrote:
>>
>>>
>>>
>>> On Sun, 24 May 2020, Bo Berglund via lazarus wrote:
>>>
>>>> Comment=Lazarus IDE 2.0.8
>>>> Terminal=false
>>>> Name=Lazarus 2.0.8
>>>> Exec=/home/bosse/dev/lazarus/2.0.8/startlazarus
>>>
>>> Set this to
>>> /bin/bash -l home/bosse/dev/lazarus/2.0.8/startlazarus --pcp=/home/bosse/.lazarus_2.0.8 %f
>>>
>>> and .profile will be read.
>>>
>>> I have a similar issue, and that is how I solved it.
>>>
>>>>
>>>> So I wonder if maybe Lazarus has a similar setting?
>>>
>>> No, you must set the options on the desktop/menu entry that starts lazarus.
>>>
>>>> Or maybe VNC server does?
>>>
>>> You must run lazarus not by directly running the startlazarus, but by
>>> invoking the shell with -l option. You can create a script for it.
>>>
>>> Michael.
>>
>> Something must have gone wrong here...
>> I changed the desktop file but no Lazarus showed up so I tried to run
>> the Exec command from a terminal instead:
>>
>> bosse at polaris-ubuntu:~$ /bin/bash -l
>> /home/bosse/dev/lazarus/2.0.8/startlazarus
>> --pcp=/home/bosse/.lazarus_2.0.8 %f
>
>You must omit the %f on the command line.
>
>What happens if you do
>
>/bin/bash -l -c '/home/bosse/dev/lazarus/2.0.8/startlazarus --pcp=/home/bosse/.lazarus_2.0.8'
>
Now Lazarus starts up with the project loaded and the compile and
build operations work OK! :)
How can I change the desktop files so they also work?
I tried to set the Exec like this (single line of course, newsreader
wraps..):
Exec=/bin/bash -l -c '/home/bosse/dev/lazarus/2.0.8/startlazarus
--pcp=/home/bosse/.lazarus_2.0.8'
Then Lazarus starts OK but again throws the error due to
/home/bosse/bin missing from PATH.
It seems like if one could set PATH correctly to include ~/bin for the
VNC environment all would be solved...
The VNC server is a service and is started via this file:
/etc/systemd/system/vncserver at .service
[Unit]
Description=Systemd VNC server startup script for Ubuntu 18.04
After=syslog.target network.target
[Service]
Type=forking
User=bosse
ExecStartPre=-/usr/bin/vncserver -kill :%i &> /dev/null
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1680x1040 :%i
PIDFile=/home/bosse/.vnc/%H:%i.pid
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
And I think that the content of this file is used as well:
/home/bosse/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP
Desktop" &
x-window-manager &
mate-session &
Finally, the VNC I am using was installed via
apt install vnc4server
Strange that I never ever saw this problem on Raspbian Buster on an
RPi4...
--
Bo Berglund
Developer in Sweden
More information about the lazarus
mailing list