# pvpython: bad X server connection

**URL:** https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849
**Category:** ParaView Support
**Tags:** opengl, python
**Created:** [November 5, 2018, 4:41pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849 "2018-11-05T16:41:15Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![cdoucet](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/779978/32.png) [@cdoucet](https://discourse.paraview.org/u/cdoucet)
#### Post date: [November 5, 2018, 4:41pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/1 "2018-11-05T16:41:15Z")

</div>

Hello,

I get the following error when I try to run a script with pvpython on a virtual machine (Ubuntu 16.04):

```
ERROR: In /build/paraview-arsa8T/paraview-5.0.1+dfsg1/VTK/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx, line 333
vtkXOpenGLRenderWindow (0x3acfad0): bad X server connection. DISPLAY=Aborted (core dumped)

```

The error disappears when I log on with “ssh -X” to the machine but it does not solve my problem because this machine is actually used as a slave for continuous integration of some code. I know that the problem comes from the fact that there is no X server on this machine. However, I do not know anything about X servers and how to configure them on Ubuntu systems. I looked for some documentation on the web. Then, I tried to install packages and use autoconfiguration commands but the error message is still here.

Do you know how to set up such a server for paraview on Ubuntu systems?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [November 5, 2018, 9:44pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/2 "2018-11-05T21:44:27Z")

</div>

What is the script doing that is causing a window to be required? It’d probably be easier to have a GUI-less ParaView build (no Qt) or to have it built to prefer offscreen rendering instead so it doesn’t need X at all.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [November 6, 2018, 1:22am UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/3 "2018-11-06T01:22:54Z")

</div>

If you don’t want to install an X server, you can use a binary of ParaView built against `osmesa`. We are going to produce official release binaries built against `osmesa` starting with ParaView 5.6. Using this build does away with the need for an X server.

Our nightly builds for this package are down for the moment, otherwise, I would point you to one to try out.

---

<div class="post-metadata">

### Author: ![cdoucet](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/779978/32.png) [@cdoucet](https://discourse.paraview.org/u/cdoucet)
#### Post date: [November 6, 2018, 1:55pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/4 "2018-11-06T13:55:27Z")

</div>

Thank you very much for your answers.

I did not know that it was possible to run paraview without any X server. I will try to build my own version with osmesa.

As I did not write the script myself, I cannot tell if opening a window is required in my case because I only used Paraview GUI by the past, not Python API. I only know that the goal of the script is to generate an image (to be inserted in a documentation) by post-processing some results coming from a numerical simulation (computational fluid dynamics). Theoretically speaking, I would say that it could be possible to generate such an image without opening any window but I cannot be sure about that.

Here are the main script (postpro\_lagrangian.py) and its subscript (postpro\_settling.py) if you have any advice about them.

[postpro\_lagrangian.py](https://discourse.paraview.org/uploads/default/original/1X/e619d24ba5f7da5a6f1d6dc8cc218c468d755a29.py) (5.6 KB)  
[postpro\_settling.py](https://discourse.paraview.org/uploads/default/original/1X/5fc3c320485b83c86d4b5aa4bc574ab486d50ad8.py) (2.7 KB)

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [November 6, 2018, 2:29pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/5 "2018-11-06T14:29:30Z")

</div>

An X server is required for all ParaView packages _except_ the osmesa package, even if offscreen rendering is used and no window is opened. This is because most OpenGL applications on linux still depend on X to draw anything, even if no window appears.

There is a binary available [here](https://open.cdash.org/viewFiles.php?buildid=5615426), but it will disappear in about 24 hours as disk space is reclaimed, so if you want it download it quick.

---

<div class="post-metadata">

### Author: ![cdoucet](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/779978/32.png) [@cdoucet](https://discourse.paraview.org/u/cdoucet)
#### Post date: [November 6, 2018, 2:35pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/6 "2018-11-06T14:35:05Z")

</div>

Thank you very much. I will download it now and try to use it to see if it solves my problem.

---

<div class="post-metadata">

### Author: ![cdoucet](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/779978/32.png) [@cdoucet](https://discourse.paraview.org/u/cdoucet)
#### Post date: [November 6, 2018, 3:49pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/7 "2018-11-06T15:49:23Z")

</div>

It works fine. Thank you very much for your precious help!

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [November 6, 2018, 3:56pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/8 "2018-11-06T15:56:32Z")

</div>

Fantastic, I am glad it is working.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [November 9, 2018, 4:28pm UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/9 "2018-11-09T16:28:47Z")

</div>

By the way, the ParaView 5.6.0 build with osmesa is now available at [www.paraview.org/download](http://www.paraview.org/download).

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 12, 2024, 11:27am UTC](https://discourse.paraview.org/t/pvpython-bad-x-server-connection/849/10 "2024-08-12T11:27:39Z")

</div>

A post was split to a new topic: [Issue with X server connection](https://discourse.paraview.org/t/issue-with-x-server-connection/15212)
