Error constructing proxy for org.gnome.Terminal...

Error constructing proxy for org.gnome.Terminal...

by Andrew Rowatt -
Number of replies: 6
Picture of Plugin developers
Hi All, I'm a complete newbie to VPL and have been asked to investigate using it for students to practice using "R" for a data analytics class. I've installed the plugin on a local install of Moodle 4.1[.19+] (we are moving to Moodle 4.5 at the end of the year). I've installed the docker version of jail-server: https://hub.docker.com/r/jcrodriguezvpl/jail-ubuntu-full Using: docker run -d --name mod_vpl-jail -p 8080:80 -e VPL_JAIL_SECURE_PORT=0 jcrodriguezvpl/jail-ubuntu-full (Note that HTTPS has been disabled using VPL_JAIL_SECURE_PORT=0) This is on a Digital Ocean droplet running Ubuntu 20.04.6 LTS (with all packages up to date). http:///ok returns OK. At the Moodle end, I have setup a basic VPL activity using the defaults except setting Execution options -> Run to Yes. When I use a simple .php file, it runs ok. See SS01. When I use a simple R file, it does not. See SS02. I'm very out of my depth, so I'm hoping some kind soul can help smile Kind regards, Andrew (Massey University, New Zealand)
Attachment SS01 - 2025-07-09_21-39-45.png
Attachment SS02 - 2025-07-09_21-42-19.png
Average of ratings: -
In reply to Andrew Rowatt

Error constructing proxy for org.gnome.Terminal...

by Garth Brady -
Picture of Particularly helpful Moodlers
Hi there,
Did you try running your scripts on the default Jail server to see if this is a config issue?
In reply to Garth Brady

Error constructing proxy for org.gnome.Terminal...

by Andrew Rowatt -
Picture of Plugin developers

Hi Garth,

For both the php file I get the blue window (same as first post). For the r test file I get a terminal window (attached).

No obvious error messages.

I hope you can help me further.

Kind regards,
   Andrew

Attachment SS03 - 2025-07-14_16-48-56.png
In reply to Andrew Rowatt

Error constructing proxy for org.gnome.Terminal...

by Garth Brady -
Picture of Particularly helpful Moodlers

Can you please share the code you’re using to test the R file?

In reply to Garth Brady

Error constructing proxy for org.gnome.Terminal...

by Andrew Rowatt -
Picture of Plugin developers

Hi Garth,

Thanks for sticking with me. Apologies again for being so inept! The code is simply:

print("Hello World!")

(from here: https://www.datamentor.io/r-programming/examples/hello-world)

Kind regards,
   Andrew

P.S. I've also included a screenshot showing the output from the built-in Check execution servers tool.

Attachment SS04 - 2025-07-15_12-17-04.png
In reply to Andrew Rowatt

Error constructing proxy for org.gnome.Terminal...

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Andrew and Garth,

Thank you for your detailed message and for testing VPL with R on the Docker-based jail server. I’ve tried to reproduce your issue using the Docker image jcrodriguezvpl/jail-ubuntu-full, but so far, I haven’t encountered the same problem.

The message you're seeing — Error constructing proxy for org.gnome.Terminal — appears to be related not to VPL itself, but to the container’s graphical environment or its resource constraints.


Running R in VPL 4.3.2

With the release of VPL 4.3.2, we have simplified R integration by using VPL’s new running modes. These allow better control over how R scripts are executed, especially in text mode or GUI terminal environments.

As you may know, the R tool is based on a REPL (Read-Eval-Print Loop) interface, which complicates direct integration with VPL. After exploring various approaches, the latest solution uses Rscript, which is better suited for automated/scripted execution.

Here's how R execution works using Rscript in VPL 4.3.2:

  • The first .R file in the student submission is run using Rscript --vanilla.
  • Since Rscript is not interactive, you need to:

    • Use readLines(file("stdin"), n = 1) to read input.
    • To display charts:

    Save them as image files using png("file.png") or jpeg("file.jpg"). Generate the image, chart, etc. Close the graphics device using dev.off(). Show the image with an external viewer using:

    r system("nohup xdg-open file.png &")

    (Note: This need a text in GUI run mode)


Suggested Setup (if not using VPL 4.3.2)

If you're not yet on VPL 4.3.2, you can configure R execution manually by using the following vpl_run.sh script in "execution files" for text-only mode:

#!/bin/bash
# Script for running R in VPL
. common_script.sh
check_program R
get_first_source_file r R
cat common_script.sh > vpl_execution
echo "Rscript --vanilla \"$FIRST_SOURCE_FILE\"" >> vpl_execution
chmod +x vpl_execution

To run in a GUI terminal (text in GUI mode), you may add to the previous vpl_run.sh:

mv vpl_execution vpl_execution_in_gui
cat common_script.sh > vpl_wexecution
cat <<'END_SCRIPT' >> vpl_wexecution
if command -v gnome-terminal &> /dev/null; then
    gnome-terminal -- bash -c "./vpl_execution_in_gui; echo; read -p 'Press Enter to continue...'"
elif command -v xterm &> /dev/null; then
    xterm -e bash -c "./vpl_execution_in_gui; echo; read -p 'Press Enter to continue...'"
elif command -v konsole &> /dev/null; then
    konsole --noclose -e "./vpl_execution_in_gui"
elif command -v xfce4-terminal &> /dev/null; then
    xfce4-terminal --hold --command="./vpl_execution_in_gui"
else
    echo "No terminal emulator found. Running without GUI terminal."
    ./vpl_execution_in_gui
fi
wait_end vpl_execution_in_gui
END_SCRIPT
chmod +x vpl_wexecution

Best regards, Juan Carlos Rodríguez

In reply to Juan Carlos Rodríguez-del-Pino

Success!! Error constructing proxy for org.gnome.Terminal...

by Andrew Rowatt -
Picture of Plugin developers

Success!!

I updated the plugin (to tag V4.3.2), added a new Virtual programming lab activity using the defaults, and it worked!

It run in the "blue" window (like PHP) so I guess that is "text mode". (Thanks Juan Carlos for your comment re the gnome issue not being related to VPL itself - that is very useful info).

So, for now, I am up and running.

Thank you all!

Attachment SS05 - 2025-07-16_09-00-19.png