# Processing-java hanging in headless VM

**URL:** <https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835>\
**Category:** Processing\
**Created:** [February 5, 2023, 5:39pm UTC](https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835 "2023-02-05T17:39:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvbl](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dvbl](https://discourse.processing.org/u/dvbl)\
**Post date:** [February 5, 2023, 5:39pm UTC](https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835/1 "2023-02-05T17:39:41Z")

</div>

Hello there!

I’m running Processing in a fairly esoteric environment, and trying to figure out why it isn’t running.

For context; I’ve got a simple Processing program (though this is reproducible even with a blank/minimal sketchbook) that just writes an image out to a file. It works when I run it locally, it works when I run it in a Docker environment ([headless, roughly following these instructions](https://github.com/processing/processing/wiki/Running-without-a-Display)), but it doesn’t work in a small headless VM that closely resembles the Docker container.

The VM environment is just a minimal Linux kernel with all the same libraries installed as the (functional) Docker container. I assume I’m breaking some invariant about Processing’s expected runtime, but I don’t know where to begin debugging because `processing-java` doesn’t crash, it just hangs indefinitely. No print statements from my sketchbook are executed or anything.

The invocation is:

```auto
xvfb-run /processing/processing-4.1.2/processing-java --sketch=/path/to/sketch --run <some args>

```

And this runs fine on my laptop and in the Docker container. Any ideas?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dvbl](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dvbl](https://discourse.processing.org/u/dvbl)\
**Post date:** [February 5, 2023, 5:42pm UTC](https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835/2 "2023-02-05T17:42:56Z")

</div>

An update: Could it be that `processing-java` is expecting to have internet access? The VM in question does not have a path to the internet.

---

<div class="post-metadata">

**Author:** ![dvbl](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dvbl](https://discourse.processing.org/u/dvbl)\
**Post date:** [February 5, 2023, 6:00pm UTC](https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835/3 "2023-02-05T18:00:59Z")

</div>

Another update: I ran `strace` to check for network traffic with:

```auto
strace -f -e trace=network -s 10000 ./processing-java --sketch=/path/to/sketch --run > strace.log 2>&1

```

And there’s a ton of network stuff going on. Is there anyway to run Processing in an environment with no network?

---

<div class="post-metadata">

**Author:** ![th75](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@th75](https://discourse.processing.org/u/th75)\
**Post date:** [February 9, 2023, 10:06pm UTC](https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835/4 "2023-02-09T22:06:03Z")

</div>

hi,

i guess the problem is headless rather than lack of network, even by default (no size() set) processing set a graphic window.  
on headless linux you can add a fake screen like xvfb ( i think i used this one years ago with same problem)

---

<div class="post-metadata">

**Author:** ![dvbl](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dvbl](https://discourse.processing.org/u/dvbl)\
**Post date:** [February 10, 2023, 12:14am UTC](https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835/5 "2023-02-10T00:14:49Z")

</div>

I was experiencing this issue even with `Xvfb`, and it worked fine in the Docker container (with `Xvfb`). The issue went away when I added a network interface to the VM. Not sure why that made a difference, but it no longer hangs, so I’m happy!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [February 10, 2023, 12:19am UTC](https://discourse.processing.org/t/processing-java-hanging-in-headless-vm/40835/6 "2023-02-10T00:19:32Z")

</div>

> [@dvbl](#):
>
> I added a network interface to the VM. Not sure why that made a difference,

Processing’s IDE (PDE) requires a local network in order to communicate w/ a sketch app.
