Xvfb missing title bar - xvfb

I am trying execute desktop programs using Xvfb but the titlebar are missing.
Example:
# start desktop environment
Xvfb :1 -screen 0 1024x768x16 &
# access to desktop environment
x11vnc -display :1 -localhost &
vncviewer :0 &
# run wine
DISPLAY=:1 wine winecfg
Screenshot:

Titlebars on windows are the responsibility of the window manager. Since you didn't run one, you're getting only the interface elements actually provided by the application.
I don't know what the fashionable window manager is these days... if you're very traditional, this will work:
twm -display :1 &

Related

GUI program (gitkraken) won't start in fedora docker

I'm having trouble starting a Gitkraken (latest) in a fedora-based docker on windows.
export DISPLAY=168.1.23:0.0 && gitkraken <---- exits immediately with exit code 0 :-(
Which is strange, because this works fine:
export DISPLAY=192.168.1.10 && xeyes <---- works
And in WSL (running Ubuntu) I have no problems starting gui applications like this:
export DISPLAY=192.168.1.10 && xeyes <---- works
export DISPLAY=192.168.1.10 && gitkraken <---- works
The host machine is Win10 running vcxserver (without problems I suspect, since xeyes and firefox etc start fine)
It must be some strange incompatibility with the packages in the fedora-docker.
How do I examine this?
I tried "strace gitkraken" ... which obviously gives a lot of info ...
What can I try?
Try running GitKraken with the flag --disable-gpu to disable hardware acceleration.

How to install YugaByte on Docker for Windows

The instructions at https://docs.yugabyte.com/latest/quick-start/docker/install/ state that Docker for Windows is supported, however the yb-docker-ctl utility in the step that follows seems to be a *nix app and does not run on Windows 10 Pro. How do I install a 3-node local YugaByte cluster on Docker for Windows? (by the way StackOverflow would not let me add a YugaByte tag to the question, I could only add Docker)
The yb-docker-ctl utility is actually a Python2 script that will run on Windows 10 Pro if you have Python2 installed. I prefer to use Chocolately (https://chocolatey.org) to manage my package installations, so you could install python2 (not python -- as that will default to python3) using choco install python2 from PowerShell or CMD. You can also install wget in the same manner.
You will then need to a couple of changes to yb-docker-ctl. The script utilizes os.path.join which will utilize the Windows default of \\ for path separator. Add the line import posixpath after line 10 of yb-docker-ctl and substitute posixpath.join for os.path.join at lines 227 and 377.
After you have made those modifications, you can run python yb-docker-ctl create to create your 3 node cluster.

Focus chrome window in linux when running using xvfb

I am using the following shell script for to get the focus on a specific chrome window:
#!/bin/sh
WIDId=`xdotool search "Test page"`
xdotool windowactivate --sync $WIDId
sleep 2
xdotool windowactivate $WIDId
xdotool key --clearmodifiers ctrl+a
It works when running normally but fails when running chrome using xvfb.
In xvfb it is unable to find the windowID.
I need it to get working with xvfb.
It worked even without using windowactivate because I opened just one window that needed focus.

Unable to run functional tests on server. [geb spock]

Hi I am running my functional tests using geb.
I am able to run tests on my local computer correctly. but as I deploy my application to server. the build for functional tests fails.
Here is my console output
|Running 10 spock tests... 1 of 10
Failure: |
sign in with voucher
|
geb.driver.DriverCreationException: failed to create driver from callback 'script14007213321291157436758$_run_closure1#77068fce'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:346)
at geb.Configuration.getDriver(Configuration.groovy:335)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.go(Browser.groovy:377)
at geb.Page.to(Page.groovy:171)
at geb.Browser.via(Browser.groovy:454)
at geb.Browser.to(Browser.groovy:413)
at geb.Browser.to(Browser.groovy:391)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at VoucherSpec.sign in with voucher(VoucherSpec.groovy:14)
Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/local/bin/firefox) on port 7056; process output follows:
Error: no display specified
Error: no display specified
Can anyone guide me to solve this issue.
The server you're running the tests on is 'headless' so doesn't have a display to start Firefox on to run the tests. You've got a couple of options:
Switch from Firefox to a headless browser such as HTMLUnit.
Configure a virtual display on the server.
Use a remote browser service such as SauceLabs.
If you need to test directly on Firefox then HTMLUnit isn't an option for you.
Using a remote browser service such as SauceLabs or BrowserStack has a couple of advantages, for example they record a video of the session and take screenshots, but we found the overhead of passing commands & traffic over the network made the tests unacceptably slow. If you need to test a wide variety of browsers then the overhead diminishes because you can run in parallel...
Option 2, using a virtual display, is the simplest to configure on most servers. If you're using Linux the X Virtual Frame Buffer (XVFB) will get you up and running quickly. It's worth reading up on what's going on but the short answer is:
Install XVFB (sudo apt-get install xvfb)
Install Firefox (sudo apt-get install firefox)
Start XVFB (sudo Xvfb :10 -ac -screen 0 1024x768x8 &). You may want to add an init script so this happens every time the server starts
In your CI server add export DISPLAY=:10 as a step before the tests are run
Run your tests
The XVFB creates a virtual display on :10, which you then set as the default display. When you start Firefox it's completely unaware that it's on a virtual display, so things like getting Geb to take screenshots of failing tests will work as normal.
For more information about the steps see:
http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
https://github.com/tomaslin/grails-test-recipes
http://www.semicomplete.com/blog/geekery/xvfb-firefox.html
http://www.labelmedia.co.uk/blog/setting-up-selenium-server-on-a-headless-jenkins-ci-build-machine.html
http://manpages.ubuntu.com/manpages/lucid/man1/xvfb-run.1.html
If you need an init script to get it to start/stop, then there are quite a few to choose from, such as this one.

Jenkins shows wrong time?

I am running Jenkins on a Linux server and shows the wrong time :(
Situation:
I am running another java app (in tomcat that also runs Jenkins) that shows the correct time in the log files (I use Logback through slf4j).
The bios is set to the UTC time (system clock) like advises here: http://www.linuxsa.org.au/tips/time.html
In Linux it's indicated in /etc/sysconfig/clock that the system clock is set to UTC and in which timezone we are located. I am in UTC+1
Running date command on Linux shows the correct local time. Example:
Sun Jan 8 12:11:35 CET 2012
But Jenkins shows the time plus 1 hour :(...
The jenkins config shows:
user.timezone = Europe/Amsterdam (which is UTC+1).
I think that Jenkins (java) thinks the local clock is set to UTC such that 1 hour is added.
How do I solve this?
If you are running Jenkins with Docker, you can append -e JAVA_OPTS=-Duser.timezone=TZ to docker arguments.
docker run -e JAVA_OPTS=-Duser.timezone=$TZ jenkins
All available TZ can be found here.
See here: https://wiki.jenkins-ci.org/display/JENKINS/Change+time+zone
In short, you can set the system property, either modifying the JVM options,
java -Dorg.apache.commons.jelly.tags.fmt.timeZone=TZ ...
Or changing Jenkins configuration in /etc/default/jenkins (Debian) or /etc/sysconfig/jenkins (Red Hat):
JAVA_ARGS="-Dorg.apache.commons.jelly.tags.fmt.timeZone=America/New_York"
It also mentioned -Duser.timezone="..." is an option, but can cause problems / interfere with other contexts (some vague hand-waving & caveats: time travel is always unpredictable).
In general (in my experience), don't change the system time, since us, our servers & our data live in a global world & should be handling, sending, comparing all times in UTC until the latest possible moment: usually that's the GUI (presentation layer) just before being displayed (...if even then). (Our build system results actually produces data that is fed into another system in another time zone.)
On Jenkins 2.63 on Ubuntu 14.04.5 LTS setting
JAVA_ARGS="-Djava.awt.headless=true -Duser.timezone=America/Los_Angeles"
in /etc/default/jenkins and then doing
sudo service jenkins stop
sudo service jenkins start
worked for me to change the timezone from UTC to PDT.
Put this in a Dockerfile and it will work;
RUN echo "import hudson.model.*;" >
/var/jenkins_home/init.groovy.d/timezone.groovy && \
echo "import jenkins.model.*;" >>
/var/jenkins_home/init.groovy.d/timezone.groovy && \
echo "System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone',
'America/Denver')" >> /var/jenkins_home/init.groovy.d/timezone.groovy
$JENKINS_HOME/init.groovy.d/*.groovy will get executed at start up.
System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone',
'America/Denver')
That sets the timezone.
For official Jenkins Docker image (lts:2.138.1), you should set Jenkins java options to your local TZ. You can use this env. variable in a docker run command or docker-compose as well.
See here: https://wiki.jenkins.io/display/JENKINS/Change+time+zone
JENKINS_JAVA_OPTIONS="-Duser.timezone=Europe/Paris"
In case you have additional slaves you can sync the clock by using ntp. On Linux you can run following commands for each slave:
sudo systemctl stop ntp
sudo ntpdate -qu 0.debian.pool.ntp.org
sudo systemctl restart ntp
sudo systemctl status ntp
The easiest way without restarting Jenkins:
Open "Manage Jenkins" -> "Script Console"
Run the script:
System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'America/New_York')

Resources