Run GUI app in linux docker on linux server on windows host - linux

The following system was built (not by me):
Windows 10 operating system is installed on the local machine.
Connection goes to the remote server with Ubuntu 16.04 through a client (like SmarTTY or Bitwise SSH Client).
The docker container is launched on the server.
How do I configure the system so that the GUI application can be started from the container on the remote server and I can interact with it?
I don't quite understand the ports and DISPLAY values system.
With smarTTY and its vcxsrv client I can run this application outside the container, but not inside - there are errors about missing some java files.
EDIT: Adding reports and more information
I have this configuration of running command for docker:
docker run --rm --runtime=nvidia -it --name delobo \
-v /opt/pycharm-community-2019.1.3/:/opt/pycharm/ -v $(pwd):/workspace \
-v /media/:/media/ \
-v /home/boyko/.Xauthority:/home/boyko/.Xauthority \
-e XAUTHORITY=/home/boyko/.Xauthority \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged \
-e DISPLAY=$DISPLAY -v $HOME/:/home/boyko \
--network=host tensorflow_me bash
and all this time when i was trying to run GUI of PyCharm, i get something like this:
Start Failed: Internal error. Please report to http://jb.gg/ide/critical-startup-errors
com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException
at com.intellij.ide.plugins.PluginManager.lambda$start$0(PluginManager.java:78)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.intellij.ide.plugins.PluginManager.lambda$start$0(PluginManager.java:75)
... 1 more
Caused by: java.lang.UnsatisfiedLinkError: /opt/pycharm/jre64/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.load0(Unknown Source)
at java.base/java.lang.System.load(Unknown Source)
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)
at java.base/java.lang.System.loadLibrary(Unknown Source)
at java.desktop/java.awt.Toolkit$3.run(Unknown Source)
at java.desktop/java.awt.Toolkit$3.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.loadLibraries(Unknown Source)
at java.desktop/java.awt.Toolkit.<clinit>(Unknown Source)
at com.intellij.ui.AppUIUtil.updateFrameClass(AppUIUtil.java:172)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:107)
at com.intellij.idea.MainImpl.start(MainImpl.java:20)
... 6 more
Also, an UI exception occurred on attempt to show above message:
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
at java.desktop/java.awt.Component.<clinit>(Unknown Source)
at com.intellij.idea.Main.showMessage(Main.java:158)
at com.intellij.idea.Main.showMessage(Main.java:134)
at com.intellij.ide.plugins.PluginManager.processException(PluginManager.java:140)
at com.intellij.ide.plugins.PluginManager$1.uncaughtException(PluginManager.java:63)
at java.base/java.lang.Thread.dispatchUncaughtException(Unknown Source)
I have no idea how to repair this issue.
Must note there, that if we use Linux as main local machine (instead of using Windows, as i have to), there is no errors, and PyCharm runs normally.

It turns out this way: i need to install these packages inside my container under root:
apt-get install libxrender1 libxtst6 libxi6
So now i have pycharm displayed and it's interacting well.
The main tip was written and described there

Related

Apache Spark - Quick Start "java.lang.NoClassDefFoundError: scala/Serializable"

I am trying to follow this guide https://spark.apache.org/docs/latest/quick-start.html (scala). However, I cant complete the last step when I'm supposed to submit the jar file to spark.
# Use spark-submit to run your application
$ YOUR_SPARK_HOME/bin/spark-submit \
--class "SimpleApp" \
--master local[4] \
target/scala-2.12/simple-project_2.12-1.0.jar
I get the following exception
Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: scala/Serializable
at SimpleApp$.main(SimpleApp.scala:9)
at SimpleApp.main(SimpleApp.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)
at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:958)
at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)
at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)
at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1046)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1055)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.NoClassDefFoundError: scala/Serializable
... 14 more
Caused by: java.lang.ClassNotFoundException: scala.Serializable
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more
Any idea what is causing this?
You need to upgrade the dependencies to versions that are binary compatible to your Scala version.
Looks like 2.12 in this case.
I found the problem. I had the wrong Spark version installed. I had downloaded the "Pre-built for Apache Hadoop 3.3 and later (scala 2.13)" version. Installing the "Pre-built for Apache Hadoop 3.3 and later" spark version solved the problem.

Sonarqube produces build error using the new Team Foundation Build

I have a problem integrating Sonarqube in the Build process with the Build-Tasks in Visualstudio Online.
My Konfiguration:
SonarQube 5.2 with LDAP using the Active Directory to Login in SonarQube
I use a reverse Proxy (IIS 8.5) as recommended on the Sonarqube homepage to access Sonarqube over a public Endpoint. This is nessacry because I use a public Build-Server, so that he can reach the Sonarqube Server.
I have no problem accessing Sonarqube over the Web. I got prompt for the credentials. I can login with my domainuser and browse without any Problems. If I use the private Endpoint I got login automatically. It seems to me that some informations for the login got lost over the reversed proxy.
Now the actual problem:
If I start a Build as mentioned bevor, I get the folowing error while the "End-Analyses" Task. The error occurs running the sonarrunner.
ERROR: Error during Sonar runner execution
org.sonar.runner.kevinsawicki.HttpRequest$HttpRequestException: java.net.SocketException: Connection reset
at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1392)
at org.sonar.runner.kevinsawicki.HttpRequest.ok(HttpRequest.java:1417)
at org.sonar.runner.impl.ServerConnection.downloadString(ServerConnection.java:93)
at org.sonar.runner.impl.ServerVersion.downloadVersion(ServerVersion.java:47)
at org.sonar.runner.impl.ServerVersion.version(ServerVersion.java:38)
at org.sonar.runner.impl.ServerVersion.is37Compatible(ServerVersion.java:58)
at org.sonar.runner.impl.JarDownloader.checkVersionAndDownload(JarDownloader.java:36)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:71)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.net.SocketException: Connection reset
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1390)
... 15 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderField(Unknown Source)
at org.sonar.runner.kevinsawicki.HttpRequest.header(HttpRequest.java:1903)
at org.sonar.runner.kevinsawicki.HttpRequest.contentType(HttpRequest.java:2308)
at org.sonar.runner.impl.ServerConnection.downloadString(ServerConnection.java:89)
... 13 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
The sonar-runner did not complete successfully
I reserached a lot but can't find any solution for my problem. Can Someone help?
Edit:
If I use the the private Endpoint to integrate Sonarqube in the Build there are now Problems. in this case The Sonarqube Analyses works fine. But I need to get this work over the public endpoint using the reverse proxy redirecting to the local machine.

nodejs plugin for dalek on Jenkins configuration issues questions

We are trying to run dalek on a Windows box with Jenkins.
We installed nodejs binary on the Windows box.
We installed the nodejs plugin on Jenkins.
When we run our job, we get this error:
[Test] $ C:\Windows\TEMP\hudson1848754731046994976.js
FATAL: command execution failed
java.io.IOException: Cannot run program "C:\Windows\TEMP\hudson1848754731046994976.js" (in directory "C:\jenkins\workspace\Test"): CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:763)
at hudson.Launcher$ProcStarter.start(Launcher.java:353)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:988)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:955)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 17 more
What does this error mean ?
Is there a workaround to get us to run dalekjs ?
Thanks
First, make sure that you have configured the nodejs installation path in jenkins. If it still doesn't work try to create a symlink folder called bin in your node installation path pointing to itself.
This was how I did it. Open a terminal and execute:
mklink /j "C:\Program Files\nodejs\bin" "C:\Program Files\nodejs"
Have you defined nodejs installation path in Jenkins configuration?

How do I open NetBeans projects, created in Windows 7, in Ubuntu?

I saved all of my NetBeans projects onto a folder in my dropbox account on windows, but now when I tried to open one in NetBeans on Ubuntu (14.04) nothing happens, and I get an error message. I've check the JDK is the same, so I'm not sure what else could be the problem. Any help would be appreciated!
The whole error message is displayed below:
java.lang.ClassNotFoundException: com.sun.tools.javac.util.CancelAbort starting from ModuleCL#5ba607b4[org.netbeans.modules.java.source] with possible defining loaders [ModuleCL#531b49df[org.netbeans.libs.javacimpl]] and declared parents [ModuleCL#71ffd9f1[org.netbeans.modules.editor.mimelookup], ModuleCL#26c5920f[org.netbeans.modules.java.lexer], ModuleCL#503ca641[org.netbeans.modules.java.platform], ModuleCL#543d97af[org.openide.text], ModuleCL#419fb314[org.netbeans.modules.editor.indent.project], ModuleCL#1c04fc63[org.netbeans.modules.editor.lib], ModuleCL#71b87cd4[org.netbeans.modules.projectuiapi], ModuleCL#562390c0[org.netbeans.api.java], ModuleCL#1533a69e[org.openide.windows], ModuleCL#5d171820[org.openide.dialogs], ...26 more]
at org.netbeans.ProxyClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Caused: java.lang.NoClassDefFoundError: com/sun/tools/javac/util/CancelAbort
at org.netbeans.modules.java.source.parsing.JavacParserFactory.createParser(Unknown Source)
at org.netbeans.modules.java.source.parsing.JavacParserFactory.createParser(Unknown Source)
at org.netbeans.modules.parsing.api.ParserManager.findParser(Unknown Source)
at org.netbeans.modules.parsing.api.ParserManager.parseWhenScanFinished(Unknown Source)
at org.netbeans.api.java.source.JavaSource.runWhenScanFinished(Unknown Source)
at org.netbeans.modules.java.j2seproject.MainClassUpdater.addFileChangeListener(Unknown Source)
at org.netbeans.modules.java.j2seproject.MainClassUpdater.(Unknown Source)
at org.netbeans.modules.java.j2seproject.J2SEProject$ProjectOpenedHookImpl.projectOpened(Unknown Source)
at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(Unknown Source)
at org.netbeans.spi.project.ui.support.UILookupMergerSupport$OpenHookImpl.projectOpened(Unknown Source)
[catch] at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(Unknown Source)
at org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(Unknown Source)
at org.netbeans.modules.project.ui.OpenProjectList.doOpenProject(Unknown Source)
at org.netbeans.modules.project.ui.OpenProjectList.doOpen(Unknown Source)
at org.netbeans.modules.project.ui.OpenProjectList.access$2000(Unknown Source)
at org.netbeans.modules.project.ui.OpenProjectList$4.run(Unknown Source)
at org.openide.util.RequestProcessor$Task.run(Unknown Source)
at org.openide.util.RequestProcessor$Processor.run(Unknown Source)
It appears the Ubuntu Software Centre version I had installed was a version out of date. I got the new 8.0 version direct from NetBeans and it now works.
Although this is not the perfect solution, it's just a workaround. If it's a simple project you could erase the nbproject folder and create a new project with existing sources with that netbeans will re-create the project files.

Vuze client on Rhel 5 machine

I downloaded the vuze client for linux(Rhel 5) and xtracted the tar file.When I execute the vuze launcher I get the following error. Am trying to debug the issue , in the mean time any linux experts have any idea on this issue ? Someone tried to install vuze on linux and encountered this issue.
[root#localhost vuze]# ./vuze
Starting Azureus...
Suitable java version found [java = 1.6.0_24]
Configuring environment...
Java exec found in PATH. Verifying...
Browser check failed with: Cannot load 64-bit SWT libraries on 32-bit JVM
Auto-scanning for GRE/XULRunner. You can skip this by appending the GRE path to LD_LIBRARY_PATH and setting MOZILLA_FIVE_HOME.
checking /etc/gre.d/gre.conf for GRE_PATH
GRE found at /usr/lib/xulrunner-1.9.
Browser check failed with: Could not initialize class org.eclipse.swt.widgets.Display
Can't create browser. Will try to set LD_LIBRARY_PATH and hope Vuze has better luck.
setting LD_LIBRARY_PATH to: /usr/lib/xulrunner-1.9
setting MOZILLA_FIVE_HOME to: /usr/lib/xulrunner-1.9
Loading Azureus:
java -Xmx128m -cp "./Azureus2.jar:./swt.jar" -Djava.library.path="/root/Desktop/Downloads/vuze" -Dazureus.install.path="/root/Desktop/Downloads/vuze" -Dazureus.script="./vuze" -Dazureus.script.version=2 org.gudy.azureus2.ui.swt.Main
file:/root/Desktop/Downloads/vuze/Azureus2.jar ; file:/root/Desktop/Downloads/vuze/swt.jar ; file:/root/Desktop/Downloads/vuze/
changeLocale: *Default Language* != English (United States). Searching without country..
changeLocale: Searching for language English in *any* country..
changeLocale: no message properties for Locale 'English (United States)' (en_US), using 'English (default)'
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.gudy.azureus2.ui.swt.Main.<init>(Main.java:114)
at org.gudy.azureus2.ui.swt.Main.main(Main.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.aelitis.azureus.launcher.MainExecutor$1.run(MainExecutor.java:37)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
at org.gudy.azureus2.ui.swt.mainwindow.SWTThread.<init>(SWTThread.java:84)
at org.gudy.azureus2.ui.swt.mainwindow.SWTThread.createInstance(SWTThread.java:63)
at com.aelitis.azureus.ui.swt.Initializer.<init>(Initializer.java:163)
... 12 more
Exit from Azureus complete
No shutdown tasks to do
Azureus TERMINATED.
For some reason the swt.jar file inside the downloadable Vuze is for 64 bits systems. Just go to http://www.eclipse.org/swt/ and download the stable release from there.
Open the tar.gz and extract swt.jar and overwrite the one from vuze.

Resources