# Can WriteImage/SaveScreentshot API run normally on Linux OS without GUI?

**URL:** https://discourse.paraview.org/t/can-writeimage-savescreentshot-api-run-normally-on-linux-os-without-gui/4778
**Category:** Development
**Tags:** python
**Created:** [July 8, 2020, 9:41am UTC](https://discourse.paraview.org/t/can-writeimage-savescreentshot-api-run-normally-on-linux-os-without-gui/4778 "2020-07-08T09:41:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Superstarimage](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/977dab/32.png) [@Superstarimage](https://discourse.paraview.org/u/Superstarimage)
#### Post date: [July 8, 2020, 9:41am UTC](https://discourse.paraview.org/t/can-writeimage-savescreentshot-api-run-normally-on-linux-os-without-gui/4778/1 "2020-07-08T09:41:32Z")

</div>

Dear ALL,  
I meet several errors when run WriteImage/SaveScreentshot API on Linux OS **without GUI**. I want to hold the picture when rendering job is done. But my work operation system(centos 7.x) doesn’t install GUI. So I can’t use render() command in pvpython. Is there anyone knowing how to due with this situation? GUI is ordered not to be install cause I am using a public hpc workstation.  
Thank you very much.

Youxin.

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [July 9, 2020, 4:43pm UTC](https://discourse.paraview.org/t/can-writeimage-savescreentshot-api-run-normally-on-linux-os-without-gui/4778/2 "2020-07-09T16:43:45Z")

</div>

I’m not sure what you mean by “hold the picture” but you can still render and save screenshots as long as you have software-based rendering enabled on that workstation.

Try passing the `--force-offscreen-rendering` flag to pvpython

If that doesn’t work maybe you have to tell ParaView to use the software-based rendering like:  
`paraview-mesa pvpython --backend llvmpipe -- --force-offscreen-rendering script.py`  
or something like that. The extra `--` is necessary.

Note that this is for PV5.7+, I think for earlier it would be:  
`pvpython --mesa-llvm --force-offscreen-rendering script.py`

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 9, 2020, 5:10pm UTC](https://discourse.paraview.org/t/can-writeimage-savescreentshot-api-run-normally-on-linux-os-without-gui/4778/3 "2020-07-09T17:10:16Z")

</div>

My suspicion is that you’re getting X-related errors since you don’t have an Xserver running on the HPC system. Where did you get the ParaView binaries from? If from [paraview.org](http://paraview.org), try using the osmesa variant of the binaries – these are the binaries under the category “ParaView Server for Headless Machines”.

---

<div class="post-metadata">

### Author: ![Superstarimage](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/977dab/32.png) [@Superstarimage](https://discourse.paraview.org/u/Superstarimage)
#### Post date: [July 10, 2020, 4:29am UTC](https://discourse.paraview.org/t/can-writeimage-savescreentshot-api-run-normally-on-linux-os-without-gui/4778/4 "2020-07-10T04:29:18Z")

</div>

Thank you, Utkarsh! With the “ParaView Server for Headless Machines” paraview project, I successfully run the render() api and save the screenshot finally.  
Thank you a lot!

Youxin.

---

<div class="post-metadata">

### Author: ![Superstarimage](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/977dab/32.png) [@Superstarimage](https://discourse.paraview.org/u/Superstarimage)
#### Post date: [July 10, 2020, 4:31am UTC](https://discourse.paraview.org/t/can-writeimage-savescreentshot-api-run-normally-on-linux-os-without-gui/4778/5 "2020-07-10T04:31:23Z")

</div>

Hi, Theodore,  
Thank you for your usefull help! Now I have figured out my problem by using the “ParaView Server for Headless Machines” paraview project.  
You are really nice. Thank you very much!

Youxin.
