X11 forwarding not working (using Putty to connect to a CentOS 8 VM). What can be wrong?
I simply can not make graphic softwares run on my CentOS 8 VM. I installed it with no GUI support.
I have Xming running.
I am using Putty (my local machine is Windows 10), has checked the X11 Forwarding box, has already edited sshd_config
file following http://www.straightrunning.com/XmingNotes/trouble.php instructions and when trying to run sudo gparted
I keep getting
Unable to init server: Could not connect: Connection refused
(gpartedbin:1559): Gtk-WARNING **: 19:22:28.507: cannot open display:
--runtime cannot be used with unmask
Any hints?
See also questions close to this topic
-
Can I download all images of a specific folder of website
There is a folder in a website e.g. https://websiteName.com/Global/Images/ and I want to download all images that resides in
Images
folder. How can I proceed?Thanks in anticipation
-
Missing / different files in cifs mount
I am facing a very strange problem. On two centos servers there are four NAS storages mounted via cifs, and all of them have folders made with capital and small letters e.g.
/Preview/g/0j/
/Preview/g/0J/
/Preview/G/0j/etc.
The system used to work fine, with both folders (with the small letter and the capital letter) accessable independantly as two distinct folders. Now for some time, the situation is messed up, where if I list files on "g/0j" and "G/0j", I see the same files, so apparently one folder is hidden altogether. The situation gets more complex, when sometime I see one set of files and sometime I see another, and it gets further complicated when I see two different set of files in the same folder when accessed from the two different centos machines.
I am unable to see any issue in the logs on the centos machines. The storages are VTrak by Promise.
It does not appear to be a storage problem, because the same situation is on all the four storages, however I am not sure how to find out where the problem is and fix it.
Need help.
-
Cannot log in to the MySQL server after change pass root@localhost
After changing the root@localhost password in MySql, I cannot log into MySql through the root. Error "Cannot log in to the MySQL server". I tried to log in from local machine and from outside. How can I safely get into the database via root again? Ps> OS Centos
-
C++ CIMG suddenly stopped opening display
I have now been working on a c++ project for quite some time now. I have been opening the display with the same method every time, passing a set path into a
CImg<unsigned char>
and then passing that object into theCImgDisplay
, quite standard, and it worked every time. Then, I started passing the path through command-line arguments, which also worked perfectly well. However, once I switched back to hardcoding the path in order to use the debugger in VS Code, the program started spitting out a very descriptive error:After doing some digging around, I found a bit better of a description of the error:
[CImg] *** CImgDisplayException *** [instance(0,0,0,[untitled])] CImgDisplay::assign(): Failed to open X11 display. libc++abi.dylib: terminating with uncaught exception of type cimg_library::CImgDisplayException: [instance(0,0,0,[untitled])] CImgDisplay::assign(): Failed to open X11 display.
When running the program from the command-line (compiles perfectly), the error is a
Segmentation fault: 11
.I tried to look online for the same error, even not related to CIMG as this is an X11-related error, but couldn't find anything. The error persisted when I commented out the whole main function instead of the two image and display declaration lines. The code is like follows:
#define cimg_use_png #include "CImg.h" #include <vector> #include <algorithm> #include <iostream> using namespace cimg_library; using namespace std; int main(/*int argc, char *argv[]*/) { //CImg<unsigned char> og_pic(argv[1]), first_anim(og_pic.width(),og_pic.height(),1,3,127); CImg<unsigned char> og_pic("/Users/glebsvarcer/Desktop/my-stupid-little-programs/maze_solver/test13.png"); CImgDisplay disp(og_pic, "Test"); return 0; }
I am compiling with
clang++ -g /Users/glebsvarcer/Desktop/my-stupid-little-programs/maze_solver/cleanup_pic.cpp -O2 -lm -pthread -I/usr/X11R6/include -L/usr/X11R6/lib -lm -pthread -lX11 -o cleanup -Dcimg_use_png -lpng && rm out.txt ; cleanup >> out.txt
What could be causing this? I really can't move on in the project without the debugger, and would be really grateful if anyone has a solution to this.
-
X11 DefaultRootWindow Segfault Only When Program is Run by Systemctl
I'm new to both Linux and C development, trying to take a screenshot in C with the X11 libs. If I compile and run my program normally, the screenshot is properly taken with no issues. If I run my program as a service, like
sudo systemctl start screenshot
The program fails. Both the logs and analyzing the coredump with GDB only say
Program terminated with signal SIGSEGV, Segmentation fault.
I have set up manual logging in my code:
int main(int argc, char** argv ){ FILE *fp = fopen("log.txt", "w"); setvbuf(fp, NULL, _IONBF, 1024); fputs("2", fp); Display* display = XOpenDisplay(NULL); fputs("5", fp); Window root = DefaultRootWindow(display); fputs("6", fp);
When run as a service, log.txt contains the sequence 25. If run from terminal like ./screenshot, the program terminates normally.
Any hints on finding the cause of the issue would be appreciated.
-
X11 forwarding is working well on a cluster login-node but not within interactive qsub job
I am trying to set up a X11 connection for an interactive qsub job which is not working at the moment. I am accessing the login-node via
ssh -Y user@loginnode
from Linux, which is working fine. I can run the xClock example directly on the login-node without any issue.When I start an interactive qsub job like:
qsub -I someJobScript.qsub
orqsub -X -I -V someJobScript.qsub
or evenqsub -X -I -v DISPLAY someJobScript.qsub
Then I get the following error by executing xClock:
libxkbfile.so.1: cannot open shared object file: No such file or directory
echo $DISPLAY
is differing from within or outside the qsub job in all 3 cases but explicitly setting the DISPLAY variable to match the login-node does not help either.What did I misunderstand here and set up wrong?
For reference (cluster):
-bash-4.2$ qstat --version Version: 4.2.10 Commit: ddf5c4f40091b6157164a8846e5b60f42a5ae7f6 ... Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-957.5.1.el7.x86_64 Architecture: x86-64
Thanks
-
Remote Jupyter kernel (over ssh) crashes when X11 connection is closed
My python analysis setup:
I run long sessions of a Python3 console on a ssh server. I keep them running inside tmux across multiple connections. I either run IPython3, or more recently I launch a
jupyter kernel
that I connect to a console usingjupyter console --existing kernel-358b-xxxxxx.json
.I need to use matplotlib to draw graphs, but this requires a connection to a forwarded X11. Therefore, I use
ssh -XY
, and ensure that theDISPLAY
variable is set correctly before running the kernel/console. I then plot things interactively using the%matplotlib
magic, which uses the "TkAgg" backend.Ssh disconnect and reconnect loses the X11 server and crashes python
First, when disconnecting from the server (Ctrl-D), the connection does not close until I hit Ctrl-C. I suspect this is killing the X11 connection initiated by Python. The jupyter kernel then throws the following error:
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server "localhost:11.0" after 8432 requests (8432 known processed) with 0 events remaining.
and usually I need to restart the kernel entirely, losing all variables. This is a major hurdle in my workflow. I have tried running the pyplot command
plt.switch_backend("Agg")
to stop using X11 before disconnecting, but it does not help.Question
How to disconnect a jupyter kernel from X11 to avoid crashes between ssh sessions? Maybe a jupyter kernel code could be executed via
jupyter-run
?Note that it is not possible to allow a local jupyter console to connect to the remote kernel because of network limitations on my work server (currently basic ssh-ing works, but not port forwarding).
-
TBrowser won't open (ROOT)
I have installed the ROOT program on ubuntu shell, but I have some problems when I try to run the TBrowser. Somehow the TBrowser don’t show up when I type “new TBrowser()” , but instead I get the following message:
root [0] new TBrowser() Error in TGClient::TGClient: can’t open display “localhost:0.0”, switching to batch mode… In case you run from a remote ssh session, reconnect with ssh -Y (TBrowser *) 0x55b6b4e54b70
I have installed the Xming program and entered “export DISPLAY=localhost:0.0” in the bashrc file, but the problem persists. When I type xclock I get the message: Error: Can’t open display: localhost:0.0
So I guess my problem is not with root but with the X server ?
-
Configuring X Server of Windows 10 for WSL 2
I know this issue is documented heavily and there are intricate details that are easy to miss. I tried a lot of ways by reading articles to get this working for almost a complete day.
I will describe my problem briefly:
I have installed Ubuntu 18.04 (WSL 2) on my Windows 10 (Version 1909 - OS Build 18363.1316). I am trying to open gvim files from Ubuntu in windows 10 using X server/client setup. The X Server on Windows 10 crashes 15-20 minutes after starting it.
The steps I have followed for setup of X Server/Client are:
Configured the X Client on Ubuntu by
a. setting DISPLAY variable to IP address from /etc/resolv.conf with 0.0 attached at the end (WSL2)
b. setting LIBGL_ALWAYS_INDIRECT variable to 1
Installed ssh and xdm packages on Ubuntu and starting them up on opening the terminal using
a. sudo service ssh start
b. sudo service xdm start
c. After starting both Xserver and Xclient, I checked the connectivity on TCP port 6000 with the following command
nc -v <IP Address from Step 1.a> 6000
On the X server setup on Windows 10
a. I downloaded Xming and installed it
b. I enabled Xming application in Windows Firewall on Public, Private and domain networks
c. I configured XLaunch to run the following command (setting the flag "disable access control")
Xming :0 -multiwindow -clipboard -ac
I can open my gvim files in windows but the issue is the server automatically closes after a few minutes (say 15-20 minutes). I looked at the log file of the Xming server. It shows something below:
winInitMultiWindowWM - Could not open display, try: 5, sleeping: 5
winInitMultiWindowWM - Failed opening the display. Exiting.
winMultiWindowXMsgProc - Failed opening the display. Exiting.
winProcEstablishConnection - Hello
winInitClipboard ()
winProcEstablishConnection - winInitClipboard returned.
winClipboardProc - Hello
DetectUnicodeSupport - Windows Vista
winClipboardProc - DISPLAY=127.0.0.1:0.0
winClipboardProc - Could not open display, try: 1, sleeping: 4
winClipboardProc - Could not open display, try: 2, sleeping: 4
winClipboardProc - Could not open display, try: 3, sleeping: 4
winClipboardProc - Could not open display, try: 4, sleeping: 4
winClipboardProc - Could not open display, try: 5, sleeping: 4
Few Key points to note:
I observe that sleeping value reduces after every iteration of trying and the server gets killed when the sleeping = 1
I first open the Ubuntu and start the services ssh, xdm. Then, I open XLaunch and configure it to start the Xming server. I have tried the vice-versa as well
I also tried installing and running VcxSrv with the right config settings and I am facing the same issue. I can post the log file of VcxSrv application
Please help me to figure this out.
Thanks,
Bharadwaj