Running a GUI application on a CI service without X11 - user-interface

I have a GUI application that I would like to set up testing for via GitHub Actions. I already have it set up so that GitHub Actions compiles the application on Ubuntu, but now what I would like to do is run the application for a few seconds and test if it crashes or not. However, currently it fails to start because there is no X11 server installed.
Is there a way that I can install a dummy X11 server, so that the application runs? I don't care about what is actually displayed, I just want the application to be able to open without failing due to the X11 server missing.
Alternatively, is there a way to install a dummy Wayland server? This app can also run on Wayland.

I use this command:
linux:
runs-on: ubuntu-latest
steps:
run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
mycommand

You can try xvfb-run from Xvfb project. It starts your application(s) under fully compatible X Window server w/o any hardware (you can even run x11vnc among your apps and connect to the server over VNC, but I believe it's not your case for now). Personally I use xvfb-run for isolated screenless X.org-aware packages build, when, e. g., a package needs to take a snapshot of itself while making documentation.
$ xvfb-run x.org_application_binary

Yes, that is possible. Simply create a Docker Image with your X11 environment and deploy your application in it.
Alternatively, you can also just install X11 on your machine. Make sure to do it in every run, as the environments always fully reset:
sudo apt-get install xorg openbox

Related

How to install Redis on Windows 10 pc [duplicate]

How do I run Redis on Windows? The Redis download page just seems to offer *nix options.
Can I run Redis natively on Windows?
Historically, Microsoft had a Windows port of redis, which was released as Redis-64, which offers a full distribution of redis for Windows.
The Microsoft port is now deprecated, but some alternatives have sprung up to fill that void:
Memurai is the alternative officially recommended on the Redis-64 deprecation page; it is a commercial offering with free developer tier, maintained by Janea Systems
redis-windows is another unofficial port, which also exists
This release includes the redis-server.exe (memurai.exe on Memurai) application that runs a Redis instance as a service on your windows machine, as well as redis-cli.exe (memurai-cli.exe on Memurai) which you can use to interact with any Redis instance.
The RGL repository has historically been listed as an alternative Windows port for Redis, but this repository has not been maintained for some time and implements an older version of Redis than the Microsoft port.
Update
If you have Windows Subsystem for Linux (WSL), natively on Windows 10 and Windows Server 2019 you can do it per
Ogglas answer
Or follow these instructions to run a Redis database on Microsoft Windows
Turn on Windows Subsystem for Linux
In Windows 10, Microsoft replaced Command Prompt with PowerShell as the default shell. Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL):
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Reboot Windows after making the change — note that you only need to do this once.
Launch Microsoft Windows Store
start ms-windows-store:
Then search for Ubuntu, or your preferred distribution of Linux, and download the latest version.
Install Redis server
Installing Redis is simple and straightforward. The following example works with Ubuntu (you'll need to wait for initialization and create a login upon first use):
sudo apt-add-repository ppa:redislabs/redis
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server
Please note that the sudo command might or mightn't be required based on the user configuration of your system.
Restart the Redis server
Restart the Redis server as follows:
sudo service redis-server restart
Verify if your Redis server is running
Use the redis-cli command to test connectivity to the Redis database.
$ redis-cli
127.0.0.1:6379> set user:1 "Ben"
127.0.0.1:6379> get user:1
"Ben"
Please note: By default, Redis has 0-15 indexes for databases, you can change that number of databases NUMBER in redis.conf.
Stop the Redis Server
sudo service redis-server stop
Source :How to Install Redis on Windows
I found one more simple way to install Redis under Windows
Download the latest Redis .msi file from
https://github.com/MSOpenTech/redis/releases
after installation. The Redis service is installed, and we can operate it from Service manager
If you want to install MSOpenTech's latest port of Redis, on a Windows server, watched over by a Windows Service, without having to build anything yourself, read on.
MSOpenTech's seems to be the only port that is actively trying to keep up with the latest and greatest Redis. They claim it is production-ready, but they haven't exactly packaged it up neatly for installation on a server, especially if you want to run their RedisWatcher service to keep an eye on it, which is recommended. (I tried building RedisWatcher myself per their instructions, but the required Wix Toolset managed to mess up my system pretty good. I won't go into it.) Fortunately they've provided all the binaries you need, just not all in one place. From the README:
So far the RedisWatcher is not carried over to 2.6. However this
should not be affected by the Redis version, and the code in the 2.4
branch should work with the Redis 2.6 binaries.
So you'll need to download binaries from 2 branches in order to get all the necessary bits. Without further ado, here are the steps:
Download and extract the Redis binaries from the 2.6 branch
Copy all extracted binaries to c:\redis\bin
Create another folder at c:\redis\inst1
Download and extract the RedisWatcher binaries from the 2.4 branch
Run InstallWatcher.msi. This should create a Windows service called Redis watcher.
Open up the Windows Services console and start the Redis watcher service.
(optional) RedisWatcher should have installed to C:\Program Files (x86)\RedisWatcher. There you'll find a config file called watcher.conf, which you can edit to set up additional instances, use different paths than I specified in steps 2 & 3, etc. You will not need to restart the service for changes to take effect.
The most updated (only few minor releases behind) version of Redis can be found here. This repository provides you with 3.2.100 version (current is 3.2) whereas the most upvoted answer gives you only 2.4.6 version and the last update to the repo was 2 years ago.
The installation is straightforward: just copy everything from the archive to any folder and run redis-server.exe to run the server and redis-cli.exe to connect to this server through the shell.
To install Redis for Windows
You can choose either from these sources
https://github.com/MSOpenTech/redis/releases
or
https://github.com/rgl/redis/downloads
Personally I preferred the first option
Download Redis-x64-2.8.2104.zip
Extract the zip to prepared directory
run redis-server.exe or redis-server.exe --maxheap 2gb
then run redis-cli.exe
You can start using Redis now, please refer for commands
Maybe its a little Late but, I was able to run Redis on Windows 10 Aniversary Update.
Windows 10 Aniversary Update Comes with Bash on Ubuntu on Windows, simply, it comes with bash.
Below are the two tutorial that I followed:
1- How to Install and Use the Linux Bash Shell on Windows 10
2- How To Install and Use Redis
Below is the image of running Redis.
Enjoy :)
If you have Windows Subsystem for Linux (WSL), natively on Windows 10 and Windows Server 2019 you can do it like this:
Set up WSL:
To enable Windows Subsystem for Linux, follow the instructions on
Microsoft Docs. The short version is: In Windows 10, Microsoft
replaces Command Prompt with PowerShell as the default shell. Open
PowerShell as Administrator and run this command to enable Windows
Subsystem for Linux (WSL):
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Reboot Windows after making the change—note that you only need to do this one time.
Download and install one of the supported Linux distros from the Microsoft Store. Ubuntu works fine.
Note that Ubuntu 20.04 LTS may give you some trouble because of a known issue with the realtime clock (as of August 2020). Choosing Ubuntu 18.04 LTS instead avoids that issue.
Install and Test Redis:
Launch the installed distro from your Windows Store and then install redis-server. The following example works with Ubuntu (you’ll need to wait for initialization and create a login upon first use):
> sudo apt-get update
> sudo apt-get upgrade
> sudo apt-get install redis-server
> redis-cli -v
Restart the Redis server to make sure it is running:
> sudo service redis-server restart
Execute a simple Redis command to verify your Redis server is
running and available:
$ redis-cli
127.0.0.1:6379> set user:1 "Oscar"
127.0.0.1:6379> get user:1
"Oscar"
To stop your Redis server:
> sudo service redis-server stop
Source:
https://redislabs.com/blog/redis-on-windows-10/
https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
Go to the releases and you can get a ZIP file containing the relevant files as well as a Word document called RedisService.docx with the following instructions:
Installing the Service
--service-install
This must be the first argument on the redis-server command line. Arguments after this are passed in the order they occur to Redis when the service is launched. The service will be configured as Autostart and will be launched as "NT AUTHORITY\NetworkService". Upon successful installation a success message will be displayed and Redis will exit.
This command does not start the service.
For instance:
redis-server --service-install redis.windows.conf --loglevel verbose
And then later, in the same document, another example:
The following would install and start three separate instances of Redis as a service:
redis-server --service-install -–service-name redisService1 –port 10001
redis-server --service-start --service-name redisService1
redis-server --service-install --service-name redisService2 –port 10002
redis-server --service-start --service-name redisService2
redis-server --service-install --service-name redisService3 –port 10003
redis-server --service-start --service-name redisService3
From what I can gather, this appears to be the new way forward rather than messing with a separate Windows service to monitor and restart the CLI.
Download redis from
Download Redis for windows
Then install it
open cmd with admin rights
run command net start redis
Thats it.
MS Open Tech recently made a version of Redis available for download on Github. They say that it isn't production ready yet, but keep an eye on it.
Github repo
Download releases as MSIs
You can use Memurai for Windows, a Redis-compatible cache and datastore for Windows, currently compatible with Redis 5. Memurai aims to fulfill the need for a supported Redis-compatible datastore on the Windows platform. At its core, it’s based on Redis source code, ported to run natively on Windows, and it’s designed to provide the level of reliability and performance required for production environments. Memurai is free for development and testing. You can learn more and download Memurai at https://www.memurai.com.
Alexis Campailla
CEO, Memurai
There are two ways. You can use MSI installation file or do it manually:
First download the msi or the zip file:
You can download both files from here:
https://github.com/MicrosoftArchive/redis/releases
Watch video tutorial (video covers example of both installations)
See this installation video tutorial: https://www.youtube.com/watch?v=ncFhlv-gBXQ
Instruction - for those who can not YT at work:
You can download a moderately out-of-date precompiled version of Redis for 32-bit
and 64-bit Windows thanks to Dusan Majkic from his GitHub page: https://github.com/dmajkic/redis/downloads. Go ahead and do that now.
After you download Redis, you’ll need to extract the executables from the zip file.
As long as you’re using a version of Windows more recent than Windows XP, you
should be able to extract Redis without any additional software. Do that now.
After you’ve extracted either the 32- or 64-bit version of Redis to a location of your
choice (depending on your platform and preferences; remember that 64-bit Windows
can run 32- or 64-bit Redis, but 32-bit Windows can only run 32-bit Redis), you can
start Redis by double-clicking on the redis-server executable. After Redis has
started, you should see a window similar to figure A.1.
src: https://redis.com/ebook/appendix-a/a-3-installing-on-windows/a-3-2-installing-redis-on-window/
Since MSOpenTech's port of Redis is no longer maintained - anyone interested in native port of Redis for Windows can now get the version 4.0.14 and 5.0.10 from here: https://github.com/tporadowski/redis/releases.
This fork is a merge of latest 3.2.100 version from MSOpenTech and 4.0.14/5.0.10 from antirez/redis with a couple of bugfixes.
I don't run redis on windows. There's too much hassle involved in keeping up with the ports, and they lag behind redis-stable by a version or two all the time.
Instead I run redis on a Vagrant virtual machine that runs redis for me. I've bundled up the whole thing into a simple github repo so everyone can get in on the fun without too much hassle. The whole thing is an automated build so there's no mess. I blogged about the details here.
To install Redis on Windows system follow the below steps:
Visit one of the below link:
https://github.com/MSOpenTech/redis/releases (recommended)
https://github.com/rgl/redis/downloads
Download MSI file.
Follow the installation Wizard and install the program on your system. (do not change the installation path that is "C:\Program Files\Redis")
Search for "Edit system environment variable" on your start menu
Click on "Environment Variable" button
Select "Path" and click on "Edit"
Now click on "New"
Paste C:\Program Files\Redis (or the path in case you have changed while installing)
Click on "Okay", "Okay" and "Okay"
Now open your Terminal (command prompt) and run redis-cli
Well I am getting some error to open redis-server (It was working fine till now but not sure what's wrong so figuring out and will update this answer)
I think these is the two most simple ways to run Redis on Windows
1 - Native (and updated) port for Windows
As described here on Option 3) Running Microsoft's native port of Redis:
Download the redis-latest.zip native 64bit Windows port of redis
wget https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip
Extract redis64-latest.zip in any folder, e.g. in c:\redis
Run the redis-server.exe using the local configuration
cd c:\redis
redis-server.exe redis.conf
Run redis-cli.exe to connect to your redis instance
cd c:\redis
redis-cli.exe
2 - With Vagrant
You can use Redis on Windows with Vagrant, as described here:
Install Vagrant on Windows
Download the vagrant-redis.zip vagrant configuration
wget https://raw.github.com/ServiceStack/redis-windows/master/downloads/vagrant-redis.zip
Extract vagrant-redis.zip in any folder, e.g. in c:\vagrant-redis
Launch the Virtual Box VM with vagrant up:
cd c:\vagrant-redis
vagrant up
This will launch a new Ubuntu VM instance inside Virtual Box that will
automatically install and start the latest stable version of redis.
If you're happy with a bit of Powershell, you can also get very up-to-date Windows binaries using Powershell and chocolatey.
First, add chocolatey to Powershell following the instructions here (one simple command line as admin): https://chocolatey.org/
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Then, use Powershell to get the redis package from chocolatey: http://chocolatey.org/packages/redis-64
choco install redis-64
Redis will be installed in something like C:\ProgramData\chocolatey\lib\redis-64.2.8.9
Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All
rights reserved.
PS C:\windows\system32> choco install redis-64 Chocolatey (v0.9.8.27)
is installing 'redis-64' and dependencies. By installing you accept
the license for 'redis-64' an d each dependency you are installing.
redis-64 v2.8.9 Added
C:\ProgramData\chocolatey\bin\redis-benchmark.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-benchmark.exe'. Added
C:\ProgramData\chocolatey\bin\redis-check-aof.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-check-aof.exe'. Added
C:\ProgramData\chocolatey\bin\redis-check-dump.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-check-dump.exe'. Added
C:\ProgramData\chocolatey\bin\redis-cli.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-cli.exe'. Added
C:\ProgramData\chocolatey\bin\redis-server.exe shim pointed to
'..\lib\redis-64.2.8.9\redis-server.exe'. Finished installing
'redis-64' and dependencies - if errors not shown in console, none
detected. Check log for errors if unsure
Then run the server with
redis-server
Or the CLI with
redis-cli
Follow the instructions in C:\ProgramData\chocolatey\lib\redis-64.2.8.9\RedisService.docx to install the redis service
The Redis download page now has links to some unofficial Windows ports. The dmajkic one seems to be the most popular/complete.
More detailed answer: How to run Redis as a service under Windows
One of the most easy way to run Redis on windows host is to use Docker Redis container. Just fire up Hyper-V, Download Docker and run Redis
I am using Memurai which is Redis-compatible cache and datastore for Windows. It is also recommended by Microsoft open tech as it written on their former project here.
This project is no longer being actively maintained. If you are
looking for a Windows version of Redis, you may want to check out
Memurai. Please note that Microsoft is not officially endorsing this
product in any way.
you can install Redis by following this article:
https://github.com/ServiceStack/redis-windows
but for going straight, you can download it by this link:
https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip
after downloading, go to the directory which you like to put your files,then extract the zip file, then open a command prompt and go to the directory where you extracted your file, then type "redis-server" and hit enter(for opening redis-cli open command and route to redis directory, but instead of "redis-server" execute "redis-cli").
I've provided installation instructions and downloads for the 2 most popular ways of running Redis on windows at: https://github.com/mythz/redis-windows that shows how to:
Use Vagrant to run the latest stable version of Redis inside a
VirtualBox VM.
Download and run Microsoft's Native Windows port of Redis
Using Windows 10?
https://learn.microsoft.com/en-us/windows/wsl/install-win10
/etc/apt/sources.list
(Debian 10 Buster/Bullseye)
Installs latest stable Redis (5.0.6 at time of posting)
deb https://deb.debian.org/debian bullseye main
deb https://deb.debian.org/debian bullseye-updates main
deb http://security.debian.org/debian-security/ buster/updates main
deb http://ftp.debian.org/debian bullseye-backports main
apt install redis-server
Today I know these 4 options:
The first is an open source fork that is on tporadowski/redis that offers compatibility with version 5 (version 6 in development).
The second is memurai (paid), compatible with version 5, has support and a free version for development.
The third is the zkteco-home/redis-windows recently, which offers compatibility with version 7, but is not open source.
There is also the option to run via WSL. But I don't recommend it in production environments.
You can try out baboonstack, which includes redis and also a node.js and mongoDB version manager. And it's cross platform.
The redis version on windows was published by microsoft open tech team But recently this project has been archived to https://github.com/MicrosoftArchive/redis read-only and will not update. Has stopped development
Here are my steps to install Redis 4.0.8 on Windows 10 Pro (1709) via Windows Subsystem for Linux:
in home/user/
01 wget http://download.redis.io/releases/redis-4.0.8.tar.gz
02 tar xzf redis-4.0.8.tar.gz
03 cd redis-4.0.8/
04 sudo apt-get install make
05 sudo apt-get update
06 sudo apt-get install gcc
07 cd deps
08 make hiredis jemalloc linenoise lua geohash-int
09 cd ..
10 make
You can skip several steps if you have an up-to-date environment.
The MSOpenTech-Redis project is no longer being actively maintained. If you are looking for a Windows version of Redis, you may want to check out Memurai. Please note that Microsoft is not officially endorsing this product in any way. More details in https://github.com/microsoftarchive/redis
To install & setup Redis Server on Windows 10 https://redislabs.com/blog/redis-on-windows-10
To install & setup Redis Server on macOS & Linux https://redis.io/download
Also, you may install & setup Redis Server on Linux via the package manager
For quick Redis Server Installation & Setup Guide for macOS https://github.com/rahamath18/Redis-on-MacOS
You can go through the below steps and get setup redis in windows.
Download the Redis zip file. Click here!
Extract the zip file to the prepared directory.
Run redis-server.exe, you can either directly run redis-server.exe by clicking or run via command prompt.
Run redis-cli.exe, after successfully running the redis-server. You can access it and test commands by running redis-cli.exe Test
PING command is used to test if a connection is still alive.
Reading about some users running Redis in a VM, it brought to my mind the recommendations from Redis team :
Redis runs slower on a VM. Virtualization toll is quite high because for many common operations. (...) Prefer to run Redis on a physical box, especially if you favor deterministic latencies. On a state-of-the-art hypervisor (VMWare), result of redis-benchmark on a VM through the physical network is almost divided by 2 compared to the physical machine, with some significant CPU time spent in system and interruptions.

Cannot run JavaFX app on docker for more than a few minutes

I developed an application used as a communication service for a separate web app. I had 0 issues "dockerizing" the web app but the service is proving to be a nightmare. It is based on JavaFX and there is a property that can be set by the user in the config file that makes it so the app does not initialize any windows, menus, containers, etc. This "headless" mode (not sure that is truly headless...) effectively turns the service app into a background service. Let me also preface this by saying that the app works absolutely flawlessly when run on my windows 10 machine and that i have deployed it on several other machines (all non-dockerized) with no issues.
Here is the dockerfile i came up with :
FROM openjdk:13.0.1-slim
RUN apt-get update && apt-get install libgtk-3-0 libglu1-mesa -y && apt-get update
VOLUME /tmp
ADD Some_Service-0.0.1-SNAPSHOT.jar Some_Service-0.0.1-SNAPSHOT.jar
ADD lib lib
ADD config.properties config.properties
ENTRYPOINT ["java", "--module-path", "lib/javafx-sdk-13", "-jar", "Some_Service-0.0.1-SNAPSHOT.jar"]
I then use this command to build the container :
docker run -t --name Some_Service -e DISPLAY=192.168.1.71:0.0 -e SERVICE_HOME= --link mySQLMD:mysql some_service
Assuming VcXsrv is running on my PC, the app start correctly, although it does give these warnings when first starting :
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Prism-ES2 Error : GL_VERSION (major.minor) = 1.4
The issue is that it only works for like 2 minutes. Eventually the container comes up with this error and crashes :
Gdk-Message: 15:28:54.770: java: Fatal IO error 11 (Resource temporarily unavailable) on X server 192.168.1.71:0.0.
I understand the initial messages are due to the container having no NVidia driver but the fallback to the software pipeline seems to work fine. Honestly I have no idea what the fatal IO error could be caused by. I have tried on different hosts running docker and the same issue happens.
Any idea how to fix this? Even better, any idea how to make a JavaFX app TRULY headless and not even require any of this stuff to be initialized? When running headless, i use Tasks and such which are part of JavaFX so I can't just not use it...
Install xvfb in your container this create a virtual screen.
change to Docker file:
FROM openjdk:13.0.1-slim
RUN apt-get update && apt-get install libgtk-3-0 libglu1-mesa xvfb -y &&
apt-get update
VOLUME /tmp
ADD Some_Service-0.0.1-SNAPSHOT.jar Some_Service-0.0.1-SNAPSHOT.jar
ADD lib lib
ADD config.properties config.properties
apt-get install xvfb
ENV DISPLAY=:99
ADD run.sh /run.sh
RUN chmod a+x /run.sh
CMD /run.sh
Add new bash Script in your project folder and name it "run.sh"
run.sh:
#!/bin/bash
#remove old
rm /tmp/.X99-lock #needed when docker container is restarted
Xvfb :99 -screen 0 640x480x8 -nolisten tcp &
java --module-path lib/javafx-sdk-13 -jar Some_Service-0.0.1-SNAPSHOT.jar
Dont forget to remove -e DISPLAY=192.168.1.71:0.0 from your docker run command

Is it possible to run xvfb on Heroku?

I'd like to run xvfb on Heroku. On my mac, I used the dmg to install it. Would anyone have any idea how to go about this on Heroku?
I came across these buildpacks (http://github.com/douglasjsellers/heroku-xvfb-buildpack) - but following the instructions didn't seem to solve the problem as xvfb is still not installed properly. Also, I tried installing the xvfbwrapper (https://pypi.python.org/pypi/xvfbwrapper/0.1.0), but it's still not working on Heroku (apologies for what is potentially a noob question).
Here is the error I get in my logs off of Heroku:
2015-02-24T02:09:16.035298+00:00 app[web.6]: cmd=['Xvfb', '-help']
2015-02-24T02:09:16.035564+00:00 app[web.6]: Program install error!
2015-02-24T02:09:16.035302+00:00 app[web.6]: OSError=[Errno 2] No such file or directory
Here is the code:
temp = tempfile.mkstemp(suffix='.html')
html = os.fdopen(temp[0], "r+")
html.write(cv)
html.seek(0, 0)
display = Display(visible=0, size=(800, 600))
display.start()
# Open the file on Selenium to load the JavaScript
driver = webdriver.Firefox()
driver.get("file://" + temp[1])
I found this question while researching how to update Xvfb for Cedar-14, and I managed to get #2 to work. So here's how:
I used buildpack-apt to install x11-xkb-utils xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic libxfont1 xvfb.
After running the apt buildpack, you need to patch Xvfb a bit to make everything work smoothly. For that, I used my own run-bash buildpack, but everything that lets you run a bash script during Heroku compile will work. Here's the script I used to patch Xvfb and index the fonts: https://gist.github.com/fxtentacle/960cdb96ece01add8686
Now you can use heroku run bash to check with XAUTHORITY=/tmp/xvfb-run.2NG0xl/Xauthority Xvfb ":99" -screen 0 1280x1024x24 -nolisten tcp that the Xvfb is working.
Yes, it is possible, but complicated. I followed some of what fxtentacle did (in their answer), but this may be simpler. These instructions provide for a minimal Xvfb setup; it still prints out a bunch of warnings.
Use heroku-buildpack-apt to install the xvfb and libnotify4 debian packages. Then use this buildpack to fix the /usr/bin/xkbcomp issue:
https://github.com/captain401/heroku-buildpack-xvfb
Then you can use xvfb-run $PROGRAM to run your application.
I'm wondering the same thing. Seems like you already found this guy's issue. All the buildpacks mentioned are 1+ years old, and don't work anymore.
Two viable seeming options:
Compile a self-contained xvfb binary a la https://github.com/kenshin23/xvfb-portable-binary that runs on Heroku's current OS and architecture, rebuild when they update.
Install all dependencies from the apt package manager into someplace like ~/.apt, and run from there, as in the latest buildpack-apt. For me, this option dies with sh: 1: /usr/bin/xkbcomp: not found. Xvfb is looking in /, while apt installed the command to ~/.apt/usr/bin/xkbcomp. Haven't figured out how to tell Xvfb to look in ~/.apt/.

Run window manager with chromium and go through proxy server on RPI

I am using Raspberry pi(s) for workstations in an office setup. I want the users to have access to the intranet and a couple of websites. I have a proxy set up with whitelist that works fine.
I want to boot the RPI and show only a web browser and connect through the proxy. I understand I need a window manager for this.
I have been experimenting with chromium (as it makes it very easy to insert the proxy address as an attribute when opening chromium via command line). The problem is, Chromium is a demanding browser and struggles with JQuery on the RPI.
I am looking for a browser I can run through a proxy, in a window manager from a start up script that won't be slow as hell!
Does this exist? Or am I going down the wrong path for this?
I don't know if this is really what you want but here is one way to boot directly into a web-browser:
1. Make sure you use a Raspberry with the latest version of raspbian installed and updated:
sudo apt-get update
sudo apt-get upgrade
2. If you don't want to use Midori, install the browser you want. I prefer chromium (Light version of Google Chrome) so that's what I will use here. To install chromium run the following command:
sudo apt-get install chromium
3. Configure raspi-config to start in GUI mode:
sudo raspi-config -> Enable boot to desktop/Scratch -> Desktop login as....
4. To start chromium on boot, comment all existing code in the file and add the following last:
sudo nano /etc/xdg/lxsession/LXDE/autostart
#xset s off
#xset -dpms
#xset s noblank
#chromium
On the last line you can also add switches like kiosk mode (--kiosk) after #chromium. Watch this link for more switches:
List of commandline switches
Hope this was any help! Good luck!

cannot start browser for selenium through ssh

I am trying to setup a linux box (no display connected) to run as a selenium server. If I connect a monitor and login on the box then I can run the selenium tests no problem. If I try to run the tests via ssh then the tests fail with
Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: Timed out waiting for profile to be created!
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:360)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:114)
I think it has something to do with the display's absence / presence. Any ideas?
PS the browser is firefox 5, the OS is Ubuntu 11.04
I got it to work by using xvfb. So first install xvfb:
sudo apt-get install xvfb
then run it
Xvfb :99 -ac
and then start the selenium server
DISPLAY=:99 java -jar selenium-server-standalone-2.4.0.jar
Here is my answer.
You get this error because there is no monitor to open firefox on, it is getting confused.
Install Xvfb, which pretends to be a monitor, but doesn't show up anywhere.
sudo apt-get install xvfb
If you want less errors add these fonts, but those warning aren't important.
sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
Then start it running and set your display to something the system won't use. Here is what I do, remeber the & makes the terminal run something in the background.
Xvfb :99 -ac &
export DISPLAY=:99
firefox &
Also I was having problems with a ruby on rails server disconnecting when I quit the ssh terminal. To fix that problem use Screen. Screen runs another terminal without being affected by the ssh.
sudo apt-get install screen
Then just start screen before you you do the stuff above.
screen
To get out of the current screen window just click "Ctrl + A" and to get back in type screen -r.
There is a good way to test using imagemagick screen shoot
Install mozilla firefox headless(no GUI)
yum install xorg-x11-server-Xvfb.x86_64 xfonts-base xfonts-75dpi xfonts-100dpi firefox ImageMagick.x86_64
Starts firefox on virtual gui
DISPLAY=:1 firefox http://google.com &
– test and check
Xvfb :1 -screen 1 1024x768x24 &
ps -ef |grep firefox
Uses imagemagic to get a printscreen, to make sure its working.
DISPLAY=:1 import -window root google.com.png
(Optional) Set proxy in firefox profile
vi /root/.mozilla/firefox/ns11i9xo.default/prefs.js
user_pref(“network.proxy.http”, “proxyserver”);
user_pref(“network.proxy.http_port”, 8080);
user_pref(“network.proxy.no_proxies_on”, “localhost, 127.0.0.1, 172.17.0.0/16, 10.5.0.0/16″);
http://felipeferreira.net/?p=1220

Resources