Xvfb failed start error - linux

I have Ubuntu 11.04
I am trying to install Xvfb and CutyCapt in order to take a snapshot of webpage
I followed a instruction https://github.com/jaequery/cutycapt-installer-script-on-ubuntu/blob/master/install
and I executed last line and it gives me an error
xvfb-run: error:Xvfb failed to start
Any solution for that?
Thank you in advance

I was getting this error "xvfb-run: error: Xvfb failed to start" on Ubuntu 14.04, where previously my script had run without problems on Ubuntu 12.04.
My scripts were running calling xvfb-run multiple times, but I was seeing fails due to the error "Server is already active for display 99"
It seemed that the Xvfb wasn't ending when the xvfb-run command returned.
My solution was to use "xvfb-run -a [mycommand]" so xvfb uses another display if 99 is in use.

Had the same issue, solved it by running this instead:
xvfb-run --auto-servernum --server-num=1 [your script]
--auto-servernum : Try to get a free server number, starting at 99, or the argument to --server-num

Run xvfb-run -e /dev/stdout [mycommand] as #wumpus suggested.
I received the server lock message:
Fatal server error:
Could not create server lock file: /tmp/.X99-lock
xvfb-run:
error: Xvfb failed to start
Using sudo resolved the issue for me:
sudo xvfb-run -e /dev/stdout [mycommand]

Found the problem There is hanging process in system with name
Xvfb
I killed it and work fine. I newer found it earlier beacuse I used to try to find process with 'xvfb' name

I came across this error when running a bash script on Mac OS. Opening XQuartz before running the script solved my problem.

Related

Run mlagents_envs UnityEnvironment from remote ssh login

I have a script in which I build a mlagents_envs.environments.UnityEnvironment that successfully launches and works when I run the script from terminal sessions started on my ubuntu machine (that has a GUI). And if I ssh into the machine, I can run these scripts from tmux sessions that were originally created locally on my machine. If, however, I try to run the script from a terminal session created through the remote ssh connection, the script hangs when trying to create the UnityEnvironment. It just says:
Found path: <path_to_unity_executable>
and eventually times out.
I've tried to run the script with a virtual display and it still doesn't work. Specifically, I've tried:
$ xvfb-run --auto-servernum --server-args='-screen 1 640x480x24:64' python3 python_script.py -batchmode
$ xvfb-run --auto-servernum --server-args='-screen 1 640x480x24:64' python3 python_script.py
And I've tried the instructions found here: https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Training-on-Amazon-Web-Service.md
Has anyone encountered this issue? Do you have any suggestions?
The solution ended up being fairly simple. I just needed to specify the right DEVICE before running the script.
$ DEVICE=:1 python3 python_script.py
If anyone else runs into this, you might also need to enable X11 forwarding in both the ssh settings on the server and the client. I'm not 100% sure.

Unable to make airflow run on Linux server

I installed airflow on linux server using: sudo pip3 install apache-airflow. It got installed successfully.
Then I did: export AIRFLOW_HOME=~/airflow. Finally I ran sudo airflow initdb, it's giving me an error:
sudo: airflow: command not found
echo $PATH prints something like this:
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/xyz/abc/.local/bin:/home/xyz/abc/bin
I went through these posts:
Getting bash: airflow: command not found
How to install airflow?
But, couldn't find any solution that would solve my problem. Don't know what I'm missing. Any help regarding this would be appreciated..
It looks like the execution bit was not set for the airflow binary. Run sudo chmod 775 /usr/local/bin/airflow to fix this.

How to resolve XStartTimeoutError: Failed to start X on display ":1013" error

I want to run a pyvirtualdisplay on my Mac.
After installing all dependencies I installed X11 because
i needed Xvfb to run and changed some permission for some folder called ~/.Xauthority to 777.
Still, if I ran
display = pyvirtualdisplay.Display(visible=0, size=(320, 240)).start()
XStartTimeoutError: Failed to start X on display ":1013" (xdpyinfo check failed).
What I also tryed was to change
X11Forwarding in my /etc/ssh/sshd_config file to yes.
Did not work out.
How can I resolve the issue?
Constructive help appreciated.
I got this same error while trying to run Selenium using PyVirtualDisplay on my Raspberry Pi. I was not running Xephyr.
In a separate terminal window I ran
export DISPLAY=:0 XAUTHORITY=/etc/X11/host-Xauthority
and then
Xephyr :1 -fullscreen
Then re ran my python script and it worked.
If that doesn't work for you, here is where the actual error is occurring in the PyVirtualDisplay package: https://github.com/ponty/PyVirtualDisplay/blob/d229fcf892fdda17887684b977365d1fa90255eb/pyvirtualdisplay/abstractdisplay.py#L149
As you can see, you might need to install xdpyinfo in some form on your Mac.

Protractor sendkeys not working: an x display is required for keycode conversions

I am trying to run Protractor e2e tests inside a Vagrant VM using headless Chrome.
I managed to get it working by using Xvfb but when I run a test to fill a form I get an error: unknown error: an X display is required for keycode conversions, consider using Xvfb
All tests run fine but as soon as I use getKeys() (e.g. element(by.model('user.email')).sendKeys('admin'); ) I get this error, even though I am already using Xvfb.
I'm running:
AngularJS sample app generated with the Yeoman angular-fullstack generator
Nodejs version 0.10.30, installed with nvm
Vagrant 1.6.3
VirtualBox 4.3.14
Host OS Ubuntu 14.04 32 bits
Guest OS Ubuntu 14.04 32 bits
chrome 37.0.2062.94
chromedriver 2.10.267517
I use the following shell script to start Selenium and Xvfb:
#!/bin/sh
webdriver-manager start &
Xvfb :1 -ac -screen 0 1280x1024x8 &
export DISPLAY=:1
I also added "export DISPLAY=:1" to /opt/google/chrome/google-chrome.
Again, tests without sendKeys() run fine.
What I have done so far:
I'm running 32 bits Ubuntu so I downloaded chromedriver 2.10 32 bits but that didn't help
I ran chromedriver with --verbose and checked the logs but that only shows the same error
I fiddled with the Xvfb screen dimension settings, didn't help either
I checked some source code here: https://github.com/bayandin/chromedriver/blob/master/keycode_text_conversion_x.cc and found the error message on line 196.
It's triggered when the command gfx::GetXDisplay() (line 193) doesn't get a display object. I suspect that it might be just the DISPLAY variable I export in /opt/google/chrome/google-chrome but I'm not sure and have no idea how to fix it.
I would like to know how I can get sendfkeys() working with headless Chrome inside a Vagrant VM.
Any help is greatly appreciated.
Ensure seleniumAddress: 'http://localhost:4444/wd/hub' matches your selenium server and avoid setting chromeOnly since that will effectively avoid using the headless selenium server.
Also, Xvfb needs to run before webdriver-manager and you're missing xvfb-run given you seem to need it to do the X authority dance for you:
#!/bin/sh
export DISPLAY=:1
Xvfb $DISPLAY -ac -screen 0 1280x1024x8 &
sleep 1
xvfb-run webdriver-manager start &
In case you're interested I've setup a headless docker based solution with optional VNC access plus video recording: https://github.com/elgalu/docker-selenium

Running the following linux command on windows

I am trying to run the following Linux commands on windows. I was able to install curl.exe and run the first command of the two below, however, without the | php at the end of it, as adding it caused an php is not recognized as an internal or external command error.
Then when trying to run the second command of the two I get a host not found error.
I am new to curl and linux command line and I was wondering if someone can help me figure out how to run the second command on my windows machine?
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar install
many thanks in advance!
php is not recognized as an internal or external command
That error means either PHP is not installed on the Windows machine, or it is not in the PATH.
Install it if you have not already. If you have installed it, either specify the full path to PHP in your command
curl -s http://getcomposer.org/installer | C:\Install\Path\php
or ensure that the PHP directory is in the PATH environment variable.

Resources