why xdotool getactivewindow results in XGetWindowProperty[_NET_ACTIVE_WINDOW] failed? - x11

Running xdotool getactivewindow in the terminal results in
XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)
xdo_get_active_window reported an error
But I am almost sure that it was working some time ago...
How to solve this issue?
I am using Ubuntu 22.04.1 LTS and xdotool version 3.20160805.1.

For an unknown reason, I was using wayland when this issue happened...
For another unknown reason, a reboot makes me switch back to X11, and then the issue is finally gone!

Related

When I use a terminal or zsh I can't run commands, And this is what appears: /dev/fd/14:18: command not found: compdef

When I use a terminal or zsh I can't run commands, And this is what appears:
# /dev/fd/14:18: command not found: compdef #
Does anyone know how to reset the terminal to normal mode?
I tried to solve it and the only thing that got my terminal back to normal is the elapsed time, but the problem is not solved because this line keeps repeating again, and then I'm stuck
I understood what the problem was, I just installed the latest version of Node js, and that's why I had this problem, when I reverted to a previous version it solved the problem
I had a similar situation today, and after looking up the information, it was the reason why I installed Angular

Multipass totally broken on MacOS & multipassd error logs

The com.canonical.multipassd service is constantly logging errors on my Mac and multipass won't work at all, even after reinstalling, rebooting, and updating my Mac.
In an attempt to use my GPU in a Linux VM through multipass, I tried to install the AMDGPU driver for my card (Radeon Pro 5300 4GB). I had installed multipass through brew and made some progress, but the ./amdgpu-install process was returning various errors as a result of missing dependencies. Having started to resolve the missing dependencies, in an attempt to build the driver again, the build just stopped halfway through and I couldn't terminate the process or get the VM to respond at all (didn't take a screenshot sorry).
Because of this, I closed the VM shell and tried to get multipass to shut down the VM. Multipass stopped responding altogether - the application just spun, and it didn't respond at all in terminal. I force quit multipass in Activity Monitor. That still didn't fix it, so I (somewhat stupidly) force quit 'hyperkit' and 'multipassd'. This is where everything went really wrong.
Having force quit 'multipassd', I tried to re-open multipass, but it returned the error below
list failed: cannot connect to the multipass socket
Please ensure multipassd is running and '/var/run/multipass_socket' is accessible
I looked this up and tried a few suggested solutions. I uninstalled multipass with Brew. I deleted the application, and reinstalled with brew. I also tried brew remove multipass, and tried installing using the .pkg from the multipass website. When that didn't fix it, I restarted my computer and reset NVRAM on startup. That also didn't make a difference, so I have just updated my Mac to MacOS 11.4, and it is still not fixed.
The console logs suggest that multipassd is still doing something, as it is continually logging in the system.log:
May 26 09:39:15 <myName> com.apple.xpc.launchd[1] (com.canonical.multipassd[2131]): Service exited with abnormal code: 1
May 26 09:39:15 <myName> com.apple.xpc.launchd[1] (com.canonical.multipassd): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
In the multipass log, this message is also being generated about once every 10 seconds:
[error] [daemon] Caught an unhandled exception: Invalid MAC address
[warning] [Qt] QMutex: destroying locked mutex
These messages are being generated even after resetting NVRAM and rebooting. I think they're the cause of my issue launching multipass, but I haven't found any solution to stop them, and I can't identify any process that is still running related to multipass. As far as brew is concerned, multipass is not installed, but it's logs are still filling up...
Happy to provide console or terminal output if needed - nothing else on my Mac seems to be broken, I just can't use multipass now. I do have a time machine backup, so if that is guaranteed to fix it, I might just resort to the backup, but I'm not sure that would necessarily fix it, and I would rather find an alternative solution.
As this has probably made clear, I'm very new to Linux and VMs... any solutions greatly appreciated!
Fixed it!! I hadn't properly uninstalled it - the 'proper' uninstall script can be run using
sudo sh "/Library/Application Support/com.canonical.multipass/uninstall.sh"
Reinstalling multipass after running this command worked fine.

XQuartz $DISPLAY problems, cannot open xclock locally, cannot ssh -X

I am trying to solve a cascading series of bugs that started with me not able to copy to my macOS clipboard from remote ssh and has lead me to realize my X11 situation is seriously messed up. I have read a few other stackoverflow threads and they do not address my particular problems.
First my setup is macOS Mojave 10.14.5. I have xquartz 2.7.11 installed from the website. When I run echo $DISPLAY locally (on macOS) I get /private/tmp/com.apple.launchd.waagOnO6Qm/org.macosforge.xquartz:0.
Since I don't know where the error actually is I will list two problems I can identify currently.
Two problems:
If I run xclock locally nothing happens inside my terminal. I do notice that an "active" dot appears under the XQuartz dock icon for a second and then disappears. But after this happens my terminal still just hangs at xclock as though it is running.
If I try to ssh -X remote into a remote machine my terminal is locked out. I cannot keyboard interrupt. I ran this with -vvv to try to debug and I see that it hangs with xauth:
debug2: client_x11_get_proto: /opt/X11/bin/xauth -f /var/folders/jw/ltyk9x9n0_xb61jhdnct27fr0000gn/T//ssh-vcqwT7qh5yk2/xauthfile generate /private/tmp/com.apple.launchd.waagOnO6Qm/org.macosforge.xquartz:0 MIT-MAGIC-COOKIE-1 untrusted timeout 1260 2>/dev/null
Attempts to Solve
Other related stack threads have suggested reinstalling XQuartz, which I have done, both manually and with Homebrew. I have logged back out and in following reinstallation.
This thread suggested I solve my xauth problem by deleting .XAuthority file and recreating it. However, when I
xauth generate :0 . trusted
My XQuartz pops up a window saying XQuartz quit unexpectedly which I can provide the Report for if it helps. Then in the terminal it says
xauth: (argv):1: unable to open display ":0". Also I'm not sure this is the problem anyway because my .XAuthority file already contained an entry that it looks like this is trying to produce:
$HOST/unix:0 MIT-MAGIC-COOKIE-1 db7738324ca3662767b20b97b4a68680
Though it is concerning that running xauth is causing my xquartz to repeatedly quit unexpectedly (this dialog box is appearing multiple times).
This has been very frustrating to debug because I am not sure where the problem is, with xauth or xquartz somehow even though it is newly installed. Further, existing StackOverflow threads I have found detail the problem only with ssh -X but clearly I'm having problems locally, given that I can't even run xclock.
Any help is greatly appreciated.
The dot appearing and disappearing quickly indicates that the server process is terminating. This means that either the server crashed, the managing client (eg ~/.xinitrc) terminated, or we failed to even start xinit.
Almost every case I have ever seen of this has been due to someone doing something wrong in their init scripts (eg: ~/.bash*, ~/.profile, ~/.xinitrc).
Remove those and try again, then bisect to figure out the underlying issue.
However, the crash dialog from your "ssh" case indicates that it is likely the server crashing. You will need to look at the crash log for more information (or provide it here if you want help with that).

Installed version: N/A

Help solve the problem with powershell.
I use as a console git bash. VT-x enabled. Hyper-v disabled.
Problem in
The version of powershell currently installed on this host is less than
the required minimum version. Please upgrade the installed version of
powershell to the minimum required version and run the command again.
Installed version: N/A
Minimum required version: 3
Installed powershell 6.
The error usually occurs when entering
vagrant ssh
or
vagrant up
It's funny that the problem is solved by re-entering vagrant up or vagrant ssh.
What is the problem ?
p.s. Sorry for bad English :)
The comment by Theo solved the issue for us.
powershell -Command 'vagrant up'
Executing vagrant ssh next works as expected AND is also a little faster.

Error running selenium ruby script through xvfb-run

What I'm trying to do
Use selenium and its ruby bindings to open chrome and read a value from the DOM. This portion works great however I need to run it on a linux server headlessly. Seemed easy enough so I ran it using xvfb-run using this command:
export PATH=$PATH:./bin
xvfb-run --server-arg="-screen 0, 1024x768x16" ruby script.rb
The first line adds the binary chromedriver to PATH and the second lines runs the script through xvfb. I got this working on an EC2 ubuntu box which is essentially a dev box. Everything is great.
Now comes time to run it on another EC2 ubuntu box using the same bash script. It spits out an error that the chromedriver binary couldn't be found. Odd since it worked fine on the other box. I checked, the binary is there. I manually add it to the path and run the bash script again, same error. After some troubleshooting and googling I found this:
https://code.google.com/p/selenium/wiki/ChromeDriver
This advises that the chromedriver needs to be symlink'd to /usr/bin/google-chrome. Again odd since it works fine on the other box and my local machine without this symlink. I symlinked it to this location and now this is the error I'm getting:
/usr/local/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/remote/response.rb:51:in `assert_ok': unknown error: Chrome failed to start: exited abnormally (Selenium::WebDriver::Error::UnknownError)
I've never gotten this on my local or dev box. Any ideas? Is this an issue with chromedriver, xvfb or the environment its running in? Some difference in the deploy box that would be different than the dev box I'm missing?
I figured this out. Misunderstanding the directions here. Installed google-chrome in /usr/bin and it worked.

Resources