4

I have a server running Ubuntu 14.04. I want to run a 3d modeling software on it. I will be sending some parameters based on which the software will automatically generate a model and send the data back. Throughout this process, I dont need to interact with the Gui of the software, but the software launches a GUI whenever its called.

Is there a way to run this without needing a display.

I have tried X11 forwarding, but that just launches the Gui on my local machine. I need a way in which the app runs fully on the server itself, without needing a display.

2 Answers 2

9

You will need Xvfb to virtualize a X11 server, so first do:

apt-get install xvfb 

You might also need these packages with xvfb:

sudo apt-get install x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps

Then you can run your app like this without any GUI:

Xvfb :19 -screen 0 1024x768x16 &
export DISPLAY=:19
myapp &
Sign up to request clarification or add additional context in comments.

1 Comment

Much easier than mine.
0

I have used a Xvnc server with a lightweight window manager to achieve something similar. Here is a setup that I have used. In my case I was running a Java program, so the last step might be different in your case.

Install Xvnc

Xvnc is a virtual framebuffer which can be used instead of real display (and mouse and keyboard). It also contains VNC server that allows to connect to the machine and see what it is displaying.

sudo apt-get install vnc4server

Install IceWM

IceWM is lightweight and the most stable window manager that I've tried. The default option couldn't run my app properly, but it might be good enough for you. Here are some others I tried:

  • matchbox-window-manager had an issue with mnemonics which I needed
  • fluxbox had an issue with some dialog windows

To install IceWM along with themes (not sure if themes are needed) using apt-get:

sudo apt-get install icewm icewm-themes

Xvnc must be configured to run this manager. Change (or create the file if does not exist) the configuration file on the home directory ~/.vnc/xstartup:. Again this depends on what you need.

#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
icewm &

Install required libraries used by your app

Java needed some libraries that I believe come with the X server. These can be easily installed by the following commands. Note: some of these libraries might have been installed while trying different window managers, but I installed them manually beforehand.

sudo apt-get install libxrender1
sudo apt-get install libxtst6
sudo apt-get install libxi6 libgconf-2-4

Running your app

First set a password for vncserver. The command will ask for a password and verification of the password.

vncpasswd

The real display is identified in linux by a number and this number is made available to applications through the DISPLAY env variable. Set up the display and vncserver using these commands:

vncserver :10 -depth 16 -geometry 1600x900

Depth and geometry are the color depth and resolution parameters of the display.

Set the DISPLAY property:

export DISPLAY=:10

Run the app. You can now connect to the vnc if you want to see it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.