No X11 Display variable was set, installing netbeans from command line using MobaXTerm - netbeans

I am trying to install netbeans from the command line using mobaxterm on suse enterprise. I have set X11 Forwarding when creating the session. However, I still get the following error when I try to run the downloaded netbeans script:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
Exception: java.awt.HeadlessException thrown from the UncaughtExceptionHandler in thread "main"
I tried this solution, but it didn't cut it.
UPDATE
I was able to resolve this by manually changing sshd_config:
Under
/etc/ssh/sshd_config
Make sure you have the following set:
X11Forwarding yes
X11UseLocalhost no
PermitRootLogin yes

How do you connect?
Try echo $DISPLAY after ssh -X susehost. Depending from where you connect to susehost, X11 forwarding may not work.

Related

bash: powershell: command not found

For a node project I will have to work on a remote server and for that I will use filzilla for file transfer and ssh for console.
I use Visual Studio Code, I installed a remote ssh extension,
I did the hostname and user configurations as well as secretkey,
because before that I had another error The process tried to write to a nonexistent pipe ,
which I finally solved but now after I start ssh and log in with the password in cmd from Visual Studio Code, I get this error bash: powershell: command not found.
I tried one day to search the internet for that error.
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration?WT.mc_id=-blog-scottha
https://learn.microsoft.com/en-us/windows/wsl/troubleshooting
I've talked to people who have more experience but within the time limit my advice could be, but I still couldn't solve the error, either it's something from windows or ssh or I don't know.
You are the first time I try to do this in general I used heroku or aws that had some facilities.
I changed host machine in the settings JSON file windows to linux
When you got the option to Select Linux, Windows or Mac did you make sure that you know exactly the type of server you are connecting to. Bcs if you choose the wrong one this error gets thrown.

libreoffice6.3 error "Failed to open display" & soffice command not found. in cenos7

i'm using centos7, i have installed libreoffice6.3. it was working file before changing of my computer ip. but after changing ip it is not working. and then i have reinstalled many time. but still it's not working.
command & and outputs below
libreoffice6.3 --version ==== LibreOffice 6.3.4.2 60da17e045e08f1793c57c00ba83cdfce946d0aa
soffice --version ===== -bash: soffice: command not found
libreoffice6.3 ===== Failed to open display
I know this is old, but just a tip: Every time you need / want to use LibreOffice's functionality without starting up the GUI, add --headless the the soffice command. soffice --help says
Starts in "headless mode" which allows using the
application without GUI. This special mode can be used
when the application is controlled by external clients
via the API.

No X11 DISPLAY variable was set, but this program performed an operation which requires error when launching jmeter on Centos

I have installed jmeter on a server but when i try to launch jmeter i get the following error error
No X11 DISPLAY variable was set, but this program performed an operation which requires it
Jmeter installed on CentOS along with java.
I tried export DISPLAY=:0 and this export DISPLAY=:0.0 but no luck
run SSH command with "-X" param (without commas)
sample:
ssh user#server -X <enter>

netbeans 6.91 and gdb - attaching to a process run by another user

I am trying to debug a program run as another user, using Netbeans. I can do this manually at the command line, by running sudo gdm and then attaching to the pid.
However, I would like to make use of the Netbeans GUI for easier/quicker/visual debugging. When I select the pid from the list of running processes, I get the error:
GDB failed to attach to process
When I attempt to attach manually (i.e. by running gdb at the command line - without sudo), I get an 'Operation not permitted', so I know Netneans is failing to attach because of permissioning.
Does anyone know how I can attach to processes being run by another user?.
BTW I am running all this on my dev machine at home (Ubuntu), so security is not an issue.
Have you tried running netbeans as the target user?
You can do "sudo -u username netbeans"
With that, you shouldnt have a problem attaching to the process. If the target user is in another computer, I would suggest ssh with X forwarding (ssh -X user#machine).
Actually, if the target (local) user has no password set, you can try changing your gdb command to "sudo -u username gdb" to start the debugger as that user.

Running a GTK+ application on a Linux machine, from Windows

I have Installed GTK on a Linux machine.
I am connecting To Linux Machine from a Telnet Session to compile the GTK programs
From A Windows Machine. I am using Cygwin on Windows Machine. but i am not able to see
GUI output of my GTK program on my Windows Machine.
When i run program from my terminal i get this error:
(helloworld:22576): Gtk-WARNING **: cannot open display:
I tried solutions from every answer posted, but no use now i am getting following error:
$ ./helloworld
Invalid MIT-MAGIC-COOKIE-1 key
(helloworld:22710): Gtk-WARNING **: cannot open display: 172.25.0.161:0
and i am getting following error on my Cygwin console:
client 6 rejected from IP 172.25.0.91 Auth name: MIT-MAGIC-COOKIE-1 ID: -1
You must set the DISPLAY variable in your telnet session to the IP address or DNS name of your Windows machine and append ":0"
export DISPLAY=windows.your.domain:0
And you must start an X server on the Windows machine (comes with Cygwin but you must start it).
You need to run the X window system (install with Cygwin) on your Windows-box and enable remote connections (probably with xhost). Set the DISPLAY-variable on your Linux-box to the address of your Windows-box and :0, as such:
export DISPLAY=192.168.1.123:0
I can recommend using ssh rather than telnet, for security reasons. In this case you do not need to enable remote connections with xhost, and you do not need to set the DISPLAY-variable. You only need to enable X forwarding.
You should install X-server on your windows machine and make sure you have DISPLAY set to yourmachine:0 or something like that. Or better yet use ssh instead of telnet (e.g. putty) and tunnel your X connection. You'll have to do a bit on your own research, though, because the complete answer would be a lengthy one.
Install an small X server on Windows XMing32, then run it, use putty as a console client, and check "X11 Forwarding" in Connection->SSH->X11.
Unfortunately, X11 Forwarding is not available through Telnet, you must run a SSH server on the target Linux and connect through SSH. (See if /etc/ssh/sshd_conf requires enabling X11 Forwarding too).