output
stringlengths 9
26.3k
| input
stringlengths 26
29.8k
| instruction
stringlengths 14
159
|
---|---|---|
Add these lines to the ~/.config/xfce4/terminal/accels.scm file.
(gtk_accel_path "<Actions>/terminal-window/paste" "<Primary>v")
(gtk_accel_path "<Actions>/terminal-window/copy" "<Primary>c")Note that these lines don't start with a semicolon, which starts a comment in Scheme.
|
This is basically the same question as
How to set ctrl+c to copy, ctrl+v to paste and ctrl+shift+c to kill process in xfce4-terminal?, but not a duplicate, because neither of the answers helped.
Alex Kaszynski's answer suggests modifying the
~/.config/xfce4/terminal/accels.scm file.
I did that: I have changed two lines:
; (gtk_accel_path "<Actions>/terminal-window/paste" "<Primary><Shift>v")
-->
; (gtk_accel_path "<Actions>/terminal-window/paste" "<Primary>v")and
; (gtk_accel_path "<Actions>/terminal-window/copy" "<Primary><Shift>c")
-->
; (gtk_accel_path "<Actions>/terminal-window/copy" "<Primary>c")but neither of those helped;
the interrupt is still assigned to Ctrl+C.
(I would probably need to make it unbind and rebind
to Ctrl+Shift+C,
but do not know how to do so.)How to map "copy" from Ctrl+Shift+C to Ctrl+C
Remap interrupt from Ctrl+C
to Ctrl+Shift+C
Remap "paste" from Ctrl+Shift+V to Ctrl+V | How do I switch <Ctrl+C> from interrupt to copy, and <Ctrl+Shift+V> to <Ctrl+V>, in xfce4-terminal? |
Your pager displays its contents in the alternate screen buffer, which selects “alternate scroll mode” (which you can see because the vertical scroll bar changes — it no longer allows scrolling the window contents), and in that mode, the terminal translates mouse wheel movement to cursor up/down controls. This was introduced in XTerm a long time ago and is widely supported in current terminals.
To see what sequence is used to switch to the alternate screen buffer, run
tput smcup | od -aYou should see esc [ ? 1 0 4 9 h. This is what the pager sends to the terminal. ↓ is represented by CSI B which the terminal sends to the running application.
If your pager is less, you can disable this by exporting LESS=X to the environment (this skips terminal initialisation).
|
man itself shouldn't know anything about mouse wheel, and the scroll bar of the xfce4-terminal window doesn't change, so...
Did xfce4-terminal send something to the pty master fd when the window captures mouse wheel event from X server?
If yes, what does it write to the pty device to act like I pressed the Down Key?
Or am I completely missing something?
| Why can I use mouse wheel to scroll man page in xfce4-terminal? |
The && concatenation operator causes the second command not to be executed until after the first command (xfce4-terminal) exits (and only if the exit status indicates success, since it is a short-circuit logical operator).
You should get the behavior you expect if you change && to ; or simply place the wmctrl command on a separate line of your script.
|
If I type these two commands in a terminal:
xfce4-terminal --hide-menubar --hide-borders --hide-toolbars --title=dt
wmctrl -r dt -e 0,10,10,720,720I get the desired result (position and resize of window with title dt, noting than unlike gnome-terminal, xfce4-terminal doesn't rewrite manually assigned titles)
Naturally I would expect this to work:
#! /bin/bash
xfce4-terminal --hide-menubar --hide-borders --hide-toolbars --title=dt && wmctrl -r dt -e 0,10,10,720,720The terminal displays itself with the correct settings and title but wmctrl is having no effect whatsoever.
| WMCTRL not working after starting xfce4-terminal |
In the launcher preferences window, enter this as the command:
bash -c "context file.tex; exec bash"Then check the option "Execute on terminal".
That will execute Bash on terminal, running the 2 commands between quotes, instead of an interactive shell. The first one is, of course, your compiling. The second one replaces our non-interactive shell with a interactive one, so you can use it after the compiling finishes.
|
I have a few files on my computer that I need to compile frequently while editing, e.g.:
context file.texI tried to add a launcher to the XFce4 panel that will open xfce4-terminal and compile this code, however, none of the commands I try in the launcher preferences window work.
How can I add a launcher to the XFce panel which opens a terminal, compiles, and after finishes leaves the terminal open?
| How to add a launcher that compiles some code in a terminal in XFce? |
Give a try to this, I tested and looks good.
xfce4-terminal -x bash -c 'trap "zenity --info" EXIT; bash'When executed, it opens a new xfce4-terminal, and executes the command following. This command is a shell trap. That means when this same process, the new-opened terminal, gets the signal to EXIT, will execute the quoted command. The last bash is to give a prompt, after the trap is set, like in this post. I also tried -H but didn't work as expected.
|
#!/bin/sh
xfce4-terminal
zenity --info
exitExpected behavior on my Xfce4 desktop when the script is run (via a keyboard shortcut) is that the Terminal window appears. Only when I close same should the Zenity window then appear.
Normally, this is exactly what happens. However, if I first open an Xfce4 Terminal window on the desktop, then command the subject script (again, via a keyboard shortcut), another terminal window appears (as expected), but, simultaneously, so does the Zenity window. This is undesired behavior.
I have tried many things, including the wait command and appending the terminal line with &&. Nothing is working for me.
What is causing this to happen and how can I remedy it?
| Can't Stop Simultaneous Step Execution in Shell Script - xfce4-terminal command |
This problem is due to vim trying to use undercurls (wiggly underlines) rather than normal underlines, but being configured incorrectly.
Check that your terminal supports undercurls by trying to print some:
echo -e '\e[4:3mcurly underline (new in 0.52)\e[4:0m'If they display correctly then the problem is due to vim. Most likely due to vim's t_Cs and t_Ce variable being set incorrectly.
There is a related issue here, which recommends adding the following to your .vimrc:
let &t_Cs = "\e[4:3m"
let &t_Ce = "\e[4:0m"After doing this undercurls started being displayed in vim for me.
|
When I enable vim's spellchecker using :set spell underlines appear under any misspelled words in urxvt.
However, when I try the same in xfce-terminal (on the same machine, using the same .vimrc and ediing the same file) no underlines appear. The spellchecker is still working as misspelled words can be navigated between, it is just the underlines that are not showing.
Does anyone know what settings in vim or xfce-terminal are causing this to happen.Edit: This seems to be an issue specifically with vim rather than the terminal itself. Underlines printed using echo still display correctly, i.e:
echo -e "\e[4munderline\e[0m" | Vim Spelling Underline Shows in urxvt but not xfce-terminal |
First, can you see all the edges of the terminal window when in full screen mode? If the bottom edge is not visible, it might be that your display is mis-adjusted so that the bottom part of the image goes beyond the screen. That can usually be fixed using the controls in the actual physical display.
If that's not the problem, then make sure the xterm package is installed (install it if necessary) and then run
eval $(resize)in the terminal window that is suffering from the problem.
If you're using su or sudo to transition from one user to another within a terminal session, that will interrupt the passing of the "terminal has been resized" signal (SIGWINCH) from the terminal emulator (running as the original user) to the shell/application in question (running as a different user). The command above will force the re-evaluation of terminal screen size, as a substitute for the missing signal.
If this does not help, try changing the font in the terminal you're using: if the font you're using misreports its character height slightly, it might accumulate an error of about 9 lines when using full screen mode, but depending on the resolution of your screen, the error might be unnoticeable when using a smaller terminal window (e.g. the classic 80x24 default size). If changing the font helps, consider making a bug report for the font package containing the original font.
|
My terminal works normally but when I hit the bottom of the screen it doesn't start scrolling upwards until I'm about 9 lines off screen. So I can see what I typed if I hit enter 9 times.
This only happens if the terminal is full screen, if I make it smaller then it will scroll normally when I hit bottom.
Where is this set?
Edit: I'm using XFCE Terminal. Ubuntu 18.04.4 LTS
| How to fix a Full Screen Terminal that believes it is 9 lines bigger than it is |
I was able to solve the issue by uninstalling and reinstalling the software. Since it was originally installed via ports, I just issued the commands (as root)
# cd /usr/ports/x11/xfce4-terminal/
# make deinstallThen reinstall
# make install cleanThe interesting thing was it was a re-installation of the same version (not an upgrade) - v0.8.6.
|
I have a very interesting issue with xfce4-terminal and I don't know how to fix.
The geometry settings are scaled extremely small. By that, I mean I have a geometry of 80 cols by 40 cols and I get a window that is effectively 27x3 (see below), which I think is the very minimum it will open. If I specify 120x80, it's roughly the same.However, if I change the settings in preferences to something outrageous like 5000x750 I get a normal sized window that doesn't need to be resized to be workable in. This happens regardless if I set it in preferences or I launch it from CLI with the --geometry flag:
/usr/local/bin/xfce4-terminal --geometry 5000x750I am using the Monospaced 12pt regular font, but I have tried changing to others to see if it had any effect, but nothing gives.
I don't have this issue in Xterm - I get an 80x40 window when I launch it. I also don't have this issue with any other application that I lauch; just xfce4-terminal.
If anyone knows how I can fix this, I would be greatly appreciative.
FreeBSD 11.1, Xfce 4.12.
| xfce4-terminal geometry is scaled extremely small |
You could use wmctrl to tell the window manager to activate it (raise it and give it focus):
wmctrl -ia "$WINDOWID" |
Currently using Xfce and xfce4-terminal, but suggestions involving other Linux-based systems may still be helpful.
I start a longish-running program in a terminal window, then alt-tab away and do other work. Is there a way to have a program in that session request that its window be marked 'Urgent' and/or 'Presented' to the user? When I'm writing a graphical program, say using GTK2, I can do that easily enough; it ought to be theoretically possible, but I don't know of a way to do it.
| 'Present' terminal window on shell/executable command? |
It's indeed xfce4-popup-whiskermenu.
However the command is only available from a certain version of the whisker menu. Most probably that other distribution had a newer version of it.
Check your currently installed version in the application manager. The newest is 1.1.1, which contains the popup command.
Follow the instructions here to get the newest version:
http://forums.linuxmint.com/viewtopic.php?f=61&t=141150
|
What is the command that launches the whisker menu in the Linux Mint xfce edition. For another distribution that used xfce it was xfce4-popup-whisker menu but that doesn't seem to work. I would like to assign the super key to launch the menu.
| Linux Mint XFCE, command to launch menu |
Rather than autostart the terminal why not autostart SXHKD.
Create this file ~/.config/autostart/sxhkd.desktop
It should contain:
[Desktop Entry]
Name=sxhkd
Comment=Simple X hotkey daemon
Exec=/usr/bin/sxhkd
Terminal=false
Type=ApplicationHere's a worked example, where I tried the following on an Xfce installation I have in a VM.I used Settings > Session and Startup > Application Autostart.I added a new task with the command xfce4-terminal -e 'bash -c "sleep 5"'This added a file to ~/.config/autostart/ (not /etc/xdg/autostart)The contents were: [Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Terminal
Comment=Terminal test
Exec=xfce4-terminal -e 'bash -c "sleep 5"'
OnlyShowIn=XFCE;
RunHook=0
StartupNotify=false
Terminal=false
Hidden=falseThis worked perfectly, terminal appeared, hung around for 5 seconds, then closed.
When you launch the terminal with a command to execute, it does just that, executes the command. While it’s executing the command it’s not available for subsequent commands to be entered, hence no user@user prompt. Most commands are so quick you don’t notice this. In your case the sleep command makes it far more noticeable.
If you open a terminal normally and type something like firefox then Firefox should open. Leaving firefox open if you go back to the terminal you will see no user@user prompt waiting for you but you will still see the previous prompt and firefox command on the screen. You may also see a few error or warning messages. The Firefox command is running in the terminal so the terminal is busy with no user prompt waiting for input. If you then close the Firefox window the user@user prompt will be available in the terminal again.
You can get a terminal to open when you login with a user@user prompt ready by using just xfce4-terminal as your command in the auto launcher.
|
I thought this would be simple, but I have this issue where SXHKD bindings won't work after boot until a bash xfce4-terminal has been opened once.
So I tried opening a terminal on boot via rc.local, which is no good because it doesn't open with the ~/.config settings.
So I created a launcher put in /etc/xdg/autostart with Exec=
/Usr/bin/xfce4-terminal -e 'bash -c "sleep 1"'
Or
bash -c '/usr/bin/xfce4-terminal'
And dozens of other things, with the intent of momentarily opening bash, but nothing seems to work. For example I can't run the launcher from rc.local, either.
| Unable to launch terminal |
Don't have a fix, but this partial answer might be of some use, or at least provide some explanation for what's happening.
The effect you're seeing seems not to be a bug but instead due to "smart placement" of windows. I don't know if there's a way to completely disable smart placement or to have a moved tab appear in a window exactly overlapping the original window, but the behavior can be controlled to an extent.
There's a slider control on the Placement tab of the Window Manager Tweaks utility where the size of windows that trigger smart placement can be set. If the size is set toward the small end, the effect you describe occurs. Setting a sufficiently large size causes the moved-tab window to appear either at the center of the screen or under the mouse pointer depending on the radio button selected on the same tab. If the mouse pointer is over the original terminal window with the two tabs when the <ctrl>-<Shift>-D shortcut is executed, the moved-tab window will appear overlapping the original window more or less depending on the location of the mouse pointer at the time.
|
I am using xfce terminal on one side of screen, and many tabs. But when I want to use EOF interupt (aka <ctrl>-<Shift>-D), then the tab will remove its position from that side of screen to the other (see image below), I have even try to set -o ignoreeof but to no avail.
Before <ctrl>-<Shift>-D:after <ctrl>-<Shift>-D:As you can see, the first tab Terminal will get off the right side of screen to the other, only because of <ctrl>-<Shift>-D. Is there a way to fix this bug? (that is -> the tab where is EOF interupt triggered (Terminal in my case), will stay at its position (will be fixed), without moving randomly on the screen)? This is really annoying. Again - I do not want do disable EOF terminal at all, but rather disable to shift of the tab (where it was triggered) to another part of screen. Thanks in advance!
| How to disable to move one terminal tab by EOF (ctr-d) interupt on xfce terminal? |
I wasn't able to change the shortcuts using the "editable accelerators" and according to this post in the XFCE forum this only works for GTK2 applications.
You can change the defaults in ~/.config/xfce4/terminal/accels.scm (just like in your previous question How to switch from interrupt to copy, and to in xfc4-terminal?).
To get rid of the Shift key when you open or close a tab, change
; (gtk_accel_path "<Actions>/terminal-window/close-tab" "<Primary><Shift>w")and
; (gtk_accel_path "<Actions>/terminal-window/new-tab" "<Primary><Shift>t")to
; (gtk_accel_path "<Actions>/terminal-window/close-tab" "<Primary><Shift>w")
(gtk_accel_path "<Actions>/terminal-window/close-tab" "<Primary>w")and
; (gtk_accel_path "<Actions>/terminal-window/new-tab" "<Primary><Shift>t")
(gtk_accel_path "<Actions>/terminal-window/new-tab" "<Primary>t") |
I know there was a question on how to edit shortcuts for tab in xfce terminal: Is there a shortcut (missing?) to move tab in xfce4 terminal app?, but I did what said (that is - enable editable accelerators in appearance settings), and still cannot change shortcuts in the menubar. My purpose is to change shortcut for 1) open tab, which is
<shift><ctrl>t to <ctrl>t and 2) close tab, which is <shift><ctrk>w to <ctrl>t (basically getting rid of the <ctrl> key of them). I have tried to hover over them, pressed delete, and then typed those keys, to set the shortcuts, but nothing had happened. So is there a possibility to change defaul xfce terminal shortcuts for my purpose mentioned above?
| How to make editable accelerators in xfce terminal? |
I figured it out.
Reinstall ttf-dejavu will restore it.
And the software that cause this is gimp : )
|
I'm using arch linux and started to install some software after xfce4 desktop. However, My font "Monospace Regular" suddenly became thin and flat after some software installed (I don't know which one). I definitely haven't change any configuration about font type. They look like this in my screenshot.How can I fix it?
Update: not only in xfce4-terminal, this change was applied in all of my software.
| arch linux xfce4 terminal font type gets wired after install some software |
Looks like the xfce4-terminal defaults to opening in whatever directory it was launched from. I just installed it on my Arch system, and confirmed the behavior. So I looked at its Preferences section (Edit => Preferences) and saw:So, just set that field to /home/yourUser and it should work.
It should, but at least on my system it does not! I tried this and the setting seems to be ignored which makes me think this is a bug in the program. You should let the developers know by filing a bug report, or you can wait until it is corrected.
In the meantime, as a workaround for your launcher, you can change the launcher so that it executes:
xfce4-terminal --default-working-directory=/home/yourUserThat should make new terminals open as expected.
|
About a week ago (maybe after an update) the starting directory of xfce4-terminal changed from ~ to ~/Documents when launched from the panel. I'm pretty sure that wasn't because of anything I have done: there are no cd commands in ~/.bashrc (and that should not be necessary) and the launcher did not contain anything in the field 'Working Directory' (I put $HOME there just to try, but that does not work either).
$ grep cd ~/.bashrc
$ grep Desktop .config/xfce4/terminal/terminalrc
$I'm runnning Ubuntu 20.04, has anyone had this same thing happen in Ubuntu?
| xfce4-terminal starts in ~/Desktop instead of ~ |
I found a work-around, which is even better:Anything you highlight in Linux, regardless of the program, is put
into a special clipboard buffer, which you can paste using your
mouse's middle (wheel) button (which is emulated on many laptops by
pushing both buttons at the same time)source https://superuser.com/a/307371/1270261
Bytheway: here is a good compilation of different terminal-emulators
https://fossbytes.com/best-linux-terminal-emulators/
|
I switched a few days ago from xfce4 to cinnamon. Quite an improvement in usability. However, I miss the function of the xfce4-terminal that I can mark text and that it is automatically copied to the cliboard. Wasn't able to find it in the gnome-terminal settings, manual and a startpage-research did not give any results.
Is there a way I can make the gnome-terminal (Version 3.36.2) copying text I mark? Or do I need to install the xfce4-terminal for that? Or do you have any other pro suggestions for a terminal-emulator?
Thanks.
| Gnome-Terminal mark text > copy to clipboard (like in xfce4-terminal) |
Your "the next step" command line is step #6 in the instructions you linked.
Step #2 (git clone https://github.com/konradybcio/pongoOS) should have produced a pongoOS directory, and step #3 (cd pongoOS) whould have set it as your current working directory. To execute step #6, you should still be in that directory.
A "makefile" is not a binary, but a specially-formatted text file. The pongoOS directory produced by step #2 should contain a number of directories and five or so files: one of these is named simply Makefile, and that's what the make command is looking for.
Normally, the make command expects to find a file named either Makefile or makefile in the current working directory. There are ways to tell it to look into some other directory, but that is not the normal way to use it.The Makefile in the pongoOS distribution also includes a git submodule update --init --recursive operation, which should produce the pongoOS/newlib/Makefile, which is required by a subsequent child make all invocation in that directory.
If the git submodule update failed - e.g. because the Git repository it relies on could not be downloaded - it is possible that there is still no Makefile in the newlib sub-directory, and that might have caused the error message. But then, the messages should have been like:
make: Entering directory '<some directory>/pongoOS/newlib'
make: *** No rule to make target 'all'. Stop.
make: Leaving directory '<some directory>/pongoOS/newlib'and there should have been an error message from the git submodule update operation before that.
But if you really saw only the make: *** No rule to make target 'all'. Stop. message, then I'm afraid you must have been mistaken at some point: the pongoOS repository clearly contains a Makefile and it has the all target defined. So either you entered the make command in a wrong directory, or there was something else wrong in the previous steps, so not all the necessary files were actually downloaded into their proper locations.
Makefiles describe the build process, which can be arbitrarily complex. Usually a make process will produce a lot of output, most of it just informative. But when trying to fix an error, those informative messages might be necessary to figure out which part of the build process actually caused the error.
|
I am attempting to install this fork of PongoOS onto Debian 12.1 using these instructions and the last step I have taken was enter the following into the terminal:
EMBEDDED_CC=clang EMBEDDED_LDFLAGS=-fuse-ld=/usr/bin/ld64 STRIP=cctools-strip make allThe next step is to execute Pongo.bin using the following terminal command:
/path/to/checkra1n -v -V -p -c -k ./build/Pongo.binThe problem is the fact that pongoOS/checkra1n/build does not have Pongo.bin, nor any of the other Makefile binaries listed on the GitHub page. Entering the first command against results in this message from the terminal:
make: *** No rule to make target 'all'. Stop.Stack Overflow says that this message means that there is no makefile. How to I get this makefile to receive those binaries. I apologize if this is a foolish question, as I am new to the world of GNU/Linux.
| Installing PongoOS fork on Debian results in no makefile binaries |
A simple script like this can be used to prevent the empty tab:
#!/bin/bashc=$(ps -e | grep -c xfce4-terminal)if [ $c -gt 0 ]
then
xfce4-terminal --tab --drop-down -x $1
else
xfce4-terminal --drop-down -x $1
fiAssuming the script is named xfce4termtab, the launcher command would be either
xfce4termtab programor, with an argument
xfce4termtab 'program arg'Notes:The script's permissions need to be set to make it executable.
If the script isn't located in a directory on your PATH, you'll need to provide the full path to the script in the launcher command. |
Basically, I'd like to use a launcher to open a new tab with a program running in it when I already have a terminal open (obviously). To do this I use
xfce4-terminal --tab --drop-down -xYou'll notice I'm also using the
--drop-downWhich is essential to my ideal set up but am unsure if it matters to my question, but I included it just in case.
Anyway, what is bothering me is that when I have no terminal open at all and I use the above command/click launcher, what essentially amounts to a useless empty tab opens as well as the desired tab with the program running in it. Is there any way to prevent this empty tab?
| Is there a way to prevent an empty tab from showing up when using the --tab switch in a launcher for xfce4-terminal? |
You can launch xfce4-terminal with customised icon, title, geometry and so on. For example,
xfce4-terminal --icon=/home/user/scripts/green.png --title="Custom title" --geometry=100x30+130+200The above command would open a terminal window with specified icon and title, 100x30 characters in size, positioned 130 pixels from screen left and 200 pixels from screen top.
You could then create a bunch of scripted aliases for such commands, e.g. rterm, gterm, bterm, for variants with red, green, and blue icons, and so on.
I find colours better than any other way of distinguishing things.
Getting your terminals onto the desired workspace can be achieved with wmctrl -s. When scripting these, I'd add e.g. a 50ms pause to allow the window to reliably appear, and then issue the wmctrl instruction to push the session to whichever workspace you need. Perhaps have variants like rterm1, rterm2, gterm1, and so on.
|
I am running Debian,and want to utilize the multiple workspaces feature as a means of managing the large amount of terminal windows I tend to have open, but in order for the individual workspaces to be visually distinguishable, the icons of what is open in them must be, which is my issue here.
So basically I am asking is it possible to change the icon for individual XFce terminal windows?
| Selecting a custom icon for particular Xfce terminal windows |
First try the tried and true fix for everything: restart your computer, sudo apt update sudo apt upgrade to see if it fixes itself.
All of these commands should be ran as root. Delete the symlink, rm /tmp/.X11-unix, run vncserver (to set up another symlink), then kex should work. If it does not, make sure that you are on WSL-2, and try running through this part of the tutorial you linked again
Open PowerShell as administrator and run:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-LinuxRestart
Open PowerShell as administrator and run:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartRestart
Make sure that you restart when they tell you to. If none of these work, sudo apt remove win-kex, then sudo apt-autoremove and start the tutorial from the beginning. Also as a side note, seamless mode seems to not work on windows 11 beta for me at least.
|
This had never happened to me before until I started using Windows 11.
Firstly, I have already followed this guide step-by-step far before posting: https://www.kali.org/docs/wsl/win-kex/
I am a Windows Insider helping to develop winget-cli, and I have used the Beta channel for Windows 11 for the last 4 months. When the official update rolled out, I did a fresh install on my two new M.2 NVME SSDs. After doing the same installation method, KeX is not working for me.
Would you please let me know if there is anything I can do to make this work? I usually use Kali Linux 2021.3 on VMware Workstation Pro 16, but I like to use it on the Windows Terminal through KeX.
At this time, I cannot use VNCviewer or RDP. What is going on?
Below is if I try to start kex. I also have VNC Viewer, Tiger VNC, etc. Thank you.
And please let me know if any other information is needed. I know my firewall is not blocking it. | Windows Terminal Preview - Kali Linux KeX Not Working on Windows 11 |
The aliases you define in bash aren't available outside of bash.
If you want a command available from the whisker menu of XFCE, you need to make a .desktop file and in one of the locations which are standard for those files. One such location (and the one I'd recommend) is in ~/.local/share/applications.
I suggest taking a look at other .desktop files to get an idea how they look, and also check out the specification on desktop entry files
You can take a look in /usr/share/applications for a bunch other, system-wide .desktop files, too.
As an example, here's a .desktop file for Gpredict:
[Desktop Entry]
Name=Gpredict
Comment=Satellite tracker
Exec=gpredict
Icon=gpredict-icon
Terminal=false
Type=Application
Categories=HamRadio;Science;Astronomy;Education;Network;You seem to want to run the application inside a specific directory, the .desktop definition has an entry for that: Path=, where you can specify the working directory to run the command in.Here's an example of a .desktop file that does things similar what you seem to like:
[Desktop Entry]
Name=Custom VSCode
Exec=code .
Path=/home/polemon/devel/c
Terminal=false
Type=Application
Categories=DevelopmentIt works for me, not caring about most entries, etc.
|
I created this alias in bash:
alias .one='cd Learn/React/React\ JS/one_app/ && code . && exit'to open a project in VSCODE, but when i try to execute in whisker search bar using !.one i receive the error Failed to execute child process. Any help?
*Linux mint 20.4
| Execute alias in whisker search bar |
In general you can launch a gui program and close immediately the xterm that launched it with:
exec program&exit
or better
exec program2>&1>/dev/null &exit
You have a script that acquire input still in terminal, so the terminal for you doesn't have to exit soon, so here is the solution:replace ./myGuiProgram with nohup ./myGuiProgram 2>&1>/dev/null &
replace sudo ./myGuiProgram with nohup sudo ./myGuiProgram 2>&1>/dev/null &
remove all the four exit in your script (the way you used it is only redundant)
append sleep 1 in the end of your scriptlaunch the script in the terminal with
exec scriptNote: the only way to launch the script without exec and have the external exec functionality within the script is not very nice: end suddenly xterm (parent of xterm's shell process accepting script command which is parent pf bash the script interpreter) within the script with
kill $(ps -ho ppid -p $(ps -ho ppid -p $$))as last line of the script
The need to use 1. and 2. also gave me an idea: nohup should have an argument to ignore program's output because otherwise it only add a extensive pipe to what is wasted
|
Is it possible to close the parent terminal window once an application has been loaded?
I have a program I need to run using root privileges to work properly and currently I have made a script file which checks if the user is root if not then they are asked to confirm the root password before the application is loaded.
Original
Here is the contents of my script file:
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "You need root privileges to run this utility"
echo "Do you want to continue? (y/n):"
read userInput
if [ $userInput == "y" ] || [ $userInput == "Y" ]
then
sudo ./myGuiProgram
exit
elif [ $userInput == "n" ] || [ $userInput == "N" ]
then
echo "Exiting now..."
exit
fi
exit
elif [ "$EUID" -eq 0 ]
then
./myGuiProgram
exit
fiIs there anything I can add to this that will close the terminal window and not myGuiProgram ?
On my Centos 7 machine I have a desktop config file which executes the script file which in turns runs myGuiProgram
2nd Attempt
I've modified my script since, but still no luck. This method allows me to exit the terminal window manually without closing my program
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "You need root privileges to run this utility"
echo "Do you want to continue? (y/n):"
read userInput
if [ $userInput == "y" ] || [ $userInput == "Y" ]
then
sudo nohup ./myGuiProgram > /dev/null & disown && kill $PPID
elif [ $userInput == "n" ] || [ $userInput == "N" ]
then
echo "Exiting now..."
fi
elif [ "$EUID" -eq 0 ]
then
nohup ./myGuiProgram > /dev/null & disown && kill $PPID
fiMARco Working Solution
New changes made based on @MARco response. This method works well.
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "You need root privileges to run this utility"
echo "Do you want to continue? (y/n):"
read userInput
if [ $userInput == "y" ] || [ $userInput == "Y" ]
then
sudo -b nohup ./myGuiProgram 2>&1> /dev/null
elif [ $userInput == "n" ] || [ $userInput == "N" ]
then
echo "Exiting now..."
sleep 1
exit 0
fi
elif [ "$EUID" -eq 0 ]
then
nohup ./myGuiProgram > /dev/null 2>&1> /dev/null &
fi
kill $(ps -ho ppid -p $(ps -ho ppid -p $$)) | Close terminal window once application is opened |
extract metadata to txt file with ffmpeg, convert it with iconv, then re-add.
|
My mp3 file has id3 tags which can be displayed in a terminal on my debian buster linux for example by using the program id3tool or id3.
If my shell (xfce4-terminal) has a set default character encoding to UTF-8, the output of id3tool looks like this:
Filename: test.mp3
Song Title: Qu�l Dich Fit
Artist: Wise Guys
Album: Frei!
Track: 16
Year: 2008
Genre: Rock (0x11)By choosing a default character encoding for the terminal to ISO-8859-1, the output of id3tool is:
Filename: test.mp3
Song Title: Quäl Dich Fit
Artist: Wise Guys
Album: Frei!
Track: 16
Year: 2008
Genre: Rock (0x11)The invalid character of the title name is gone and replaced with the correct one.
I want to be able to see the correct song title without having to switch the terminal encoding.
The mp3 file is not a text file. It is a binary with id3 tags, which apparently are encoded in ISO-8859-1.
The command
file -bi test.mp3 yields
audio/mpeg; charset=binaryCan I transform the encoding of this file to UTF-8? "iconv" works only for text files.
What else should I do to be able to work with the id3 tags of my mp3 files without invalid characters?
| convert encoding of id3 tags of mp3 file |
This worked for me . Place a file in /etc/xdg/autostart directory with the following contents.
#cat xfce.desktop
[Desktop Entry]
Type=Application
Name=Xfce_terminal
Exec=xfce4-terminal
Terminal=trueRemember this is a global setting and it applies to all the users and there will be no need to manage them separately using '.config' dir on their respective home directories
Additionally you can manage your default window manager in xrdp using the below steps
Place a file named "startwm-bash.sh" in the /etc/xrdp directory with the following contents
cat /etc/xrdp/startwm-bash.sh
#!/bin/bash
XFCE="$(which xfce4-session 2>/dev/null)"
exec "$XFCE"[/code]Assign executable permission to the file.
Lastly modify the sesman.ini file to use the above script as the default window manager.
vi /etc/xrdp/sesman.iniModify the default window manager to look like below
DefaultWindowManager=/etc/xrdp/startwm-bash.shAlthough the path says it is relative to /etc/xrdp, It worked for me after giving the absolute path of the executable.
Restart the xrdp service
service xrdp restart |
I would like to Launch "Xfce4-terminal" on boot using Xfce desktop, Xrdp-client, and Centos.
I tried creating a .desktop file under .config/autostart and also tried to set the xfce4-terminal on login from the xfce4 desktop settings as well but still I am unable to launch the terminal on boot.
did the following from the Sessions and startup app from the desktop and it did not work still.
However, upon doing so, it created a file under my userspace like the following but it's not starting automatically when doing an RDP to the server.
----
.config/autostart/xfce4-terminal.desktop[Desktop Entry]Encoding=UTF-8Version=0.9.4Type=ApplicationName=xfce4-terminalComment=TerminalExec=/usr/bin/xfce4-terminalOnlyShowIn=XFCE;RunHook=0StartupNotify=falseTerminal=falseHidden=false
----Kindly advise
| Unable to Launch "Xfce4-terminal" on boot |
Adding the following lines to ~/.inputrc and re-reading the file works as a solution:
"\e[1;5C": forward-word
"\e[1;5D": backward-word |
I have been trying to rebind the shortcut for moving the cursor forwards/backwards one word at a time in the Xfce4 terminal.
I'm used to using <Ctrl>LeftArrow and <Ctrl>RightArrow to achieve this.
Using these shortcuts in the terminal produces the following characters instead:
;5D when pressing <Ctrl>LeftArrow and ;5C when pressing <Ctrl>RightArrow
Using <Alt>B and <Alt>C does move the cursor one word at a time, but I'm not comfortable using this combination.
I've looked at '~/.config/xfce4/terminal/accels.scm' but there are no lines that correspond to the <Alt>B and <Alt>C shortcuts.
Is there a way to bind this functionality to <Ctrl>LeftArrow and <Ctrl>RightArrow?
| Rebinding Xfce4 terminal shortcut for moving the cursor one word at a time? |
X11 forwarding needs to be enabled on both the client side and the server side.
On the client side, the -X (capital X) option to ssh enables X11 forwarding, and you can make this the default (for all connections or for a specific connection) with ForwardX11 yes in ~/.ssh/config.
On the server side, X11Forwarding yes must be specified in /etc/ssh/sshd_config. Note that the default is no forwarding (some distributions turn it on in their default /etc/ssh/sshd_config), and that the user cannot override this setting. If you change the configuration, remember to tell the server to reload its configuration, e.g. service ssh reload if your system uses systemd.
The xauth program must be installed on the server side. If there are any X11 programs there, it's very likely that xauth will be there. In the unlikely case xauth was installed in a nonstandard location, it can be called through ~/.ssh/rc (on the server!).
Note that you do not need to set any environment variables on the server. DISPLAY and XAUTHORITY will automatically be set to their proper values. If you run ssh and DISPLAY is not set, it means ssh is not forwarding the X11 connection.
To confirm that ssh is forwarding X11, check for a line containing Requesting X11 forwarding in the output of ssh -v -X. Note that the server won't reply either way, a security precaution of hiding details from potential attackers.
|
I have a machine running Ubuntu which I SSH to from my Fedora 14 machine. I want to forward X from the Ubuntu machine back to Fedora so I can run graphical programs remotely. Both machines are on a LAN.
I know that the -X option enables X11 forwarding in SSH, but I feel like I am missing some of the steps.
What are the required steps to forward X from a Ubuntu machine to Fedora over SSH?
| How to forward X over SSH to run graphics applications remotely? |
If you look at the Wikipedia page on the subject there are several apps mentioned.
Xmove
excerptxmove is a computer program that allows the movement of X Window
System applications between different displays and the persistence of
X applications across X server restarts.[4] It solves a problem in the
design of X, where an X client (an X application) is tied to the X
server (X display) it was started on for its lifetime. Also, if the X
server is shut down, the client application is forced to stop running.
xmove lets the client disconnect from its current X server, and
connect to a new one, at any time. The transition is completely
transparent to the client. xmove works by acting as a proxy between
the client and server. It is a "pseudoserver" which stores enough
server state so that clients can connect to a new server without being
disrupted.Xpra
excerptxpra or X Persistent Remote Applications is a tool which allows you to
run X clients usually on a remote host and then direct their display
to your local machine without losing any state.1
It differs from standard X forwarding in that it allows disconnection
and reconnection without disrupting the forwarded application. It
differs from VNC and similar remote display technologies in that xpra
is rootless: i.e., applications forwarded by xpra appear on your
desktop as normal windows managed by your window manager, rather than
being all "trapped in a box together". Xpra also uses a custom
protocol that is self-tuning and relatively latency-insensitive, and
thus is usable over worse links than standard X.Guievict
excerptguievict is a computer program which enables the GUI of any
application for XFree86 implementation of X Window to be transparently
migrated to or replicated on another display. Unlike some program
providing similar functionalities, it requires neither prearranging
steps such as re-linking the application program binary nor
re-directing the application process's window system communication
through a proxy like xmove does.
Guievict is based on a small X server extension that enables an
application to retrieve its window state from the X server and a
library of GUI migration functionality that is injected in the
application process at run time. Code injection or runtime
code-patching can be done via the DynInst API. However, guievict
contains its own implementation to avoid requiring users to install
DynInst.Of the 3 of these, Guievict sounds like what you're looking for, mainly that it can checkpoint the state of X application AppX and migrate it to another X server where it can be restored.
| Is there any way to open a graphical program (for instance, gedit) while using X11 forwarding over SSH and transfer the X server connection back to the X server on the SSH host?
| Can I move a running application to a different X server? [duplicate] |
@Demi 's answer is good but I think filling it out would be great help.local
-- the local machine serving an Xserver.
remote
-- the remote machine serving the application which drives the data going to the XserverRemote /etc/ssh/sshd_config:
X11Forwarding no
X11DisplayOffset 10
X11UseLocalhost yesRemote ~/.Xauthority is empty or does not exist
On local:
Xephyr -ac -screen 1280x800 -br -reset :2 &
DISPLAY=:2 ssh -fR 6010:/tmp/.X11-unix/X2 user@remote "DISPLAY=:10 xeyes"In the test, local was running Ubuntu 18.05, remote was running Debian Jesse.
|
Consider a situation where I'm logging in over SSH from machine A to machine B, I have an X session on machine A, and I want to run an X program on B.
ssh -X B makes this work transparently. But what if the server configuration lacks X11Forwarding yes, I don't have root permissions on the server, and the server administrator is indifferent?
It's obviously possible to forward the X11 connection, since I can transfer whatever I want over the SSH channel. In fact, if the local X server allows TCP connections, it's as easy as ssh -R 6010:localhost:6000 (to be adjusted for the display numbers). What about the common case where the local X server only allows socket connections? How do I do X forwarding conveniently and securely, with a minimum of installation requirements (especially on B)?
| Forwarding X11 over SSH if the server configuration doesn't allow it |
Starting the X program probably starts a background process that doesn't terminate when you close the program (or the program itself doesn't terminate properly). See here for an explanation of what happens.
To fix this, you can try to find out what processes are still running and either prevent them from being started when you log in via SSH or simply kill them before you log out. You can certainly just kill the SSH connection once you have logged out as well though.
|
After running X programs over SSH, SSH doesn't terminate after shell exit (have to use e.g. CtrlC to kill it).
My guess is although the X program already exit, there is still some "connection" left (not freed). The exceptions I have found now are gtk-demo and acroread.
Does anyone know the reason? Is this a problem with ssh{,d} configuration?
| SSH not terminated after exit when there is X Forward program |
Yes, this is possible in a few different ways but you will need an X window server for Windows. Some options of a X windows server are XManager, XMing and MobaXterm. Once you have an X server running on Windows you can use PuTTY to connect to your host after you have set the configuration parameters:
Connection/SSH/X11
Enable X11 forwarding
X display location: localhost:10.0Where the 10.0 depends on what the X Window server is listening on.
When you configured the X Window server and PuTTY and logged in to your host you can verify the DISPLAY variable if a DISPLAY is set:
$ echo $DISPLAY
localhost:10.0Then try something like xclock to see if X11 forwarding works:
# xclock &Another way to use X11 apart from ssh is to set the DISPLAY variable manually to point to an IP address like:
# export DISPLAY=192.168.0.1:0And see if it works:
# xclock &This way X applications are (re)directed to output to a remote X Window server.
Note: Keep in mind that the X11 protocol is not designed to operate over slow network (WAN) connections. The X application may be terrible slow when used over slow connections. Consider to use the -C (compression) switch with ssh to use compression over the ssh session to speed it up a little.
|
I communicate with the server via a ssh tunnel, configured via Putty.
Recently, I'm trying to forward the X11 through it, but it doesn't work.
Is there any one work this way?
Searched with google, but didn't find anything.
| Is it possible that X11 can be forwarded through a SSH tunnel |
On 3.36 or newer you can use this command to disable the check: gsettings set org.gnome.mutter check-alive-timeout 0. Or you can try something longer than the default timeout of 5000 milliseconds instead of 0 if you don't want to disable it entirely.
|
I have a server running XFCE on debian and a client running gnome3 on arch, and I want to control GUI applications running on server from client using X11 forwarding.
ssh -X user@server on the client followed by localc - Works!
Except every few seconds no matter what I do - even moving the window - gnome tells me "Libreoffice Calc is not responding. Do you want to force quit it?". This happens with the calculator too, anything.
Yeah I admit there is a slight lag (a guessed 0.3 seconds - Can this be improved somehow?) but it's definitely not unresponsive. The dialog comes up every few seconds. Nothing's frozen or anything.
Edit: Setting gsettings set org.gnome.mutter check-alive-timeout 20000 still shows the dialog, just now only every 20 seconds even though nothing is unresponsive at all. Setting it to 0 to disbale it worked, but I'd sure like to find and fix the real issue causing gnome to think it's unresponsive when it isn't.
| "This application is not responding" nonsense with X11 forwarding |
yes, if you want to. to do this change your xming startup options to open the whole x server in a single window. The drawback is that you can't move windows out side this window.
|
I'm connecting to a Linux machine from my Windows desktop via PuTTY. I'm running Xming on my Windows PC so that I can remote display X windows applications. Loading individual graphical programs works fine. I can run gedit for example and it pops right up.
I want to load a desktop session, exactly how it would be viewed as if I were in front of the Linux computer. I found I can use gnome-session to do this, the problem is it doesn't load the upper and lower panels. I have to run gnome-panel separately. This is cumbersome because the panels occlude the Windows task bar.
Is there a way to have gnome-session and gnome-panel all in one Xming window?
| SSH via PuTTY: launch gnome-session and gnome-panel in one Window |
You don't want the -C option in the ssh connection. Compression is great when you are moving lots of data, but here you want responsiveness, and your ADSL is fast enough.
Switching to x2go should make you very happy. It implements an X11 specific compression. Both ends know when the end of an X11 message is reached and can force the data to be transmitted, rather than a general compressor which waits a while in case more data is about to be sent and could therefore be compressed and added to the current packet.
|
I have the following setup:
internet
host_1 --> router_1 <----------> router_2 <-- host_2Both host_1 and host_2 run Ubuntu 18.04. From host_2, I would like to access the GUI applications in host_1 through ssh X forwarding. So, I tried with option -C in addition to -X:
<host_2_prompt>$ ssh -CX <router_1_public_IP>This actually works, but any movement/update in the GUI windows is unacceptably slow. Both routers use an ADSL connection: in particular, router_1 available upload band is 1.0 Mbps.
Is there a way to improve this performance? For example, to further compress the exchanged data?Note: using the same connection, I am able to access Remote Desktop in Windows Server 2008 with almost no delay, as if the machine was local. So, I guess the available bandwidth should be enough also for ssh.
| SSH X forwarding too slow |
Solution found.
An alternative method copied from this blog
Using this script
userfirst=sshloginuser
usersecond=sudoorsuuser$usersecond@host$ su - $userfirst -c 'xauth list' |\
grep `echo $DISPLAY |\
cut -d ':' -f 2 |\
cut -d '.' -f 1 |\
sed -e s/^/:/` |\
xargs -n 3 xauth addOr simply
Logging as user1
xauth listsu or sudo su user2
xauth add OUTPUTOFXAUTHLIST |
Usually I do this on ssh for getting a X application using sudo su
ssh -X serverOKI login
xauth list $DISPLAYwhich returns to me
server/unix:10 MIT-MAGIC-COOKIE-1 blablablablablaThen I do
sudo su
xauth add server/unix:10 MIT-MAGIC-COOKIE-1 blablablablablaAnd after running an X application..I get it, it is correct.
The problem is on Centos7, I do
xauth list $DISPLAYAnd it returns nothing. I try to add MIT magic cookies given by
xauth listBut of course it doesn't work.
The normal X-forwarding via ssh, without sudo works.
The settings of sshd are the same on 3 servers:slackware WORKS
hpux WORKS
centos7 NOT WORKING | ssh and sudo but no $DISPLAY |
It’s part of the X11 protocol (search for "6000") and is documented e.g. in Xorg(1):Xorg listens on port 6000+n, where n is the display number. This connection type can be disabled with the -nolisten option (see the Xserver(1) man page for details). |
When I request X forwarding from SSH server, then SSH server sets a $DISPLAY variable with value localhost:10.0. In addition, it starts to listen on 127.0.0.1 port 6010(and also ::1 port 6010 for IPv6):
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:6010 *:* users:(("sshd",pid=11405,fd=10))How do X clients know that they will need to connect to TCP port 6010? Does this work in a way that by default they connect to TCP port 6000+<display number> and as display number is in this example 10, then they will connect to TCP port 6010?
| How do X clients know that they will need to connect to TCP port 6000+<display number>? |
SSH blocks new X11 connections after 20 minutes in its default setup. To avoid this, run ssh -Y instead of ssh -X, or set the option ForwardX11Trusted yes in ~/.ssh/config.
If you run ssh -v, you'll see the message “Rejected X11 connection after ForwardX11Timeout expired” when a new application tries to connect to the display after the timeout. Without -v (which causes a lot of other debugging output), all the information you get is “Can't open display”.To explain why, I need to give a little background. X11 forwarding allows the destination machine to contact the local X server. This has consequences in terms of security. An X11 server does not isolate applications from each other; this allows the window manager to move windows around and kills them as it wishes, it allows macro processing tools to do that as well and inject keystrokes and so on. Also any application can read and modify the clipboard. This gives a lot of power to remote applications over your local data. If the remote machine is untrusted, with a text mode connection, the worst that can happen is bad stuff on the remote machine. But with an unfettered X11 connection, bad stuff can happen on your local machine too.
X11 includes the “SECURITY extension”, which allows some applications to be declared as untrusted. Untrusted applications get fewer rights, for example they cannot monitor or inject keystrokes in other applications. SSH gives the option of declaring the connection to be trusted (ForwardX11Trusted yes or ssh -Y) or untrusted (ForwardX11Trusted no or ssh -X).
SSH has long defaulted to establishing untrusted connections. As an additional safety feature, untrusted connections can only be established for a few minutes at the beginning of the SSH session; originally 2 minutes (ssh.c 1.202), then 20 minutes (ssh.c 1.207). As a safety feature, I don't see the point: if you're running an untrusted application already, whether another application can be launched later is moot. Recent versions of SSH (ssh.c 1.340, clientloop.c 1.221) have made the timeout configurable with the ForwardX11Timeout.
Unfortunately, due to a bug in X.org (not public at this time), you cannot set an overly large value of ForwardX11Timeout, or else the X server will crash.
Trusted connections are not subject to this expiration mechanism. The trade-off is that malware or a malicious administrator on the remote machine can take control of your local machine. This is often acceptable, but it's up to you to decide.
|
I am running some MATLAB scripts on the command-line of a remote computer using ssh. These scripts launch 5 xterms that are forwarded to me via ssh (using the -X option). At the moment I am debugging my code so I am restarting my scripts every now and then. Everything works fine for a couple of runs, but after the N'th time (where N is a random number) I get theses error messages:
xterm Xt error: Can't open display: localhost:10.0
xterm Xt error: Can't open display: localhost:10.0
xterm Xt error: Can't open display: localhost:10.0
xterm Xt error: Can't open display: localhost:10.0
xterm Xt error: Can't open display: localhost:10.0After this I can continue to use ssh except for starting anything GUI-related, meaning that I can no longer start xterms remotely. My only workaround is to restart the ssh connection. Can I fix this somehow to never be bothered again by this?
Systemlocal system: privately owned laptop, running Chakra Linux, KDE
remote system: university computer, running openSuSe, KDE | Cannot start xterm over ssh after several successes |
You are mixing up terms. The first thing is X11 forwarding and it is inefficient by definition and you can't do almost anything about that (it is not made for high-latency connections and decades ago]. In comparison to the other method, it is inefficient, because it is transferring whole gui (of broswer?) over the newtwork.
The other is SOCKS proxy (completely different thing) and it transfers only the network data you are interested in (encapsulated in the SOCKS protocol and SSH), which is obviously more efficient.
Your question is asked in the way that it is not possible to answer. What are you trying to achieve? Run GUI programs? Proxy network connections? Something totally different?
|
I open GUI remote programs by SSHing with the -X (or -Y) flag, e.g.,
$ ssh -Y [emailprotected]Recently, I found there is a much more efficient way to do this with web browsing only:
$ ssh -DNNNN [emailprotected]where NNNN is a four digit port number. Then I configure my local browser to connect through a proxy via port NNNN. This is much more efficient than the first SSH method because all the GUI information does not need to be transported through the tunnel, only the web data I am requesting.
My question is: is there a more efficient way to SSH with X-forwarding in general? Maybe some scheme that utilizes local libraries or rendering or something to aid in operating a GUI program hosted remotely?
| More efficient X-forwarding? |
For the sake of this conversation lets say there are 2 machines named lappy and remotey. The lappy system is where you'd be running your ssh commands from. The system you're connecting to is remotey.
1. Display GUIs from remotey on lappy
lappy .-,( ),-.
__ _ .-( )-. remotey
[__]|=| ---->( network )------> ____ __
/::/|_| '-( ).-' | | |==|
'-.( ).-' |____| | |
/::::/ |__| NOTE: on lappy, `ssh` to remotey, run GUI, see GUI on lappyYour shell's configuration files are likely setting the environment variable DISPLAY=:0. You can grep for this like so:
$ grep DISPLAY $HOME/{.bash*,.profile*}If that doesn't return anything back then the system you're logging into is probably the culprit. Take a peek in this directory as well.
$ grep DISPLAY /etc/profile.d/* /etc/bash*If you'd rather just leave this be you can override this behavior by instructing ssh to redirect X traffic back to your client system, like so:
$ ssh -X user@remoteserverExample
Here I have a remote server that has $DISPLAY getting set to :0 similar to yours.
$ ssh -X skinner "echo $DISPLAY"
:0But no matter, I can still invoke X applications and have them remote displayed to my system that's doing the ssh commands. I don't even have to login, I can simply run GUI's directly like so:
$ ssh -X skinner xeyesAs a bonus tip you'll probably want to change which ciphers are being used, to help improve the performance of your X11 traffic as it passes over your SSH tunnel.
$ ssh -c arcfour,blowfish-cbc -X skinner xeyes2. Displaying GUIs on remotey
lappy .-,( ),-.
__ _ .-( )-. remotey
[__]|=| ---->( network )------> ____ __
/::/|_| '-( ).-' | | |==|
'-.( ).-' |____| | |
/::::/ |__| NOTE: on lappy, `ssh` to remotey, run GUI, see GUI on remoteyIf you're SSH'ing into remotey from lappy but would like to keep the GUIs from being displayed on lappy, then simply drop the -X switch from your ssh invoke.
$ ssh -p 6623 [emailprotected]3. Eliminating $HOME/.ssh/config
Often times a user's $HOME/.ssh directory can introduce unknowns as to what's going on. You can temporarily silence the use of the config file in this directory like so when performing tests.
$ ssh -F /dev/null -p 6623 [emailprotected]4. Eliminating remote shell's configs
You can use the following test to temporarily disable the shell's configuration files on remotey like so:
$ ssh -t -X -p 6623 [emailprotected] "bash --norc --noprofile"With the above, none of the setup should be getting sourced into this Bash shell, so you should be able to either set DISPLAY=:0 and then display GUIs to remotey's desktop.
You can use the following trick to help isolate the issue, by first removing --noprofile and trying this command:
$ ssh -t -X -p 6623 [emailprotected] "bash --norc"Then followed by this command:
$ ssh -t -X -p 6623 [emailprotected] "bash --noprofile"The first version will tell you if the problem lies in your /etc/bashrc & $HOME/.bashrc chain of configuration files, while the second version will tell you if the problem lies in the $HOME/.bash_profile configuration file.
|
I have the reverse problem that most people seem to be having. If I start an X application while logged into ssh, it displays on the server(host) machine instead of the client(local). This is the command I use
$ ssh -X -p 6623 [emailprotected]My $DISPLAY variable appears correct on the client.
$ echo $DISPLAY
:0I want X applications from the server to display locally on the client (the machine I'm physically at). I don't know what is causing this.
| SSH - How to make X applications run on client? |
I believe you're getting confused by how SSH performs the proxying of the X11 connection via the tunnel it's established on the remote server side with how magic cookies typically works. From the SSH man page:
excerpt
The DISPLAY value set by ssh will point to the server machine, but with a
display number greater than zero. This is normal, and happens
because ssh creates a “proxy” X server on the server machine for forwarding
the connections over the encrypted channel.ssh will also automatically set up Xauthority data on the server machine.
For this purpose, it will generate a random authorization cookie,
store it in Xauthority on the server, and verify that any forwarded
connections carry this cookie and replace it by the real cookie when the
connection is opened. The real authentication cookie is never sent to the
server machine (and no cookies are sent in the plain).So it would seem the magic cookies being shown to you on the remote server side are not in fact the true magic cookies on the local server (your end). Remember that the DISPLAY is being set like so when you SSH into a remote server:
$ echo $DISPLAY
localhost:11.0And the magic cookies are connected by this $DISPLAY:
$ xauth list
remotey.dom.com/unix:11 MIT-MAGIC-COOKIE-1 00f505f4c5731714d30f24a956d4cb8fThe tell is that /unix:11. That's the magic cookie for the local side of the SSH connection, not your local server's X11, which would typically be :0.
.Xauthority
It's true that this file contains that magic cookies, but it's a binary file and you do typically interact with it via the xauth command. See xauth's man page for more on this.
Doing it manually
Often times you'll see this message show up if you do the following:
$ ssh -X user1@remotey
$ su - user2
$ xclockX11 connection rejected because of wrong authentication.
X connection to localhost:10.0 broken (explicit kill or server shutdown).This is because the 2nd user's .Xauthority knows nothing of the magic cookie that was passed by SSH when you logged in initially. You can generate the xauth add required while you're user1 and make use of it as user2 like so:
$ ssh -X user1@remotey
$ echo $DISPLAY
localhost:10.0Notice above that you're on display # :10.0. Now generate the xauth add required for that display #:
$ echo xauth add $(xauth list ${DISPLAY#localhost})
xauth add remotey.dom.com/unix:10 MIT-MAGIC-COOKIE-1 111ef940f6d75b4a9eb64ea3579ef67eNow become user2 and add it:
$ su - user2
$ xauth add remotey.dom.com/unix:10 MIT-MAGIC-COOKIE-1 111ef940f6d75b4a9eb64ea3579ef67e
$ xclockAnd we get the clocking showing as expected.
NOTE: You can also do things in a single command line once you've grasped what's going on with the above.
using su
$ xauth extract - ${DISPLAY#localhost} | \
su - user2 -c "xauth merge -; xclock"use sudo
$ xauth extract - ${DISPLAY#localhost} | \
sudo su - user2 -c "xauth merge -; xclock"ReferencesX Window Authorization
SSH X-11 forwarding and magic cookies
X11 Forwarding and su/sudo |
From my local machine I ssh to a remote server along with authentication regarding X display. I know that in this process, MIT-MAGIC-COOKIES are used and the value in both server and client needs to be identical in order for the authentication process to be valid.
However, when I login to a remote server and have confirmed that X display stuff are working well (e.g. executing xclock to see if the xclock application is popped up in my local machine), when I check the value of the cookies, the value in local machine and that in the remote server seems to be different. Here's the command lines:
cookie value in remote server
chulhyun@chulhyun-Inspiron-3420:~$ ssh -X Black@$labcom
Last login: Wed Jun 25 10:02:25 2014 from Black@Black-PC ~
$ xclock ### xclock appears in local machine.Black@Black-PC ~
$ xauth list
Black-PC/unix:10 MIT-MAGIC-COOKIE-1 708f623489b1ea129a77e98287d130cacookie value in local machine
chulhyun@chulhyun-Inspiron-3420:~$ xauth list
chulhyun-Inspiron-3420/unix:0 MIT-MAGIC-COOKIE-1 5ddd2ce92004eab53ceee8a64b7b88c0As you can see the cookie value in two machines are different. Then shouldn't the X display not work?
What am I missing here?
P.S. I heard that $XAUTHORITY contains the path to the xauthority file and I've checked that path in local machine:
chulhyun@chulhyun-Inspiron-3420:~$ echo $XAUTHORITY
/var/run/gdm/auth-for-chulhyun-iZfH2u/databaseWhen I take a look into the "database" file, the contents are unreadable because the contents are composed of weird characters.
^A^@^@^Vchulhyun-Inspiron-3420^@^A0^@^RMIT-MAGIC-COOKIE-1^@^P]?,? ^D??<??? K{??could this be related to the question?update
result of xhost and $XAUTHORITY in remote server
Black@Black-PC ~
$ xhost
access control enabled, only authorized clients can connect
SI:localuser:chulhyunBlack@Black-PC ~
$ echo $XAUTHORITY*as it turns out $XAUTHORITY is not defined... is this normal?
result of xhost in local machine
chulhyun@chulhyun-Inspiron-3420:~$ xhost
access control enabled, only authorized clients can connect
SI:localuser:chulhyun | x11 connection established but magic-cookie value different? |
I need X installed on the host too, right?You need an X server installed on the host only, and it will need to be running. You will need some X client libraries in the container (installing xbmc will presumably pull these in as dependencies), but not an X server.What exactly are "displays" (like :0 and :1) and do I need to set them?Displays are distinct (hypothetical) screens managed by a particular server, and the DISPLAY environment variable tells X clients how to connect. ssh -X sets that up automatically; you don't need to do anything.
It is possible to do this without involving ssh at all, using X natively. In that case you will need to set up DISPLAY appropriately. There's no particular advantage in that for you in these circumstances, other than lowering the resource cost from encrypting the connection.
If you are not running the ssh command from inside the host's X server environment you will need to set DISPLAY=:0 (or similar) explicitly on that end so that ssh can see it.Is what I'm trying to do possible?Yes, it is almost the purpose of the X protocol.You should check man ssh for details of the -X and -Y options, and man ssh_config for details of the ForwardX11Trusted option. In your case it's likely that the security concerns don't really apply, but do check and make sure.
In particular, ssh -Y has a higher success rate in some configurations, but gives the remote end unrestricted access to your X server, while ssh -X prevents many such accesses and forces the authentication to expire after a short time. The X protocol is not terribly secure and a client with unrestricted access can, for example, log every keypress made in every other client.
|
I have a rather odd setup I'm trying to get working.
I have an Ubuntu install running in a container (through Proxmox). The host computer is CentOS. Neither server is running an X instance.
My host machine is physically plugged into a monitor. My end goal is to be able to ssh -X from the host to the container and run xbmc so that it displays on my monitor.
Some questions about this setup:I need X installed on the host too right?
What exactly are "displays" (like :0 and :1) and do I need to set them?
Is what I'm trying to do possible? | Understanding ssh X11 forwarding |
It's possible, but probably not desirable. The VLC client (window) will be shown on whatever display you want, but it will be playing uncompressed video, which will have to be sent as networked X requests. Even without any overheads, sending 720×540 at 24 bpp and 30 fps will need around 279 Mbps (720px × 540px × 3 bytes/pixel × 30 fps × 8 bits per byte).
Ethernet frames, TCP/IP packets and the X protocol itself will bloat this even more.
What's even more counter-intuitive is that, since you're displaying post-processed RGB data, the bigger the window, the more bandwidth you'll need. (take this with a pinch of salt, the actual scaling may happen display-side — in which case, reducing the window size won't have any effect on performance)
When VLC (or any other X client) is displaying on a display on localhost, a whole family of huge optimisations kick in that give you the responsiveness you expect.
You can try this yourself if you want (it's pretty interesting to see it in action):
ssh -Yf user@hostname vlc some-file.aviVLC starts, BUT: audio plays on the X client's host (hostname above), not the X server's host, and video is updated at a fraction of the expected fps. A few seconds into the stream, and the video and audio are hopelessly desynchronised. Most standard streams are unwatchable. Don't even think about HD A/V streams.
The standard media server set up delivers the compressed stream from the server to the client using some form of network file access protocol (e.g. NFS, CIFS), and lets the video client do the decompression and playback.
|
I'm setting up a media server for my movies. The server is networked and so are a couple laptops/desktops. The server is running the latest Ubuntu (desktop edition, not server).
This is the scenario I'm trying to achieve:Server is turned on and is connected to the network
Client (my laptop) opens a web interface to the server (or just sends it a command via ssh). I select the movie I want via the web interface, and my interface executes a command.
The command spawns an instance of VLC with the specified movie playing and forwards the window (just the window) to the computer which requested it.
End result: I have a VLC window on my laptop which plays the movie for me. I can close it when I'm done.Is it at all possible to forward just a window to a client on the network like that?
| How to forward a window (display) to another computer on the network |
Following the various guides, I copied the file /etc/ssh/sshd_config to a new directory, then ran the following command in the same directory to create a new key pair:
ssh-keygen -f myrsa -N ''I copied an xauth executable from a similar Linux system and placed it in the same directory.
I then modified the sshd_config file with the following lines:
Port 22220HostKey /path/to/directory/myrsaX11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
XAuthLocation /path/to/directory/xauthI could now start my own ssh server with X Forwarding enabled, on Port 22220 using the command:
/usr/sbin/sshd -d -D -f /path/to/directory/sshd_configAnd connect to it using the ssh command:
ssh -X -p 22220 <hostname>Once connected, I checked that the environment variable DISPLAY was set.
In order to run my X program on this host, I also needed to copy several library files, such as libxkbfile.so.1, into the same directory, from a similar Linux system with X support installed; I determined this by running ldd on the X program I was trying to run, looking for unresolved libraries, then I found them on the working system using ldconfig -p | fgrep libxkbfile.so.1 and used scp to copy them to the target system. Then I set
set LD_LIBRARY_PATH=/path/to/directoryso that the additional libraries could be found, and was able to run the X program and see the UI on my local system.
|
I have a GUI program which has all necessary libraries to run on a rented Ubuntu host, but the host itself rejects attempt to set up X forwarding during the ssh connection using -X. strace shows the UI program can run, but stops when it has no DISPLAY. I do not have root access to the rented host, it is not configured to forward X11 for normal users, and support for the host says they do not support it for users.
Is there any way to do X forwarding anyway, as I need it for just one critical program? ssh -X -v merely reports:
OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar 2016
...
debug1: Remote: /usr/home/ipdb/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug2: x11_get_proto: /usr/bin/xauth list unix:10.0 2>/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 1
...
X11 forwarding request failed on channel 0Is there any way to manually configure this, given that the local and remote hosts are both behind firewalls (so DISPLAY=$REMOTEHOST:0 won't work)? The host has an xauth and xhost that I copied from an Ubuntu host of the same dist version.
~/.ssh/rc runs during the connection, but does not have any arguments passed to it.
I suspect the reference to /usr/bin/xauth, which does not exist on the host, is the issue? Could I possibly run my own sshd and configure it with the correct xauth path?
| Can I forward X11 over ssh on an rented host without forwarding support |
So far I've found xdotool tool which can fake input from the mouse and keyboard quite easily.
Some examples with simple keyboard interaction:
xdotool key a
xdotool key Down
xdotool key Tab
xdotool key "Return"
xdotool key "Control_L+t"
xdotool key Alt+1
xdotool key ctrl+v
xdotool key Super
xdotool key KP_Enter
xdotool key ctrl+Page_Up
xdotool key ctrl+U005C
xdotool key ctrl+shift+e
xdotool key --delay 1000 shift+minus # for underscore
xdotool key --clearmodifiers shift+Insert
xdotool key --clearmodifiers --window 0x2600006 alt+1 0 9 8 7 6 5 4 3Example script with mouse interaction:
WINDOWID=$(xdotool selectwindow)xdotool set_window --overrideredirect 1 $WINDOWID windowunmap $WINDOWID windowmap $WINDOWID
xdotool windowsize $WINDOWID 10 100%# Set behaviors
xdotool behave $WINDOWID mouse-enter windowfocus windowsize --usehints 80 100% &
xdotool behave $WINDOWID mouse-leave windowsize 4 100% &Another example: How to send F5 keystroke to the first Chrome window.
More script examples please find them at GitHub or on the official page.
You can install it either from apt repository like: sudo apt-get install xdotool or compile from the sources.Wine
In case the X11 app is run under Wine, you can also use Winetricks. Check the source file (it's a shell script) for the guidance how to control the apps using the AutoHotkey tool.
More advance method can include using winedbg debugger and attaching to the process:
$ winedbg
Wine-dbg>info process
00000008 3 'terminal.exe'
Wine-dbg>attach 8
0xf7709c0e __kernel_vsyscall+0xe in [vdso].so: int $0x80then you can interact directly by using the debugger (see: man winedbg for help).
|
I'd like to set-up X11 Forwarding to run remote X applications on the server and the X11 client can handle the UX interaction.
However, I would like to configure the X11 client or fake it to actual do the user interaction programmatically (from the script).
For example, I want to run an app which requires some mouse clicks or keyboard interaction (such as installers), so I could programmatically send these clicks or keyboard key press signals to the app from the script until it finishes.
Is it something possible? How this can be achieved or where to start? Or how I can re-use/hijack X11 protocol to inject my own non-user interaction?
| How to programmatically control X11 forwarded apps? |
I believe XDMCP is using the fonts local to the Solaris system. When you SSH you're using fonts that are local, since in that scenario you're the X server and the Solaris box is the X client. You can use the command xlsfonts to see what fonts are accessible to you on a given system.
EDIT #1 - Font path
You can find out your system's font path using the command xset.
Example
$ xset q | sed -n '/Font/,/DPM/p'
Font Path:
catalogue:/etc/X11/fontpath.d,built-ins
DPMS (Energy Star):This path can include paths to local directories as well "paths" to other font servers. These will show up as port@host types of entries.
Example
$ xset +fp tcp/<IP or name of font server>:7100ReferencesXming Fonts |
Connecting to a remote Solaris 10 system over X11 I observe inconsistent behavior regarding the used fonts. I am connecting from a Cygwin/X system.
When I connect using ssh forwarding like this
$ ssh -Y mymachine.example.orgfonts work as expected, i.e. the rendering is very nice and programs seem to find all kind of different fonts (e.g. gvim or emacs).
When I connect to the same machine via XDMCP (to the stock blue Solaris 10 login manager screen) and login there seems only 1 fixed size font available. An Emacs from OpenCSW even fails to execute because it can't find the fonts it needs.
It prints that it can't find a font using following specification:
-dt-interface user-medium-r-normal-mI establish the XDMCP connection like this:
$ XWin -query mymachine.example.org -from mywindowsclient.example.orgMy objective is no to get also proper fonts for the XDMCP use case.
How can I investigate this issue? Can I duplicate some configuration which is implicitly used with ssh -Y for the XDMCP case?
How is the font-thing usually setup during ssh-X11-forwarding?
| How to configure fonts on a remote X connection (XDMCP vs. ssh)? |
startx gnome-session -- :1 tty8If you run this command over a ssh -X session, you are not going to achieve a remote gnome-session for yourself. Instead, you're effectively trying to remote-start a GNOME session on the tty8 virtual console of the remote host, for whoever happens to sit at that computer.
Instead, you would want to first set up SSH keys so that you can run commands on your remote host on your own account without prompts for a password or SSH key passphrase. Then you would run something like this on your local system:
startx ssh -X <remote host> gnome-session -- :1 tty8You might need to add & to the end to make the command run in the background.
Basically, you'll want:
1) a X server on your tty8, running as its session process...
2) ... the X-forwarding SSH connection to the remote host, where...
3) ...the gnome-session is started and will pass its displays back over the SSH connection back to the "empty" X server on your local tty8.
Note that if GNOME uses advanced 3d acceleration features of the GPU to render its desktop, it will be using direct rendering (= direct memory access between the GNOME window manager and the X server) when running locally. When running a remote session like this, direct rendering won't be possible (as the GPU is not in the same computer as the window manager process!), which may slow things down. In that case, you might have to choose a simpler window manager.
XDMCP is a protocol for controlling X11 terminals: stripped-down computer appliances whose only job is to act as a X11 display+mouse+keyboard for some other computer. The XDMCP protocol was developed way before SSH and is completely insecure. It does not apply to your case, unless you specifically configure the display manager (the gdm, kdm, xdm or any other *dm) to be XDMCP-aware, as XDMCP is disabled by default on modern systems because it isn't secure. If you did that, then you could tell startx to make your local X server pretend it's a X11 terminal, and have it make a direct, unencrypted, non-SSH-forwarded connection to the remote host. (Just say "no".)
X nesting, on the other hand, would allow you to e.g. have a single big window in your regular local X11 session on :0.0 (or tty7), which would then contain the remote desktop session.
|
I'm trying to set up a remote desktop connection to access my desktop PC from my laptop (both running Trisquel) over wifi. I've tried VNC and it was terribly slow, so I'm looking at alternative options. What I would ideally like to do is to start a remote X session over SSH, which would run on a separate tty on my laptop (i.e. tty8), using X forwarding. It seems like it should be possible, but I'm trying to get my head around how it works.
The X forwarding over the SSH tunnel seems to work fine for individual X applications, using ssh -X. I can also start a new local X session on tty8 by using the following command (with xinit installed):
startx lxsession -- :1 tty8So, putting two and two together, I should be able to start a remote session over the SSH connection by typing the following command after logging in to the remote machine with SSH, right?:
startx gnome-session -- :1 tty8But no, it doesn't work! I get the following error:
X: user not authorized to run the X server, aborting.From what I've read, it seems that I need to use either XDMCP and/or X nesting to accomplish this.
So, my question is: why is it necessary to use these extra packages to do this? I thought that X is supposed to have network transparency, in which case, why would it know/care whether the tty I'm trying to use is on a local or a remote machine? What does XDMCP/X nesting bring in to the picture, that X doesn't include by default?
I'm just trying to get my head around this and understand it a bit better.
| Why do I need XDMCP to start a remote X session over SSH? |
You only need to run the X server on your client PC where you want see the GUI/Desktop. Typically this would be on your Windows PC in most environments ofcourse you could run it on a Linux/Mac workstation to. Point is the X Server itself must run on the client pc. The Linux server needs SSH along with the X Window System installed from packages, usually it is by default. The best client software I've seen to do this is MobaXTerm. MobaXTerm is a terminal client that runs an X Server on your client PC. The cool thing about MobaXTerm is it does the X Server for you along with exports the variables when you ssh to a server, it usually just works.
A tip though, if you login to a server using a terminal client such as MobaXTerm if you su, sudo, and/or switch users you loose the environment variable named DISPLAY=hostname:X.X which is required for this to work.
To install X Window software on Linux server at least CentOS/RHEL environments, others are probably similar you can check for the following.
yum groupinfo "X Window System"
yum groupinstall "X Window System"Then update /etc/ssh/sshd_config to enable X11 Forwarding for SSH then restart your sshd service.
|
For X11 forwarding, do both the local and remote systems have to run an X server?
Can I do X11 forwarding if my remote machine is in: runlevel 3, meaning that no X server is running?
| What X Server requirements are associated with X11 forwarding? |
Finder doesn't use X APIs, so can't be forwarded over over ssh like that. Same with most mac applications; apple have their own windowing system called Aqua. Sharing the desktop via VNC or apple remote desktop works fine though -- look in the "Sharing" preference pane for the "Screen Sharing" option to set it up on the mac, then use a vnc client on the other machine.
|
Using XForwarding, you can access GUI applications over ssh between two Xorg-powered machines (and sometimes even from a windows machine).
Is there a way to access OSX applications (like Finder) from an Xorg machine?
| XForwarding Applications from OSX |
You need a version of vim that was compiled with X support. You can run gvim -v (after installing gvim, of course) to run an appropriate version in a terminal.
|
I spend a lot of time on Mac OS X as a desktop system, and on the Mac there are two nice little utilities for the command line, pbcopy and pbpaste which can accept stdin and write to stdout. Is there a similar utility or non-GUI pasteboard in linux? How does that work?
I read over this blog post http://blog.roseman.org.uk/tag/iterm2.html in which a guy who works for Google says that he can use XQuartz, iTerm2, and vim and have things he yanks in vim copied to the system pasteboard, which syncs with his local clipboard.
I've installed XQuartz, changed preferences and checked the boxes to sync the pasteboards, and connected to ssh remotely with X forwarding (ssh -X) but when I yank things in vim to the system pasteboard ("+yy) on a remote system, my local clipboard does not change.
What am I doing wrong? Do I need to be using tmux to have the pasteboards sync?
I'm going into this a little blind having not used the pasteboard in command-line linux before. Can someone help me understand a little more on this subject?
| Is there a clipboard on non-GUI Ubuntu / Linux systems? Can I synchronize it with my local (OS X) clipboard? |
it seems that the solution is described here:
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/#xforwarding
it's all about the PULSE_SERVER "variable". So starting a process with PULSE_SERVER=localhost appenden before ensures the audio protocols run on the host machine. In my case the single board computer and not the laptop.
I have only had the chance to test this once, so I am not sure it works on all scenarios but here it is:
[user@fedora ~]$ ssh user@mobian -YC...user@mobian:~$ PULSE_SERVER=localhost [YOUR_APLICATION]I'll try to update if I get more information.
|
i am connecting from a laptop:
$ uname -a
Linux fedora 5.11.18-200.fc33.x86_64 #1 SMP Mon May 3 15:05:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linuxto a single-board-computer:
$ uname -a
Linux mobian 5.10-sunxi64 #2 SMP PREEMPT Tue Jan 12 09:55:56 UTC 2021 aarch64 GNU/Linuxover SSH with compressed X11 forwarding:
ssh -YC user@mobianeverything seems great except for the fact, that audio plays in the laptop and I want it to play in the remote machine. how is this achieved?P.S. I suspect this is something fedora-specific as the same ssh -YC user@mobian connection from a different device:
$ uname -a
Linux sxmo 5.11.0 #1-postmarketos-allwinner SMP Sat Mar 27 14:48:00 UTC 2021 aarch64 GNU/Linuxleaves the audio-output on the remote machine.EDIT based on comments:
locally on fedora:
[user@fedora ~]$ xprop -root | grep PULSE
PULSE_COOKIE(STRING) = "28d747cacea4736118f778c450628a4b88489d1158cc10899f3bc54a078fe37b843810ebeb397abece2533b0d988569f3d01b838b2f7fa560712c78cc9d64cbba2d0e9e34f602b348ccf589d4f0bf159c9a078bf1a6e9a8140f930b2d5e4cb21cb31bf8f22112b2cfd2476f02694e3060ae9f3918e58629a49ec1fbb730c2af4dee1f42de13c0046b2f7fc664302724fbc3d27a0863e98dcede752d9451644d6f8b5e10f0a1ec88320b8686b292b6225c02c043719818a4d4041fcb60bfeef97ebfb6601f83c5d8052a64489c5507ac02876d171a6bb942f20991e0a31271c97d2ba3b9f8baef66a06affb5d33aa198be394f798622d6ffd8d2a5926a8402a08"
PULSE_SERVER(STRING) = "{f5e96850fbf948e19c0eba4f100fa72a}unix:/run/user/1000/pulse/native tcp:fedora.localdomain:4713 tcp6:fedora.localdomain:4713"
PULSE_SESSION_ID(STRING) = "2"
PULSE_ID(STRING) = "1000@f5e96850fbf948e19c0eba4f100fa72a/1985"remotely on mobian without -YC:
user@mobian:~$ xprop -root | grep PULSE
xprop: unable to open display ''remotely on mobian with -YC:
[user@fedora ~]$ ssh user@mobian -YC...user@mobian:~$ xprop -root | grep PULSE
PULSE_COOKIE(STRING) = "28d747cacea4736118f778c450628a4b88489d1158cc10899f3bc54a078fe37b843810ebeb397abece2533b0d988569f3d01b838b2f7fa560712c78cc9d64cbba2d0e9e34f602b348ccf589d4f0bf159c9a078bf1a6e9a8140f930b2d5e4cb21cb31bf8f22112b2cfd2476f02694e3060ae9f3918e58629a49ec1fbb730c2af4dee1f42de13c0046b2f7fc664302724fbc3d27a0863e98dcede752d9451644d6f8b5e10f0a1ec88320b8686b292b6225c02c043719818a4d4041fcb60bfeef97ebfb6601f83c5d8052a64489c5507ac02876d171a6bb942f20991e0a31271c97d2ba3b9f8baef66a06affb5d33aa198be394f798622d6ffd8d2a5926a8402a08"
PULSE_SERVER(STRING) = "{f5e96850fbf948e19c0eba4f100fa72a}unix:/run/user/1000/pulse/native tcp:fedora.localdomain:4713 tcp6:fedora.localdomain:4713"
PULSE_SESSION_ID(STRING) = "2"
PULSE_ID(STRING) = "1000@f5e96850fbf948e19c0eba4f100fa72a/1985"locally on mobian:
user@mobian:~$ xprop -root | grep PULSE
PULSE_COOKIE(STRING) = "8139d0fdc04752954ff9018ca4006d741d1b8aef9ed8fdd041184fda6080bad0fbf0e0ca00ecc6eacd5b4adde99d84ac33932773da3b8dd99a2adaeb085cd622daefbd75ab193690185f856457ac9541a1e4075a8217484df1bd136d00bc6c0c80abef6e3ee86daed144c33fece49cd9a896c3bb7dcb6520441f21c48a7f045693d9d6e47e2f7bc32ce6ce4b958df2842f8d7298d690e48a1343fbed5310fa50475acaf928047802978cf0f417502c298332b56e5a66a75b97e9ddb59a739e4d34c8f63fbb7ce883b35ed115c44639db11d5e543665978dfcbe43b5d8d41677ee68195c153103986283d80b2ce3239559f12d2928b9ffb05054e3cca70ff277d"
PULSE_SERVER(STRING) = "{e5ca38bfe5be445f838be0328a1c5f33}unix:/run/user/1000/pulse/native tcp:mobian.localdomain:4713 tcp6:mobian.localdomain:4713"
PULSE_ID(STRING) = "1000@e5ca38bfe5be445f838be0328a1c5f33/615" | X11 forwarding, how to force audio to the host? |
ssh example.com somecommand doesn't read your ~/.profile; somecommand is executed directly by the ssh daemon. When you don't specify a command, the ssh daemon invokes your login shell, which reads your ~/.profile. (Substitute ~/.bash_profile, ~/.zprofile or ~/.login depending on your login shell.)
There are a few ways to set environment variables for a non-interactive command, but they all require a setting in the server configuration which is typically off by default. Assuming a recent enough OpenSSH on both sides:You can have environment variables sent from the client to the server with the SendEnv directive in ~/.ssh/config. The specific environment variable must be enabled with an AcceptEnv directive in the server configuration.
You can set environment variables through ~/.ssh/environment on the server side. This must be enabled in the server configuration with the PermitUserEnvironment directive.
Assuming you use key-based authentication, you can also set per-origin variables in ~/.ssh/authorized_keys: add environment="FOO=bar" at the beginning of the relevant line. Again, you need the PermitUserEnvironment directive in the server configuration.If you can't or don't want to change the server configuration, you'll have to write the full path to the remote command, or explicitly source your .profile in the remote command.
ssh [emailprotected] -Y '. ~/.profile; netbeans'
ssh [emailprotected] -Y '/path/to/netbeans' |
I tried to XForward netbeans to my laptop, using the following code:
# This does not work
$ ssh [emailprotected] -Y netbeans
which: no javac in (/usr/bin:/bin:/usr/sbin:/sbin)
which: no java in (/usr/bin:/bin:/usr/sbin:/sbin)
Cannot find java. Please use the --jdkhome switch.That did not work, but this did:
# This works
$ ssh [emailprotected] -Y
user@home $ netbeansMy questions:Why does the first method fail?
How can I make the first method work? | XForwarding not loading correct $PATH |
When you forward an X11 connection, you give the remote system access to your local X11 session (through SSH). Thus, when you connect to B from A, with X11 forwarding enabled, the programs you run in that SSH session are connected to your X11 session on A. This explains why xclip shows the same contents on A and in the SSH session from A to B.
The X11 session on B is separate, and isn’t connected to A or your SSH session.
There are two X11 sessions, but not on B: one on A, one on B.
X11 sessions “live” in the X11 server, they’re not stored in files.
|
I've been using X11 forwarding to forward clipboard contents from remote servers.
When I tried to use X11 forwarding from one GUI linux computer to another, I noticed something peculiar. Let's say that machine A sshs into machine B.
I can issue the following command on any machine to check its clipboard contents
xclip -selection clipboard -oI see the same clipboard contents when I issue it on A and on the ssh prompt connected from A to B.
However, if I issue it on machine B's GUI session, then I see different contents!
Does this mean that machine B has two X11 sessions? One for the GUI, and one created when I ssh'd into it via A?
Since on linux everything is a file, where do files for these respective sessions live?
| Does X11 forwarding create a "new" X11 session? |
You can use X forwarding on Windows as well; all you need is an X server (such as Xming) and an SSH client (such as PuTTY). Xming includes documentation explaining how to go about things; basically, you enable X forwarding in PuTTY, start the X server on your Windows machine, SSH to the Linux machine and run your Java application. You might find that rather slow though.
Alternatively you might get better results with VNC; you need to start a VNC server on the Linux machine and connect to it with a VNC client on the Windows machine. You'll find VNC servers packaged for your Linux distribution; a decent VNC client for Windows is TightVNC.
|
I usually use laptop (which has Windows) to ssh to my Linux server and run stuff on it (e.g. Intellij, MATLAB).
I wonder if there anyway to open Java programs (again, like Intellij) of a remote linux machine, in Windows environment (say by doing something like Xforwarding?), since both machines already contain JVM.
Note that I don't want to run the programs directly on Windows (since they have some dependencies on my linux server). So instead I need to run it on linux. The desired is a way to open the such "java" programs (which are running on a remote unix machine) in the Windows environment (like how people use Xforwarding when ssh-ing between linux machines).
Note: I have been using FastX and NXClient so far, but these are too slow and annoying.
| Open Java programs of a linux machine on Windows with SSH? |
I found two methods:The first onefrom local machine, ssh -X remote
get the display port number echo $DISPLAY | awk -F'[:.]' '{print $2}', assume it is 10
check whether port 6020 in remote is used: lsof -i TCP:6020, assume it is not
forward the port 6020 to 6010: ssh -NTR 6020:localhost:6010 localhost optionally add -f (need to remember to kill this process when exit if -f is used, recommend trap "kill $!" EXIT
set env: DISPLAY=${DISPLAY/:10/:20}
update ~/.Xauthority to let display port localhost:20.0 get the same xauth magic key: xauth add $(xauth list :10 | sed 's/:10/:20/')Alternativelyssh to remote without using -X: ssh remote
in remote machine set DISPLAY=localhost:20.0
in local machine, forward remote port 6020 to the local machine's xserver socket /tmp/.x11-unix/X0: ssh -NTR 6020:/tmp/.x11-unix/X0 remote, optionally add -f
transfer the local machine's xauth key to the remote machine: in local xauth list :0, assume it is local-hostname:0 MIT-MAGIC-COOKIE-1 hash
in remote machine: do xauth add remote-hostname:20 MIT-MAGIC-COOKIE-1 hash.Comparing these two methods, the first one doesn't need to transfer the local machine's xauth key to the remote machine, which MAYBE more secure (could any expert tell what potential security issue can raise if I do so?). But it needs to occupy two ports: the one assigned by ssh -X and the one that you want to use.
|
When I ssh -X to a server, I will be assigned a $DISPLAY value, usually localhost:x.0 where x is the lowest number unused by all the users starting from 10. (e.g., if no other user uses $DISPLAY, then it is 10. If some user is already using 10, then it will be 11, etc)
Now my question is: is there a way to specify a number for x when doing ssh -X, like 100.
My purpose is to have a detached program keeping running on the server that always use localhost:100.0 as its display. Then even if I lost the X connection to the server, I can re-login and still establish a connection to localhost:100.0 without worrying about other users occupying the same port during my disconnection. Choose a number as big as 100 can avoid most of the possibilities that it get occupied, comparing to the default 10.
| How to specify `$DISPLAY` when ssh with X forwarding |
I'm not the expert in X11 and even Linux, but I heard that OS X implementation of Xorg Server doesn't support some required extensions for visually rich UI. Or may be transparency (and other effects) in Linux can only be achieved with composition manager (such as xcompmgr, Compiz, etc.) on client side, so they can not transfer them over network based X11 protocol.
I suggest you to try also X2go and NoMachine 3.4 / 4.
|
raspberry-pi-7 1.jpg http://img823.imageshack.us/img823/2756/raspberrypi71.jpg
Just got my Raspberry Pi in the mail and I've started playing around with it. After getting LXDE up and working working in desktop mode (i.e. monitor and keyboard plugged in) I decided I wanted to connect to it remotely.
I know I can use a VNC/RDP client but maybe for now just connecting with XForwarding and launching lxsession would be fine. To describe my environment, I'm using OS X I had previously installed XQuartz.app to replace the native X11 app (because it boasted more features and benefits for using X applications).
The first time I connected as root via ssh to the remote machine and launched lxsession it gave me the behavior that I am seeing to have again - I kept my Mac OS X desktop background and it simply overlaid the LDE menu at the bottom of the screen - sort of a transparent desktop:However now when most of the time when I do these steps again it not have a transparent desktop - it will in fact show the LXDE background:
Picture copy 3.png http://img802.imageshack.us/img802/2797/picturecopy3.png
Is there an option I'm missing to be able to be able to achieve the "transparency" or "integrated" version?
I looked in the LXDE Desktop Preferences and didn't see an option to disable it:
Picture 1.png http://img694.imageshack.us/img694/980/picture1brt.png
I have tried setting the desktop image to a transparent gif file which will remove the picture, but then I didn't see any way to remove the desktop background color - because after I select the transparent file I am just getting a solid color.
How can I achieve the "transparency" or "integrated" version of LXDE via X forwarding from OS X?
| How can I force LXDE to have a transparent background when connecting with X/X11? |
This is explained by the entry for ForwardX11Trusted in Debian's man for ssh_config, with Ubuntu behaving the same as Debian, but not Manjaro:ForwardX11Trusted
If this option is set to yes, (the Debian-specific default),
remote X11 clients will have full access to the original X11 display.
If this option is set to no (the upstream default), remote X11
clients will be considered untrusted and prevented from stealing or
tampering with data belonging to trusted X11 clients. Furthermore,
the xauth(1) token used for the session will be set to expire after 20 minutes. Remote clients will be refused access after this time.That would explain why you might not have encountered this issue before if you were mainly using Debian-based systems like Ubuntu.
The shortcut to enable this option is -Y. So you can simply replace -X with -Y in the first ssh command to "fix" the issue.
By the way, forwarding twice the X11 display isn't the best method, especially when using -Y, because the X11 display gets exposed in the intermediate system B to other users if this is a kind of multi-users bastion system. It would be better instead to forward only the port 22 of target machineC and tunnel everything else through it. Fortunately there are options made exactly for this: the ProxyJump option and its shortcut -J. In the end you could run on machine A just:
ssh -Y -J userb@computerB userc@machineC |
From my main host[A] (with a screen), I ssh into a relay computer[B] (with -X) from where I log into the target machine[C] (again with -X) and X forwarding seems to work well for a while. After working on the target machine[C] in vim for a while though, I suddenly lose the ability to utilize the X forwarding functionality and I need to log off from C and B, just to restart the ssh sessions again, then X works fine again. And this happens during a normal day i.e. none of the hosts goes suspends (or powers off).
When it all works as expected, C shows:
$ echo $DISPLAY
localhost:10.0and an application like xeyes is forwarded and renders fine on A's screen.
And then suddenly it will report:
$ xeyes
Error: Can't open display: localhost:10.0
$ echo $DISPLAY
localhost:10.0and /var/log/syslog nor journalctl (both on C) suggest anything suspicious, again the ssh session stays alive and well. Anybody know what could be the issue?
Some more details about the hosts:A is a physical manjaro box (connected to LAN)
B is a physical Ubuntu 21.04 machine (connected to LAN)
C is a VM on B running Ubuntu 18.04 (connected by NAT) | X forwarding is interrupted while ssh stays connected |
ssh is used to execute a remote shell, therefore it is usually for text-oriented commands (as opposed to graphical applications, like SDL ones). So don't expect graphical application to be able to run remotely through ssh.
Fortunately, ssh is a powerful tool: owing to the network-friendly X protocol, ssh provides a way to connect remote X applications to your local X server with the -X option (X11 forwarding).
What it does basically, is open a virtual display on the remote machine (let's say :10) by just listening on TCP port 6010 (port 6000+n corresponds to X11 display n) and forwarding everything to your local port, the one corresponding to your current X11 display (usually :0, listening on port 6000).
If you got me right, for everything to work, you not only need to use ssh -X, you must use an X11 server locally.
Windows does not come with an X11 server, so you must download and install one. Sorry, I'm blessed enough to not use Windows, and I have none to recommend. FWIW, on the Internet, some mention "Cygwin/X" (or xwin?), others "VcXsrv".
Once you have an X11 server running under Windows, what is important is that ssh uses that X11 server. Maybe the most straightforward is to run an X11 terminal from your local X server, and from that terminal execute ssh -X. Maybe just export DISPLAY=:0 before executing ssh -X would be enough. TBH, I don't know and I won't be able to help you further.
|
I have a C program using SDL on my linux PC, when I try to launch this program from my windows pc with ssh it give me an error : no protocol specified and no available device. I have try to start SSH with -X or export DISPLAY=0 but it doesn't work. What should I do ?
When I try with root : error: XDG_RUNTIME_DIR not set in the environement
Thanks
| Running SDL code in SSH |
You can use the sudoedit command instead.
EDITOR=gedit sudoedit filename.txtwhat this does is take a copy of the file, then runs the editor as you, then if it detects the file has changed copy the results back.
In most cases has the same effect as sudo gedit filename.txt but it runs the editor unprivileged and so your X forwarding should still work.
|
The centos Server and ubuntu host machine both has gedit installed. Root login to the server is blocked and only a user can login via SSH through rsa keys.
When I log in to the server with -X supplied as parameter, I can use gedit like:
gedit filename.txt &
and the file opens in gedit for me to edit and save. But if I do Sudo to edit files then I get following error:
sudo gedit filename.txt &[1] 11039
[user@server ~]$ X11 connection rejected because of wrong authentication.** (gedit:11040): WARNING **: Could not open X display
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.(gedit:11040): Gtk-WARNING **: cannot open display: localhost:10.0[1]+ Exit 1 sudo gedit filename.txtHow can I use Gedit in such situation.
| using Sudo wth Gedit fails from XForwarded server |
Based on the comments to the question, I found
Why can't I run Gnome apps over remote SSH session?
Two of the answers (not the accepted one, but that is older, and might work too, just not be the easiest way any longer) there mentioned dbus-launch. And if I run dbus-launch notify-send "Hello world", the notification does appear on the screen of my laptop.
|
I have two computers, a desktop and a laptop, both running Debian Stretch.
Desktop notifications works on the laptop, and I believe it works (the attached
monitor is broken, so I can't check, and maybe I should say "used to work").
On the laptop I run i3 as wm, no desktop environment, and dunst as notification
daemon.
I have no problems logging in to the desktop using SSH from the laptop. X forwarding also works, but desktop notifications aren't forwarded.
If I run notify-send "Hello world" on the laptop, I get a notification saying "Hello world", if I run the same command on the desktop (through a SSH connection, where I can start X programs, so X forwarding is enabled and working) nothing happens. One program that tries to send notifications, outputs:
** (transmission-gtk:21556): CRITICAL **: gtr_notify_torrent_completed: assertion 'G_IS_DBUS_PROXY (proxy)' failedwhen it tries.
How can I make desktop notifications get forwarded?
| Forwarding desktop notifications over SSH |
"the mapping of $DISPLAY on C to $DISPLAY on B" what does that mean?
Clearly you grep out of something on C, so you only see sockets on C which involves "port num=6010". Other connection or listening socket on C are grep out.
You didn't see any connection before because there hasn't been any X client running and connected to sshd(port number=6010), and more info after because you now run an X client, which has connected to your sshd(port num=6010).
You have to know the network topology when using SSH tunnel. SSH server on C opens a new socket which listen on port 6010 because it was asked to by the SSH client on B. The ssh tunnel is still established between SSH client on B and SSH server on C(port num=22, if sshd not specially configured), you don't see this tunnel connection since you grep it out. X clients on C connects to sshd(port number=6010), then sshd multiplex these connections using the ssh tunnel and forward these connections to the X server on B.
"Connection between $DISPLAY on C and $DISPLAY on B" doesn't really exist, the ssh tunnel is created between C:22 and address_of_the_SSH_client_on_B. And since it's a connection, it's not possible in the LISTENING state.
use netstat -ap without grep to see more information.
All the connection we mentioned in this answer means real TCP connection, from the kernel's view, not "connections" from end-users' view.
|
On machine B, I remote access machine C
$ ssh -X t@C
$ echo $DISPLAY
localhost:10.0How can I find/verify the mapping of $DISPLAY on C to $DISPLAY on B? Can it be done by the following command on C?
$ netstat -a | grep 6010
tcp 0 0 localhost:6010 0.0.0.0:* LISTEN
tcp6 0 0 ip6-localhost:6010 [::]:* LISTEN Why is the connection between $DISPLAY on C and $DISPLAY on B LISTEN not ESTABLISHED, given that the X forwarding channel has been created?
When I run a X client on C, how can I verify that it is connected to the X server on B (the local machine)? Why do I get more information about port 6010 in the following than before running the X client?
$ eog &
[1] 1129
$ netstat -a | grep 6010
tcp 0 0 localhost:6010 0.0.0.0:* LISTEN
tcp 0 0 localhost:59782 localhost:6010 TIME_WAIT
tcp 0 0 localhost:59780 localhost:6010 ESTABLISHED
tcp 0 0 localhost:59778 localhost:6010 TIME_WAIT
tcp 0 0 localhost:6010 localhost:59780 ESTABLISHED
tcp6 0 0 ip6-localhost:6010 [::]:* LISTENThanks.
| How can I find the mapping on `$DISPLAY` after `ssh -X`? |
So I found out that there was a font missing on the server. I installed dejavu-lgc-sans-fonts on the remote server.
yum install dejavu-lgc-sans-fontsAfter this everything worked fine.
|
I am connecting to via SSH and activated x-forwarding
[user@client]# ssh -X [emailprotected]And open a graphical program (like gedit)
[user@server]# geditIt opens, however, characters are not displayed properly:Client (my machine): Ubuntu 18 / Remote Server: Centos 7
| X-Forwarding: Characters are not displayed properly |
Add exec to your script:
#!/bin/sh
exec /usr/bin/java -classpath /A/B.jar:/X/Y.jar MyApp.Go -p 1 -p 2 -p 3This will cause the java process to replace the shell process running the script, instead of becoming a child process of the shell. That way, once the java process starts up, there will be no shell to return to, and if the java process dies for any reason, the login session will just end immediately.
|
I have a java application (not applet) which I run via a script which contains just this:
#!/bin/sh
/usr/bin/java -classpath /A/B.jar:/X/Y.jar MyApp.Go -p 1 -p 2 -p 3This app, during initialisation, requires to read a lot of auxiliary files which live in the local disk along with the app. These files are a few gbytes. The app's GUI is simple: clicking on the main window (a map) a script is launched via java.util.concurrent.ExecutorService. The script will do some processing and output its result to a file. Which the app then reads and presents to a new window. The only button is for Quitting. No other user input, no file selectors.
I needed a solution in order to allow this app to be run remotely. That is: app+data reside on my linux-server and client needs to run it from their own computer, remotely. I would like to avoid sending the app over to the client. Not only because I want to hide the code (to avoid de-compilation) but also because those gbytes of local data need to be bundled as well - not practical.
I have looked at converting it into an applet but except from the fact that (most/all) browsers now don't support it, that applet must be run on the client's computer and all those data files would eventually need to be read from server and transfered over to where the applet is running+initialising, i.e. the client's computer. Not practical again.
I have also looked at some applications which convert java bytecode to javascript, claiming they give you something which runs in HTML5. This worked only for a toy app.
RFC:
Eventually I thought about creating a new user in my server whose SHELL would be pointing to the script which runs the java app (script above). I have allowed X11Forwarding yes in sshd's config at my server and told the linux-based clients to just do: ssh -X [emailprotected] and the app would appear on their desktop. I also told the windows-based clients to install an X-server and do something similar. This tested well on linux (not tried on windows).
I am looking for comments on my approach, especially regarding security. I am comfortable on giving a client a limited account like this. But I would not like the client to find access to a shell in my server if the app crashes.
| RFC: ssh -X to run a java app on login via SHELL variable, security and other issues? |
You need to have a working DISPLAY before X can be forwarded to you. Before your:
ssh -X -p 43022 usr@localhostcheck with echo $DISPLAY and run xeyes. If the $DISPLAY is empty or if xeyes does not run ... X forwarding will not work, there's nothing to forward it to.
|
I have a host which I want to access through reverse ssh and I also want to forward X11.
So I did this on the remote host:
ssh -X -R 43022:localhost:22 usr@myhost -p 2222
and I can connect fine with ssh -X -p 43022 usr@localhost from myhost but the X11 forwarding doesn't seem to work:
$ xeyes
Error: Can't open display:why is that?
| why does forwarding X11 over reverse ssh tunnel not work properly |
When you login via ssh from a Mac to the Pi, the client program (oneko) runs on the Pi, and contacts the X server that is running on the Mac.
I just tried this by logging into my Debian PC from my MacBook via ssh, and oneko runs fine, and when I do xdpyinfo, I see the same amount of extensions as I see when I do xdpyinfo directly on my Mac.
However, in your case the forwarded connection is drastically different:
number of extensions: 2
BIG-REQUESTS
XC-MISCand that is way to few extensions, in particular no SHAPE. So now the question is why this happens.
I see that you have two X forwarding logins (sshd listening both on 6010 and on 6011). What happens when you use only a single login?
Edit
To add the outcome of the comments to the answer: It is necessary to use ssh with trusted forwarding (i.e. ssh -Y instead of ssh -X) to make all the extensions available.
|
I'm working on a Raspberry Pi Zero W running Raspbian GNU/Linux 10 (buster). Other X11 applications like xlogo, xclock, xosview, and even xeyes works perfectly well, but I have no luck running oneko.
pi@nalzoks-pi:~ $ oneko
Display not supported shape extension.
oneko: Error and exit.
BadAccess (attempt to access private resource denied)
pi@nalzoks-pi:~ $ oneko -noshape
oneko: Error and exit.
BadAccess (attempt to access private resource denied)
pi@nalzoks-pi:~ $ sudo oneko
sudo: oneko: command not foundI'm accessing the Pi through SSH within a local network and using X11 forwarding.
Any thought?Here is more information in case you need it
On Pi Zero (SSH server accessed with ssh -X [emailprotected])
pi@nalzoks-pi:~ $ echo $DISPLAY
nalzoks-pi:11.0
pi@nalzoks-pi:~ $ sudo lsof -i -P -n | grep LISTEN
autossh 1608 pi 3u IPv4 19696 0t0 TCP 127.0.0.1:30001 (LISTEN)
ssh 1613 pi 4u IPv6 19718 0t0 TCP [::1]:30000 (LISTEN)
ssh 1613 pi 5u IPv4 19719 0t0 TCP 127.0.0.1:30000 (LISTEN)
sshd 1719 root 3u IPv4 20283 0t0 TCP *:22 (LISTEN)
sshd 1719 root 4u IPv6 20289 0t0 TCP *:22 (LISTEN)
sshd 7110 pi 10u IPv4 38831 0t0 TCP *:6010 (LISTEN)
sshd 7110 pi 11u IPv6 38832 0t0 TCP *:6010 (LISTEN)
sshd 7394 pi 10u IPv4 40700 0t0 TCP *:6011 (LISTEN)
sshd 7394 pi 11u IPv6 40701 0t0 TCP *:6011 (LISTEN)
pi@nalzoks-pi:~ $ xdpyinfo
name of display: nalzoks-pi:11.0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11804000
X.Org version: 1.18.4
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7
supported pixmap formats:
depth 1, bits_per_pixel 1, scanline_pad 32
depth 4, bits_per_pixel 8, scanline_pad 32
depth 8, bits_per_pixel 8, scanline_pad 32
depth 15, bits_per_pixel 16, scanline_pad 32
depth 16, bits_per_pixel 16, scanline_pad 32
depth 24, bits_per_pixel 32, scanline_pad 32
depth 32, bits_per_pixel 32, scanline_pad 32
keycode range: minimum 8, maximum 255
focus: None
number of extensions: 2
BIG-REQUESTS
XC-MISC
default screen number: 0
number of screens: 1screen #0:
dimensions: 1440x878 pixels (381x232 millimeters)
resolution: 96x96 dots per inch
depths (7): 24, 1, 4, 8, 15, 16, 32
root window id: 0x111
depth of root window: 24 planes
number of colormaps: minimum 1, maximum 1
default colormap: 0x21
default number of colormap cells: 256
preallocated pixels: black 0, white 16777215
options: backing-store NO, save-unders NO
largest cursor: 32x32
current input event mask: 0x1a0000
StructureNotifyMask SubstructureNotifyMask SubstructureRedirectMask
number of visuals: 80
default visual id: 0x22
visual:
visual id: 0x22
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0xc1
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits ... similar line omitted for brevity ...On MacBook Pro (SSH client)
$ echo $DISPLAY
:0
$ xdpyinfo
name of display: :0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11804000
X.Org version: 1.18.4
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7
supported pixmap formats:
depth 1, bits_per_pixel 1, scanline_pad 32
depth 4, bits_per_pixel 8, scanline_pad 32
depth 8, bits_per_pixel 8, scanline_pad 32
depth 15, bits_per_pixel 16, scanline_pad 32
depth 16, bits_per_pixel 16, scanline_pad 32
depth 24, bits_per_pixel 32, scanline_pad 32
depth 32, bits_per_pixel 32, scanline_pad 32
keycode range: minimum 8, maximum 255
focus: None
number of extensions: 25
Apple-DRI
Apple-WM
BIG-REQUESTS
DAMAGE
DOUBLE-BUFFER
GLX
Generic Event Extension
MIT-SCREEN-SAVER
MIT-SHM
Present
RANDR
RECORD
RENDER
SECURITY
SGI-GLX
SHAPE
SYNC
X-Resource
XC-MISC
XFIXES
XINERAMA
XInputExtension
XKEYBOARD
XTEST
XVideo
default screen number: 0
number of screens: 1screen #0:
dimensions: 1440x878 pixels (381x232 millimeters)
resolution: 96x96 dots per inch
depths (7): 24, 1, 4, 8, 15, 16, 32
root window id: 0x111
depth of root window: 24 planes
number of colormaps: minimum 1, maximum 1
default colormap: 0x21
default number of colormap cells: 256
preallocated pixels: black 0, white 16777215
options: backing-store NO, save-unders NO
largest cursor: 32x32
current input event mask: 0x1a0000
StructureNotifyMask SubstructureNotifyMask SubstructureRedirectMask
number of visuals: 80
default visual id: 0x22
visual:
visual id: 0x22
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
visual:
visual id: 0xc1
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits ... similar line omitted for brevity ... | oneko: Error and exit |
This is what works for me:Start ssh with ssh -X [emailprotected].
Note that $DISPLAY is 'localhost:10.0' or
similar, and that's correct - it shouldn't be the guest's IP address.
Start VirtualBox from the ssh prompt virtualbox &.The VirtualBox gui appears on the guest, and vms started from it appear on the guest.
If this is already what you are doing, can you confirm that you don't start the VirtualBox gui on the host machine's display, or at least you close it? I don't think there is a way to move a windowed application from one X display to another.
Also, can you open browser windows or other apps more complex than xclock?
|
My local machine is Fedora laptop. My remote server is FreeBSD 11.0 (located across the room).
The objective is to have VirtualBox forwarded over SSH. If I plug a monitor into the remote server, run 'startx', and then 'VirtualBox', the VB manager shows up in a window with the VM I created via CLI.
I have configured both local and remote hosts to support X11 forwarding. I can run xclock and xcalc etc successfully from my laptop.
However, when I run 'VirtualBox' over SSH from the local machine to the remote, there is no output and the VB command just sits there, as if it has opened the VB manager on the remote machine and won't forward it the local display.
How can I get VirtualBox to forward its X session to my laptop?
Some outputs:
$ groups
user1 wheel operator vboxusers$ export DISPLAY=VirtualBox
$ VirtualBox
Qt FATAL: QXcbConnection: Could not connect to display VirtualBox
Abort trap$ export DISPLAY=localhost:10.0$ ls -al /usr/local/lib/virtualbox/VirtualBox
-rwsr-xr-x 1 root vboxusers 29568 May 2 03:36 /usr/local/lib/virtualbox/VirtualBox$ truss -D -o VirtualBox.truss VirtualBox
VirtualBox: Error -10 in SUPR3HardenedMain!
VirtualBox: Effective UID is not root (euid=1000 egid=1000 uid=1000 gid=1000)VirtualBox: Tip! It may help to reinstall VirtualBox.$ cat VirtualBox.truss
0.000156317 mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366304256 (0x800643000)
0.000123821 issetugid() = 0 (0x0)
0.000117001 lstat("/etc",{ mode=drwxr-xr-x ,inode=39,size=114,blksize=7680 }) = 0 (0x0)
0.000111085 lstat("/etc/libmap.conf",{ mode=-rw-r--r-- ,inode=716,size=109,blksize=4096 }) = 0 (0x0)
0.000049185 openat(AT_FDCWD,"/etc/libmap.conf",O_CLOEXEC,00) = 3 (0x3)
0.000037486 fstat(3,{ mode=-rw-r--r-- ,inode=716,size=109,blksize=4096 }) = 0 (0x0)
0.000036905 mmap(0x0,109,PROT_READ,MAP_PRIVATE,3,0x0) = 34366337024 (0x80064b000)
0.000021263 close(3) = 0 (0x0)
0.000025546 lstat("/usr",{ mode=drwxr-xr-x ,inode=9,size=16,blksize=4096 }) = 0 (0x0)
0.000025097 lstat("/usr/local",{ mode=drwxr-xr-x ,inode=1033,size=16,blksize=4096 }) = 0 (0x0)
0.000027033 lstat("/usr/local/etc",{ mode=drwxr-xr-x ,inode=16436,size=45,blksize=4096 }) = 0 (0x0)
0.000026056 lstat("/usr/local/etc/libmap.d",0x7fffffffcb48) ERR#2 'No such file or directory'
0.000024790 munmap(0x80064b000,109) = 0 (0x0)
0.000033703 openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_CLOEXEC,00) = 3 (0x3)
0.000040055 read(3,"Ehnt\^A\0\0\0\M^@\0\0\0z\0\0\0\0"...,128) = 128 (0x80)
0.000019917 fstat(3,{ mode=-r--r--r-- ,inode=102408,size=250,blksize=4096 }) = 0 (0x0)
0.000018280 lseek(3,0x80,SEEK_SET) = 128 (0x80)
0.000025942 read(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,122) = 122 (0x7a)
0.000020733 close(3) = 0 (0x0)
0.000025979 access("/lib/libedit.so.7",F_OK) = 0 (0x0)
0.000025470 openat(AT_FDCWD,"/lib/libedit.so.7",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000019576 fstat(3,{ mode=-r--r--r-- ,inode=14363,size=226424,blksize=131072 }) = 0 (0x0)
0.000024346 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366337024 (0x80064b000)
0.000018860 mmap(0x0,2334720,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34368409600 (0x800845000)
0.000029369 mmap(0x800845000,212992,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34368409600 (0x800845000)
0.000026226 mmap(0x800a79000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x34000) = 34370719744 (0x800a79000)
0.000019513 mmap(0x800a7b000,16384,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34370727936 (0x800a7b000)
0.000019446 munmap(0x80064b000,4096) = 0 (0x0)
0.000019183 close(3) = 0 (0x0)
0.000025349 access("/lib/libc.so.7",F_OK) = 0 (0x0)
0.000025353 openat(AT_FDCWD,"/lib/libc.so.7",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000019873 fstat(3,{ mode=-r--r--r-- ,inode=14386,size=1744304,blksize=131072 }) = 0 (0x0)
0.000023819 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366337024 (0x80064b000)
0.000018250 mmap(0x0,3883008,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34370744320 (0x800a7f000)
0.000095015 mmap(0x800a7f000,1634304,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34370744320 (0x800a7f000)
0.000027627 mmap(0x800e0d000,49152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x18e000) = 34374471680 (0x800e0d000)
0.000018430 mmap(0x800e19000,106496,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34374520832 (0x800e19000)
0.000027453 munmap(0x80064b000,4096) = 0 (0x0)
0.000018047 close(3) = 0 (0x0)
0.000024706 access("/lib/libncursesw.so.8",F_OK) = 0 (0x0)
0.000023619 openat(AT_FDCWD,"/lib/libncursesw.so.8",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000017546 fstat(3,{ mode=-r--r--r-- ,inode=14357,size=375096,blksize=131072 }) = 0 (0x0)
0.000030595 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366337024 (0x80064b000)
0.000016633 mmap(0x0,2473984,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34374627328 (0x800e33000)
0.000042896 mmap(0x800e33000,356352,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34374627328 (0x800e33000)
0.000023676 mmap(0x801089000,20480,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x56000) = 34377076736 (0x801089000)
0.000017803 mmap(0x80108e000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34377097216 (0x80108e000)
0.000017629 munmap(0x80064b000,4096) = 0 (0x0)
0.000018247 close(3) = 0 (0x0)
0.000020663 munmap(0x80064a000,4096) = 0 (0x0)
0.000018793 mmap(0x0,40960,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366332928 (0x80064a000)
0.000017976 munmap(0x80064d000,28672) = 0 (0x0)
0.000016795 mmap(0x0,102400,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366345216 (0x80064d000)
0.000016359 sysarch(AMD64_SET_FSBASE,0x7fffffffe518) = 0 (0x0)
0.000015639 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000015775 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000028953 readlink("/etc/malloc.conf",0x7fffffffdc10,1024) ERR#2 'No such file or directory'
0.000014833 issetugid() = 0 (0x0)
0.000029755 __sysctl(0x7fffffffda80,0x2,0x7fffffffdad0,0x7fffffffdac8,0x800bde647,0xd) = 0 (0x0)
0.000017399 __sysctl(0x7fffffffdad0,0x2,0x7fffffffdb94,0x7fffffffdb88,0x0,0x0) = 0 (0x0)
0.000018493 mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34377101312 (0x80108f000)
0.000019866 munmap(0x80108f000,2097152) = 0 (0x0)
0.000017340 mmap(0x0,4190208,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34377101312 (0x80108f000)
0.000018613 munmap(0x80108f000,1511424) = 0 (0x0)
0.000016699 munmap(0x801400000,581632) = 0 (0x0)
0.000020123 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000014259 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000016319 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000014869 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000016173 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000015156 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000015643 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000015386 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000015033 getpid() = 4685 (0x124d)
0.000014269 geteuid() = 1000 (0x3e8)
0.000015010 getppid() = 4684 (0x124c)
0.000018670 mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34380709888 (0x801400000)
0.000014950 getuid() = 1000 (0x3e8)
0.000013960 geteuid() = 1000 (0x3e8)
0.000014840 getgid() = 1000 (0x3e8)
0.000015257 getegid() = 1000 (0x3e8)
0.000044759 openat(AT_FDCWD,"/usr/local/bin/VirtualBox",O_CLOEXEC,00) = 3 (0x3)
0.000015816 fcntl(3,F_DUPFD_CLOEXEC,0xa) = 10 (0xa)
0.000016137 close(3) = 0 (0x0)
0.000015839 sigaction(SIGINT,0x0,{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
0.000015793 sigaction(SIGINT,{ 0x41b950 0x0 ss_t },0x0) = 0 (0x0)
0.000015403 sigaction(SIGQUIT,0x0,{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
0.000015320 sigaction(SIGQUIT,{ 0x41b950 0x0 ss_t },0x0) = 0 (0x0)
0.000014973 sigaction(SIGTERM,0x0,{ SIG_DFL 0x0 ss_t }) = 0 (0x0)
0.000017783 sigaction(SIGTERM,{ SIG_DFL 0x0 ss_t },0x0) = 0 (0x0)
0.000025106 stat(".",{ mode=drwxr-xr-x ,inode=8,size=22,blksize=4096 }) = 0 (0x0)
0.000036735 stat("/home/harry",{ mode=drwxr-xr-x ,inode=8,size=22,blksize=4096 }) = 0 (0x0)
0.000032722 read(10,"#!/bin/sh\n#\n# Oracle VM Virtua"...,1024) = 1024 (0x400)
0.000027649 stat("/usr/local/etc/vbox/vbox.cfg",0x7fffffffe6c0) ERR#2 'No such file or directory'
0.000028379 stat("/usr/local/lib/virtualbox",{ mode=drwxr-xr-x ,inode=61743,size=59,blksize=7680 }) = 0 (0x0)
0.000027360 stat("/usr/local/lib/virtualbox/VBoxRT.so",{ mode=-rw-r--r-- ,inode=102976,size=8236395,blksize=131072 }) = 0 (0x0)
0.000022672 read(10,"problem\nKDE_FORK_SLAVES=1; expo"...,1024) = 855 (0x357)
0.000027726 stat("/usr/bin/basename",{ mode=-r-xr-xr-x ,inode=2279,size=7520,blksize=7680 }) = 0 (0x0)
0.000022313 pipe2(0x7fffffffe4f8,O_RDONLY) = 0 (0x0)
0.000039916 vfork() = 4686 (0x124e)
0.000016393 close(4) = 0 (0x0)
0.000985596 read(3,"VirtualBox\n",128) = 11 (0xb)
0.000015756 read(3,0x7fffffffe720,128) = 0 (0x0)
0.000143777 close(3) = 0 (0x0)
0.000027776 wait4(-1,{ EXITED,val=0 },0x0,0x0) = 4686 (0x124e)
0.000421038 execve("/usr/local/lib/virtualbox/VirtualBox",0x801418b70,0x801418c38) = 0 (0x0)
0.000017833 mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366181376 (0x800625000)
0.000014409 issetugid() = 0 (0x0)
0.000020320 __sysctl(0x7fffffffe498,0x2,0x8008260bc,0x7fffffffe490,0x0,0x0) = 0 (0x0)
0.000029242 __sysctl(0x7fffffffe498,0x2,0x8008261bc,0x7fffffffe490,0x0,0x0) = 0 (0x0)
0.000018210 __sysctl(0x7fffffffe498,0x2,0x8008262bc,0x7fffffffe490,0x0,0x0) = 0 (0x0)
0.000018556 __sysctl(0x7fffffffe498,0x2,0x8008263bc,0x7fffffffe490,0x0,0x0) = 0 (0x0)
0.000018233 __sysctl(0x7fffffffe498,0x2,0x8008264bc,0x7fffffffe490,0x0,0x0) = 0 (0x0)
0.000028353 lstat("/etc",{ mode=drwxr-xr-x ,inode=39,size=114,blksize=7680 }) = 0 (0x0)
0.000024927 lstat("/etc/libmap.conf",{ mode=-rw-r--r-- ,inode=716,size=109,blksize=4096 }) = 0 (0x0)
0.000024313 openat(AT_FDCWD,"/etc/libmap.conf",O_CLOEXEC,00) = 3 (0x3)
0.000018616 fstat(3,{ mode=-rw-r--r-- ,inode=716,size=109,blksize=4096 }) = 0 (0x0)
0.000023359 mmap(0x0,109,PROT_READ,MAP_PRIVATE,3,0x0) = 34366214144 (0x80062d000)
0.000017803 close(3) = 0 (0x0)
0.000023113 lstat("/usr",{ mode=drwxr-xr-x ,inode=9,size=16,blksize=4096 }) = 0 (0x0)
0.000023040 lstat("/usr/local",{ mode=drwxr-xr-x ,inode=1033,size=16,blksize=4096 }) = 0 (0x0)
0.000024520 lstat("/usr/local/etc",{ mode=drwxr-xr-x ,inode=16436,size=45,blksize=4096 }) = 0 (0x0)
0.000024286 lstat("/usr/local/etc/libmap.d",0x7fffffffcb48) ERR#2 'No such file or directory'
0.000021119 munmap(0x80062d000,109) = 0 (0x0)
0.000029960 access("/usr/local/lib/virtualbox/libthr.so.3",F_OK) ERR#2 'No such file or directory'
0.000027826 openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_CLOEXEC,00) = 3 (0x3)
0.000039259 read(3,"Ehnt\^A\0\0\0\M^@\0\0\0z\0\0\0\0"...,128) = 128 (0x80)
0.000018183 fstat(3,{ mode=-r--r--r-- ,inode=102408,size=250,blksize=4096 }) = 0 (0x0)
0.000016146 lseek(3,0x80,SEEK_SET) = 128 (0x80)
0.000024223 read(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,122) = 122 (0x7a)
0.000017516 close(3) = 0 (0x0)
0.000023163 access("/lib/libthr.so.3",F_OK) = 0 (0x0)
0.000023303 openat(AT_FDCWD,"/lib/libthr.so.3",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000018383 fstat(3,{ mode=-r--r--r-- ,inode=14345,size=118352,blksize=118784 }) = 0 (0x0)
0.000030429 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366214144 (0x80062d000)
0.000020577 mmap(0x0,2256896,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34368286720 (0x800827000)
0.000031709 mmap(0x800827000,110592,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34368286720 (0x800827000)
0.000023537 mmap(0x800a41000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x1a000) = 34370490368 (0x800a41000)
0.000019107 mmap(0x800a43000,45056,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34370498560 (0x800a43000)
0.000019839 munmap(0x80062d000,4096) = 0 (0x0)
0.000018536 close(3) = 0 (0x0)
0.000028893 access("/usr/local/lib/virtualbox/libc++.so.1",F_OK) ERR#2 'No such file or directory'
0.000020823 access("/lib/libc++.so.1",F_OK) ERR#2 'No such file or directory'
0.000023609 access("/usr/lib/libc++.so.1",F_OK) = 0 (0x0)
0.000025740 openat(AT_FDCWD,"/usr/lib/libc++.so.1",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000017964 fstat(3,{ mode=-r--r--r-- ,inode=13693,size=772424,blksize=131072 }) = 0 (0x0)
0.000039257 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366214144 (0x80062d000)
0.000017076 mmap(0x0,2879488,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34370543616 (0x800a4e000)
0.000040405 mmap(0x800a4e000,749568,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34370543616 (0x800a4e000)
0.000024907 mmap(0x800d04000,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0xb6000) = 34373386240 (0x800d04000)
0.000018146 mmap(0x800d0b000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34373414912 (0x800d0b000)
0.000018642 munmap(0x80062d000,4096) = 0 (0x0)
0.000018309 close(3) = 0 (0x0)
0.000028199 access("/usr/local/lib/virtualbox/libcxxrt.so.1",F_OK) ERR#2 'No such file or directory'
0.000021446 access("/lib/libcxxrt.so.1",F_OK) = 0 (0x0)
0.000023693 openat(AT_FDCWD,"/lib/libcxxrt.so.1",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000018550 fstat(3,{ mode=-r--r--r-- ,inode=14339,size=107624,blksize=108032 }) = 0 (0x0)
0.000030643 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366214144 (0x80062d000)
0.000016633 mmap(0x0,2220032,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34373423104 (0x800d0d000)
0.000027810 mmap(0x800d0d000,102400,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34373423104 (0x800d0d000)
0.000023166 mmap(0x800f25000,8192,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x18000) = 34375618560 (0x800f25000)
0.000018070 mmap(0x800f27000,16384,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34375626752 (0x800f27000)
0.000018363 munmap(0x80062d000,4096) = 0 (0x0)
0.000017536 close(3) = 0 (0x0)
0.000027806 access("/usr/local/lib/virtualbox/libm.so.5",F_OK) ERR#2 'No such file or directory'
0.000022143 access("/lib/libm.so.5",F_OK) = 0 (0x0)
0.000023780 openat(AT_FDCWD,"/lib/libm.so.5",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000019073 fstat(3,{ mode=-r--r--r-- ,inode=14388,size=192584,blksize=131072 }) = 0 (0x0)
0.000021970 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366214144 (0x80062d000)
0.000016562 mmap(0x0,2273280,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34375643136 (0x800f2b000)
0.000032510 mmap(0x800f2b000,172032,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34375643136 (0x800f2b000)
0.000022559 mmap(0x801155000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x2a000) = 34377912320 (0x801155000)
0.000018713 munmap(0x80062d000,4096) = 0 (0x0)
0.000017236 close(3) = 0 (0x0)
0.000027546 access("/usr/local/lib/virtualbox/libc.so.7",F_OK) ERR#2 'No such file or directory'
0.000020463 access("/lib/libc.so.7",F_OK) = 0 (0x0)
0.000023396 openat(AT_FDCWD,"/lib/libc.so.7",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000018830 fstat(3,{ mode=-r--r--r-- ,inode=14386,size=1744304,blksize=131072 }) = 0 (0x0)
0.000021924 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366214144 (0x80062d000)
0.000016646 mmap(0x0,3883008,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34377916416 (0x801156000)
0.000063045 mmap(0x801156000,1634304,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34377916416 (0x801156000)
0.000025247 mmap(0x8014e4000,49152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x18e000) = 34381643776 (0x8014e4000)
0.000020984 mmap(0x8014f0000,106496,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 34381692928 (0x8014f0000)
0.000020176 munmap(0x80062d000,4096) = 0 (0x0)
0.000018226 close(3) = 0 (0x0)
0.000024149 access("/lib/libgcc_s.so.1",F_OK) = 0 (0x0)
0.000024262 openat(AT_FDCWD,"/lib/libgcc_s.so.1",O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
0.000019110 fstat(3,{ mode=-r--r--r-- ,inode=14369,size=56608,blksize=56832 }) = 0 (0x0)
0.000030196 mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 34366214144 (0x80062d000)
0.000016836 mmap(0x0,2154496,PROT_NONE,MAP_PRIVATE|MAP_ANON|MAP_NOCORE,-1,0x0) = 34381799424 (0x80150a000)
0.000024242 mmap(0x80150a000,57344,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 34381799424 (0x80150a000)
0.000022563 mmap(0x801717000,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0xd000) = 34383949824 (0x801717000)
0.000019697 munmap(0x80062d000,4096) = 0 (0x0)
0.000017733 close(3) = 0 (0x0)
0.000017563 mmap(0x0,36864,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366214144 (0x80062d000)
0.000018923 munmap(0x800631000,20480) = 0 (0x0)
0.000017069 mmap(0x0,69632,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366230528 (0x800631000)
0.000020306 munmap(0x80063b000,28672) = 0 (0x0)
0.000017460 mmap(0x0,102400,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366271488 (0x80063b000)
0.000015196 sysarch(AMD64_SET_FSBASE,0x7fffffffe518) = 0 (0x0)
0.000016554 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000015900 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000027883 readlink("/etc/malloc.conf",0x7fffffffdc10,1024) ERR#2 'No such file or directory'
0.000014446 issetugid() = 0 (0x0)
0.000022763 __sysctl(0x7fffffffda80,0x2,0x7fffffffdad0,0x7fffffffdac8,0x8012b5647,0xd) = 0 (0x0)
0.000016826 __sysctl(0x7fffffffdad0,0x2,0x7fffffffdb94,0x7fffffffdb88,0x0,0x0) = 0 (0x0)
0.000019066 mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34383953920 (0x801718000)
0.000019023 munmap(0x801718000,2097152) = 0 (0x0)
0.000017503 mmap(0x0,4190208,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34383953920 (0x801718000)
0.000022060 munmap(0x801718000,950272) = 0 (0x0)
0.000017180 munmap(0x801a00000,1142784) = 0 (0x0)
0.000016080 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000016349 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000015703 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000016313 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000016310 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000015776 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000016800 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000015749 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000022567 __sysctl(0x7fffffffda30,0x2,0x800a4dd50,0x7fffffffda38,0x0,0x0) = 0 (0x0)
0.000015837 getrlimit(RLIMIT_STACK,{ cur=536870912,max=536870912 }) = 0 (0x0)
0.000023257 __sysctl(0x7fffffffd930,0x2,0x7fffffffd980,0x7fffffffd978,0x80083dddc,0xd) = 0 (0x0)
0.000016669 __sysctl(0x7fffffffd980,0x3,0x800a4c370,0x7fffffffda38,0x0,0x0) = 0 (0x0)
0.000019444 mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34387001344 (0x801a00000)
0.000016130 thr_self(0x801a16000) = 0 (0x0)
0.000016483 mmap(0x7fffdfffe000,4096,PROT_NONE,MAP_ANON,-1,0x0) = 140736951476224 (0x7fffdfffe000)
0.000016213 rtprio_thread(0x0,0x189a7,0x7fffffffda08) = 0 (0x0)
0.000015724 sysarch(AMD64_SET_FSBASE,0x7fffffffda08) = 0 (0x0)
0.000016133 sigaction(32,{ 0x800834d80 SA_SIGINFO ss_t },0x0) = 0 (0x0)
0.000015576 sigprocmask(SIG_UNBLOCK,{ },0x0) = 0 (0x0)
0.000017643 _umtx_op(0x7fffffffd9c8,UMTX_OP_WAKE,0x1,0x0,0x0) = 0 (0x0)
0.000018973 mprotect(0x0,0,PROT_NONE) = 0 (0x0)
0.000014656 getpid() = 4685 (0x124d)
0.000014009 getpid() = 4685 (0x124d)
0.000016199 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000016419 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000016913 getcontext(0x7fffffffd510) = 0 (0x0)
0.000016353 sysarch(AMD64_GET_XFPUSTATE,0x7fffffffd4d8) = 0 (0x0)
0.000013756 getpid() = 4685 (0x124d)
0.000030570 __sysctl(0x7fffffffdaa0,0x4,0x607ad0,0x7fffffffda98,0x0,0x0) = 0 (0x0)
0.000014669 getuid() = 1000 (0x3e8)
0.000014203 getgid() = 1000 (0x3e8)
0.000013783 geteuid() = 1000 (0x3e8)
0.000013069 geteuid() = 1000 (0x3e8)
0.000017756 getegid() = 1000 (0x3e8)
0.000025466 write(2,"VirtualBox",10) = 10 (0xa)
0.000017090 write(2,": ",2) = 2 (0x2)
0.000016617 write(2,"Error ",6) = 6 (0x6)
0.000020069 write(2,"-",1) = 1 (0x1)
0.000017273 write(2,"10",2) = 2 (0x2)
0.000020110 write(2," in ",4) = 4 (0x4)
0.000022583 write(2,"SUPR3HardenedMain",17) = 17 (0x11)
0.000019926 write(2,"!\n",2) = 2 (0x2)
0.000017810 write(2,"VirtualBox",10) = 10 (0xa)
0.000017620 write(2,": ",2) = 2 (0x2)
0.000019349 write(2,"Effective UID is not root (euid=",32) = 32 (0x20)
0.000018086 write(2,"1000",4) = 4 (0x4)
0.000017833 write(2," egid=",6) = 6 (0x6)
0.000019713 write(2,"1000",4) = 4 (0x4)
0.000016940 write(2," uid=",5) = 5 (0x5)
0.000018806 write(2,"1000",4) = 4 (0x4)
0.000017313 write(2," gid=",5) = 5 (0x5)
0.000018310 write(2,"1000",4) = 4 (0x4)
0.000019312 write(2,")",1) = 1 (0x1)
0.000017393 write(2,"\n",1) = 1 (0x1)
0.000018970 write(2,"\n",1) = 1 (0x1)
0.000021063 write(2,"VirtualBox",10) = 10 (0xa)
0.000018726 write(2,": ",2) = 2 (0x2)
0.000018260 write(2,"Tip! It may help to reinstall Vi"...,42) = 42 (0x2a)
0.000040303 setresgid(0x3e8,0x3e8,0x3e8) = 0 (0x0)
0.000033389 setresuid(0x3e8,0x3e8,0x3e8) = 0 (0x0)
0.000013507 getresuid(0x7fffffffc968,0x7fffffffc96c,0x7fffffffc964) = 0 (0x0)
0.000014017 getresgid(0x7fffffffc95c,0x7fffffffc960,0x7fffffffc958) = 0 (0x0)
0.000012170 sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGILL|SIGTRAP|SIGABRT|SIGEMT|SIGFPE|SIGKILL|SIGBUS|SIGSEGV|SIGSYS|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
0.000292994 fork() = 4687 (0x124f)
0.000018010 sigprocmask(SIG_SETMASK,{ },0x0) = 0 (0x0)
0.000279777 exit(0x1)
0.000330862 process exit, rval = 1 | VirtualBox over X Forwarding |
Perhaps for your setup sshd is too slow and becoming a bottleneck here. Using plain X11 forwarding may ease the pressure of realtime video playback over network, however a sufficient bandwidth (for example, ethernet) is probably required. sshd (no matter of implementation) can copy files well, although it's still heavyweight for little-CPU machines like embedded systems and netbooks, as from my own practice.
|
Two machines, A et B, on a wired LAN with X11 forward running fine. A is a fully configured Arch linux but has a bad screen. B has a much better screen even though an old netbook, so I work on it using a live Porteus (Slackware). All is working fine with respect to the limited horsepower B has. Until I want to watch a (streamed) video.
The issue
Heavy browsing with Firefox + multiple terminal + Libreoffice has both ssh on client and sshd on the server use < O.5% CPU.
But opening a low resolution video (on Dailymotion or Youtube) has ssh & sshd literally eat CPU @ 100% (with X @ 1%) and 60%, with A/V desync and the broswer lagging in accordance!
Ssh connection settings
I did played with ~/.ssh/config. Especially the Cipher in use as after some testing: arcfour128 proves to be three times faster than aes128-ctr (22 vs 6.2 MB/sec).
1) Default (Cipher, no ForwardX11Trusted or Control{Master,Path,Persist}:
Crazy CPU usage and perceived display/result.
2) With ForwardX11Trusted or Control{Master,Path,Persist} ON:
Same crazy CPU usage and perceived display/result.
3) Lan and old boxes optimized
Cipher arcfour128
Compression no
ForwardX11 yes
ForwardX11Trusted yes
#Make all sessions to the same host use a single connection:
ControlMaster auto
ControlPath ~/.ssh/socket-%r@%h:%p
ControlPersist 3600
#Bypasses IPv6 lookup:
AddressFamily inetSame crazy CPU usage and perceived display/result.
4) I tried to launch the embedded video in an external player with GreaseMonkey's Linterna Magica, and the MediaPlayerConnectivity add-on without success. Even though machine A's mpv player cannot handle the no hardware rendering on machine B: caca video output only :}
Would appreciate it if someone can show me:why a low resolution streamed video (html5 if that counts) makes ssh eat the whole CPU, when ssh can allow for a 22 MB/sec throughput on the same boxes?
why the cipher used makes no perceived difference?
try settings other than mine above that can help playing a video through Xforwarding. | SSH: super high cpu usage when X forwarding a browser's embedded video |
If you connect with SSH and you run an X11 application, and that X11 application displays on the remote machine instead of through the SSH connection, there are three possible reasons.The application is one of the few applications that only ever start a single instance for a given user on a given machine, and it's already launched on a different display.
You're attaching an existing Screen or Tmux session which was started from a local GUI session. A program knows where it should open its window from the value of the DISPLAY environment variable. Inside that Screen/Tmux, the DISPLAY environment variable remains what was initially set. You need to change it when you reconnect to an existing session: run echo $DISPLAY before attaching to the terminal multiplexer, and set the variable inside the multiplexer.
You did something naughty in one of your configuration files (.profile, .bashrc, etc.): you changed the DISPLAY environment variable. Apart from the case of attaching to a screen multiplexer that was started from another display, you should never set DISPLAY manually. If you SSH into somewhere and DISPLAY isn't set, that means that the SSH connection isn't forwarding an X11 connection, and setting the environment variable manually cannot help.So in all likelihood what you need to do is to go through your configuration files and remove the line that corrupts the DISPLAY environment variable.
|
In my SSH config file, X forwarding is enabled, and I run ssh with the -X parameter. It gives me first error below but connects in the end.
Failed to add the host to the list of known hosts (/home/myUserName/.ssh/known_hosts)The problem starts here. When I open an X program such as ff, it opens on the remote machine, not through forwarding to my computer.
Am I mixing something? How can I forward X output to my local machine?
Both machines have a Linux operating system with X.org installed with perfectly working desktop environments.
echo $DISPLAY outputs :0 | SSH X forwarding enabled, but no forwarding |
Restore %a to that format if you're going to use mod_remoteip.
In bugzilla, mod_remoteip fills in %a while it
removes from %{X-Forwarded-For}i. So in a simple case with one
trusted proxy, %a will hold the value used to see in
X-Forwarded-For because of mod_remoteip
|
I'm using Apache/2.4.27
Within the VirtualHost I'm forwarding the remote client IP header from the Loadbalancer
with:
RemoteIPHeader X-Forwarded-ForWhich is needed by the application served by that Virtualhost.
This is the log format within the main httpd.conf context.
LogFormat "%h (%{X-Forwarded-For}i) %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedWhen I have the RemoteIPHeader X-Forwarded-For listed within the virtualhost, Apache stops writting the remote-client IP into logs.
When I remove it from the VirtualHost, the remote-client IP starts appearing again within the logs.
Any ideas ?
Thanks !
| Apache Logs - X-Forwarded-for together with Virtualhost not logging |
~/.xinitrc is executed by xinit, which is usually invoked via startx. This program is executed after logging in: first you log in on a text console, then you start the GUI with startx. The role of .xinitrc is to start the GUI part of the session, typically by setting some GUI-related settings such as key bindings (with xmodmap or xkbcomp), X resources (with xrdb), etc., and to launch a session manager or a window manager (possibly as part of a desktop environment).
~/.xsession is executed when you log in in graphical mode (on a display manager) and the display manager invokes the “custom” session type. (With the historical display manager xdm, .xsession is always executed, but with modern display managers that give the user a choice of session type, you usually need to pick “custom” for .xsession to run.) Its role is both to set login-time parameters (such as environment variables) and to start the GUI session. A typical .xsession is
#!/bin/sh
. ~/.profile
. ~/.xinitrc~/.xsessionrc is executed on Debian (and derivatives such as Ubuntu, Linux Mint, etc.) by the X startup scripts on a GUI login, for all session types and (I think) from all display managers. It's also executed from startx if the user doesn't have a .xinitrc, because in that case startx falls back on the same session startup scripts that are used for GUI login. It's executed relatively early, after loading resources but before starting any program such as a key agent, a D-Bus daemon, etc. It typically sets variables that can be used by later startup scripts. It doesn't have any official documentation that I know of, you have to dig into the source to see what works.
.xinitrc and .xsession are historical features of the X11 Window system so they should be available and have a similar behavior on all Unix systems. On the other hand, .xsessionrc is a Debian feature and distributions that are not based on Debian don't have it unless they've implemented something similar.
.xprofile is very similar to .xsessionrc, but it's part of the session startup script some display managers including GDM (the GNOME display manager) and lightdm, but not others such as xdm and kdm.
|
I found three configuration files..xinitrc
.xsession
.xsessionrcI know that the first one is for using startx and the second and third are used when using a display manager. But what is the difference between the last two?
| Difference between .xinitrc, .xsession and .xsessionrc |
startx runs xinit which starts an X server and a client session. The client session is ~/.xinitrc if present, and otherwise /etc/X11/xinit/xinitrc (the location may vary between distributions). What this script does varies between distributions. On Debian (including derivatives such as Raspbian), /etc/X11/xinit/xinitrc runs /etc/X11/Xsession which in turn runs scripts in /etc/X11/Xsession.d. The Debian scripts look for a user session in other files (~/.xsession, ~/.xsessionrc, ~/.Xsession) and, if no user setting is applicable, runs x-session-manager (falling back to x-window-manager if no [session manager] is installed, falling back to x-terminal-emulator in the unlikely case that no window manager is installed).
If you want control over what gets executed, you can create one of the user files, either ~/.xsession or ~/.xinitrc. The file ~/.xsession is also used if you log in on a display manager (i.e. if you type your password in a GUI window). The file ~/.xinitrc is specific to xinit and startx. Using ~/.xsession goes through /etc/X11/Xsession so it sets up things like input methods, resources, password agents, etc. If you use .xinitrc, you'll have to do all of these manually. Once again, I'm describing Debian here, other Unix variants might set things up differently. The use of ~/.xinitrc to specify what gets executed when you run startx or xinit is universal.
Whether you use ~/.xinitrc or ~/.xsession, this file (usually a shell script, but it doesn't have to be if you really want to use something else) must prepare whatever needs to be prepared (e.g. keyboard settings, resources, applets that aren't started by the window manager, etc.), and then at the end run the program that manages the session. When the script ends, the session terminates. Typically, you would use exec at the end of the script, to replace the script by the session manager or window manager.
Your system presumably has /usr/bin/startlxde as the system-wide default session manager. On Debian and derivatives, you can check the available session managers with
update-alternatives --list x-session-manageror get a more verbose description indicating which one is current with
update-alternatives --display x-session-managerIf LXDE wasn't the system-wide default and you wanted to make it the default for your account, you could use the following ~/.xsession file:
#!/bin/sh
exec startlxdeOn some Unix variants, that would only run for graphical logins, not for startx, so you'd also need to create an identical ~/.xinitrc. (Or not identical: in ~/.xsession, you might want to do other things, because that's the first file that's executed in a graphical session; for example you might put . ~/.profile near the top, to set some environment variables.)
If you want to try out other environments as a one-off, you can specify a different program to run on the command line of startx itself. The startx program has a quirk: you need to use the full path to the program.
startx /usr/bin/startkdeThe startx command also lets you specify arguments to pass to the server. For example, if you want to run multiple GUI sessions at the same time, you can pass a different display number each time. Pass server arguments after -- on the command line of startx.
startx /usr/bin/startkde -- :1 |
From many docs, I read that startx is starting LXDE in Raspbian OS. I am a little bit confused.
Will always startx run LXDE GUI?
Also I have seen example with using startlxde command. How is that command different and why startx and startlxde are running the same GUI(LXDE)? Or maybe it runs it because it is the default GUI?
How can I choose default GUI if I have multiple ones?
Could you please explain more details around the GUI in Linux systems?
| What desktop environment does startx run, and how can I change it? |
I remember I was able to reproduce your problem with not being able to
run Virtualbox as non-root user without window manager with older versions of Virtualbox
but it works for me with 5.2.4-119785.
However, as stated in the comments you don't need to graphical interface at all. Virtualbox comes with command line interface, it's my preferred method of interacting with it. Say, to list virtual machines:
$ vboxmanage list vms
"ubuntu" {e7fe8912-5484-4b9d-b5fe-431ae648b2dd}
"slackware64-current" {a00e1925-9cb6-4330-8b04-bbce69b49c67}
"slackware-current" {636b85f2-1e02-497b-9c50-22eb285250a3}
"freebsd" {acb77ca6-b051-400a-92bb-b3b2f1905991}
"openindiana" {bdca01dd-ea5d-4323-9fd2-92665d311bda}
"slackware64-14.1" {f9db3ba6-2316-4f92-8264-4abc8e4f71b3}
"slackware-14.2" {ccb5ddba-4ea1-4469-8ebc-21c84b8ca825}
"slackware-14.1-pathes-test" {67bec56d-b7d5-4427-a726-de2b4c1ba700}
"Slackware_new_test" {2e9232b5-bab1-41fc-8db4-ff4aab56f94c}
"slackware64-14.2" {2084cd19-d286-48b5-8e7b-3d1bb7a94d93}
"alpine linux" {be56c6a7-5821-4815-984b-6b40a6367acb}
"openwrt_Chaos_Calmer" {a4fcb438-dfc7-4672-8976-0d21b34357e0}
"linux-mint" {6e5e99d8-2dd8-4798-93ac-ffbf14c6c9db}To start a virtual machine:
$ vboxmanage startvm "slackware64-14.1" --type headlessYou can then access a started virtual machine with ssh, telnet etc.
To remove a virtual machine:
$ vboxmanage unregistervm "slackware64-14.1" -deleteTo show info on a given virtual machine:
$ vboxmanage showvminfo slackware64-14.1To stop a virtual machine:
$ vboxmanage controlvm slackware64-14.1 poweroffYou can even create a new virtual machine in command line: https://gist.github.com/ardrabczyk/65b68d0121f2964cd99e
|
In Arch Linux, I would like to run VirtualBox without a window manager.
As a root I can easily do:
xinit /usr/bin/VirtualBox -- :0 vt1As a non-root user I get a blank screen. If I open another terminal, kill VirtualBox and read
~/.local/share/xorg/Xorg.0.log ,then it does not show any error and is basically the same as the "/var/log/Xorg.0.log" I get as a root.
UPDATE
As noted by Arkadiusz Drabczyk, the problem was with a bug in VB. It works with version 5.2.4-119785.
My final objective is to use VB kind of bare-metal, starting an OS in fullscreen and nothing else, that is:
xinit '/usr/bin/VirtualBox' --startvm "VM name" --fullscreen -- :0 vt1 | Arch Linux: Running VirtualBox (VM) without a window manager |
I suspect that you simply do not have an ~/.xinitrc file. When xinit starts it looks for that file and if it does not find it then it runs a tiny xterm. To be exact it runs:
xterm -geometry +1+1 -n login -display :0Also, the command line to xinit is:
xinit [ [ client ] options ... ] [ -- [ server ] [ display ] options ... ]We can ignore the part after -- (right side) since that is for the server (X server) side, and you are simply using defaults in there. Now for the client side (left side) you have something a little ambiguous: [ [ client ] options ... ]. In other words xinit give preference to options instead of client.
That behaviour is actually described in the man:Both the client program name and the server program name must begin with a slash (/) or a period (.). Otherwise, they are treated as an arguments to be appended to their respective startup lines. This makes it possible to add arguments (for example, foreground and background colors) without having to retype the whole command line.Therefore:/usr/bin/firefox is an X client, so it is executed
firefox is a client option, so xterm is executed, with those arguments above and an extra argument (option): "firefox". Exactly this:
xterm -geometry +1+1 -n login -display :0 firefox |
xinit /usr/bin/firefox seems to do what's expected: to run firefox without a window manager.
xinit firefox seems to do similar, but with a small xterm running behind.
Can someone explain me what's happening here?
| `xinit /usr/bin/firefox` vs `xinit firefox` |
In your script
#!/usr/bin/env bash
xrdb -merge ~/.Xresources &
xset r rate 200 30 &
xterm & #fixme: xterm is not reading loaded .Xresources
exec /etc/alternatives/x-window-managerthe line with xterm needs to run in the background, using "&" because the window manager has to run to manage the xterm (and if xterm were not put in the background, it would block the script from proceeding to invoke the window manager). The xrdb and xset commands both should complete before starting other programs, because they will complete (and exit) rapidly, and because they initialize things for you:xrdb sets up resource values in the root window which can be read by xterm, and
xset (less important) is changing the key repeat rate.Further reading:About X: Frequently Asked Questions
7) How do I set resources?
14) What is the precedence for resource files? |
I've one .xinitrc with the following lines:
#!/usr/bin/env bash
xrdb -merge ~/.Xresources &
xset r rate 200 30 &
xterm & #fixme: xterm is not reading loaded .Xresources
exec /etc/alternatives/x-window-managerWhy the xterm is not using the settings loaded with the xrdb?
P.S.: this xterm inside .xinitrc does not use the settings loaded from xresources, but once the wm is running it works right.
I don't remember how to fix it (has been years that I don't play with linux).
| xterm not using .Xresources |
You can try using setsid (part of the util-linux package)
in the .xinitrc to start the script in a new session:
setsid statusbarbut will it still receive your signals?
|
I have a statusbar (lemonbar) to which I pipe the output of a couple of scripts (time, battery, volume, etc.). These scripts, and the statusbar itself, are all started in a single bash script statusbar. When the statusbar process is killed, it cleans up after itself by attempting to kill its children, like so:
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXITThis all works fine if I call statusbar in a terminal, and then quit it with a SIGTERM signal.
However, when I start statusbar in my .xinitrc file like this: statusbar &, the statusbar script is not able to clean up after itself anymore. The reason for this is that it is in the same process group as the .xinitrc script, together with all the other processes that are started there. I discovered this by following this answer.
The question is: can I put the statusbar process and all its children in their own process group from .xinitrc, so that it can clean up after itself nicely? Alternative, maybe there is a different way of killing all the children of statusbar?
P.S.: I realize that wanting to cleanly kill a statusbar is not very common. However, I would like to do it so that I can restart it easily and eventually change my colour theme dynamically, without having to exit X.
| Start new process group in .xinitrc |
Firefox puts itself in the background and detaches from your terminal if you run it from a terminal. Therefore pressing Ctrl+Z is not really suspending Firefox, it probably suspends xinit.
wget and most commandline programs do not have this kind of detaching behaviour. GUI based programs like gedit start mostly like firefox and detach.I looked if there was some option to prevent this from happening. -foreground seemed a likely option name, but that just pushes the firefox window to the foreground.
|
I run Firefox with command xinit /path/to/firefox/binary and it opens a display with Firefox running on it.
Then I push Ctrl +Alt+F1 to go back to console and then I push Ctrl+z to suspend the Firefox into the background.
Then, I push Ctrl+Alt+F7 to go back to Firefox. I expect Firefox to be freezed or non-responsive, however I can still use Firefox with no problem. My expectation is based on my experience when sending other apps to background, like wget. When I send wget to background, the download process is stopped.
Why does this happen?
| Should suspended application in the background (by ctrl+z) still run or should it stop running? |
Use small footprint Display Manager.
SLIM
With this display manager, some manual configuration is needed. Please refer to their official document and write your /etc/slim.conf and ~/.xinitrc. The command you should put in your ~/.xinitrc to start LXDE is:
exec startlxde
The above is coming from : http://wiki.lxde.org/en/Debian
It supports autologin.
|
I am disappointed with existing Display Managers, and so I was wondering wheteher I could live without one. I have very basic needs on my laptop. I have one user martin who wants to be logged into LXDE automatically after boot.
I have made following change in /etc/inittab
#1:2345:respawn:/sbin/getty 38400 tty1
1:2345:once:/bin/login -f martin tty1 </dev/tty1 >/dev/tty1 2>&1and added following line to my /home/martin/.profile
xinit 2>/dev/nullNow, when I boot my laptop, LXDE starts automatically. Thats great. When I log out of LXDE, I am back in tty1, logged in as martin. The problem is, when LXDE is running and I have screen-lock active to protect my LXDE session, somebody could press CTRL+c in tty1, thereby killing LXDE and he would be logged in as martin.
Is there a way to make LXDE start without leaving martin logged in on tty1? i.e., after LXDE has started, I don't need tty1 anymore and I would like to log out of it. but I cannot because LXDE is started from that console. Is there any way to make LXDE to "detach" itself from tty1, so that is shows the standard login prompt as normally?
In case it is relevant, I am using Debian Wheezy
| starting LXDE automatically (without Display Manager) |
You should be able to put most of the application you would usually put into xinitrc also into services.xserver.desktopManager.xfce.extraSessionCommands
as important environment variables such as $DISPLAY and $DBUS_SESSION_BUS_ADDRESS are set.
In fact in most xinitrc's start the window manager as the last process.
Here is a snippet how extraSessionCommands is implemented taken from xfce.nix:
services.xserver.desktopManager.session = [{
name = "xfce";
bgSupport = true;
start = ''
${cfg.extraSessionCommands}
# Set GTK_PATH so that GTK+ can find the theme engines.
export GTK_PATH="${config.system.path}/lib/gtk-2.0:${config.system.path}/lib/gtk-3.0"
# Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
export GTK_DATA_PREFIX=${config.system.path}
${pkgs.runtimeShell} ${pkgs.xfce.xinitrc} &
waitPID=$!
'';
}]; |
In NixOS, services.xserver.desktopManager.xfce.extraSessionCommands describes "Shell commands executed just before XFCE is started.". What about for shell commands right after XFCE is started?
That is, I want to persist in my configuration.nix file what I would normally put in an .xinitrc. Is this possible?
| Configure XFCE startup commands in NixOS |
I use startx just fine (Debian unstable + experimental). If you look at where the dbus environment variables are set (again), it's in /etc/X11/Xsession.d/20dbus_xdg-runtime. I use my own .xinitrc, and I realized a bunch of problems I had stemmed from not sourcing the scripts in /etc/X11/Xsession.d (as the default xinitrc does). Instead of trying to run dbus-update-activation-environment yourself, I would strongly recommend you source the files in /etc/X11/Xsession.d instead (they add a bunch of other things like modifying your xhost settings).
|
Not using display manager and executing startup logic via xinitrc.
Problem is some dbus-related env variables are not set.
xinitrc excerpt:
dbus-update-activation-environment --systemd --all # note this errors
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh)
export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID GPG_AGENT_INFO SSH_AUTH_SOCK DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PIDFirst one returns errordbus-update-activation-environment: warning: error sending to systemd: org.freedesktop.DBus.Error.InvalidArgs: Invalid environment assignmentsHow to make sure dbus vars (eg DBUS_SESSION_BUS_ADDRESS) are set?
Note alternatively I could comment out these lines from /usr/bin/startx:
unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGERbut not sure that's the way to go.
Running debian testing.
| xinitrc - set DBUS_SESSION_BUS_ADDRESS |
The problem with your .xinitrc is that it just starts with exec.
This particular way to launch some command (here dwm) makes dwm replace the running shell, hence forbidding everything further down to be launched.
Quoted from man execIf exec is specified with command, it shall replace the shell
with command without creating a new process.I suggest you have a look to Arch's Xinit wiki in which you will notice that exec should be the last thing the .xinitrc script does.
|
I am new to Arch and did a fresh install.
I have configured it to use dwm and I start it with startx. The problem is that some commands in xinitrc seem to not run. It clearly works to some extend, because dwm is starting, but i can't say the same for other commands.
My xintirc is located: ~/.xinitrc (or /home/xor/.xinitrc) and looks like this:
exec dwm
set xkbmap de
feh --bg-scale ~/background.png
xinput set-prop "UNIW0001:00 093A:0255 Touchpad" 349 1
xinput set-prop "UNIW0001:00 093A:0255 Touchpad" 326 1
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --autoIt should start dwm(which it does), set the keyboard layout to german qwertz(which works), set a background image(which does not work) adjust some touchpad settings(which does not work), and do something with the nvidia driver(Not exactly sure what it does, i guess it enables the card/driver, but I know that the drivers work and I can use my GPU).
I can paste the not working commands in a terminal and they work.
Is there somewhere an error log for the file xinit, and what is the problem in my case?
Thanks for help!
| xinitrc seems to not run some commands |
Just put exec "$@" at the end of your xinitrc, and then execute
startx /path/to/xinitrc <wm> <wm-args>from a tty.
startx interprets its first string argument as the client (/path/to/xinitrc, note that it has to be an absolute path), and rest of the arguments are passed to that client (wm and wm-args), which are execed by the xinitrc.
Note that startx is just an example script and you are encouraged to create another one according to your needs. The above mentioned setup should meet the requirements mentioned in the question though.
|
I have an Arch Linux with i3wm now. When I need to start my i3, I just type startx, because in config file I have exec i3;. When I need to run some another graphical environment, such as Gnome, I edit my xinitrc.
Some graphical environments create after installing their own start-file (some not), such as startdde for Deepin. How could I create or configure new xinitrc for several desktops envs?
P.S I love logging from terminal first, so just don't want to install some login gui manager
| How to make several "startx" profiles? |
Think I got it sorted. Don't have deep understanding of what's going on, but it has to do with dbus.
Problem is the way i3 was started from ~/.xinitrc:
exec dbus-run-session i3I'm guessing it causes keyring-daemon to be tied to different dbus session than i3 (and, by extension, most everything else in user space).
To overcome this, I'm now launching i3 from ~/.xsession via systemd instead; note I've deleted ~/.xinitrc altogether.
$ cat ~/.xsession
systemctl --user import-environment
systemctl --user daemon-reload# note we add the 'wait' flag, which disallows immediate exit, which in turn would stop X session right after it.
exec systemctl --user start --wait xsession.targetstartx is started with no arguments: exec startx
Relevant systemd units:
$ tree -a ~/.config/systemd/user/
├── i3wm.service
├── xsession.target
└── xsession.target.requires
└── i3wm.service -> ../i3wm.service
$ cat ~/.config/systemd/user/i3wm.service
[Unit]
Description=i3 Window Manager
PartOf=graphical-session.target[Service]
ExecStart=/usr/bin/i3
ExecStopPost=/usr/bin/systemctl --user stop graphical-session.target
Restart=on-failure[Install]
RequiredBy=xsession.target$ cat ~/.config/systemd/user/xsession.target
[Unit]
Description=X session managed by systemd
BindsTo=graphical-session.targetEncrypted keyring now gets unlocked by PAM on login as expected.
Note those two lines added to /etc/pam.d/login as described in the question are still very much needed.
Courtesy of this blog
|
Running debian testing, no display manager, i3 window manager.
gnome-keyring & libpam-gnome-keyring packages are installed. Added following 2 lines to end of /etc/pam.d/login:
auth optional pam_gnome_keyring.so
session optional pam_gnome_keyring.so auto_startkeyring is started by systemd @ /etc/systemd/user/graphical-session-pre.target.wants/gnome-keyring-daemon.service, but also tried replacing it from xinitrc:
eval $(/usr/bin/gnome-keyring-daemon --replace --components=gpg,pkcs11,secrets,ssh)/var/log/auth.log has following from OS login:
Jun 26 00:35:39 p14s su[1409]: (to laur) root on none
Jun 26 00:35:39 p14s su[1409]: pam_unix(su:session): session opened for user laur(uid=1000) by (uid=0)
Jun 26 00:35:39 p14s systemd: pam_unix(systemd-user:session): session opened for user laur(uid=1000) by (uid=0)
Jun 26 00:35:39 p14s su[1409]: pam_unix(su:session): session closed for user laur
Jun 26 00:35:41 p14s su[1922]: (to laur) root on none
Jun 26 00:35:41 p14s su[1922]: pam_unix(su:session): session opened for user laur(uid=1000) by (uid=0)
Jun 26 00:35:42 p14s su[1922]: pam_unix(su:session): session closed for user laur
Jun 26 00:35:42 p14s su[2005]: (to laur) root on none
Jun 26 00:35:42 p14s su[2005]: pam_unix(su:session): session opened for user laur(uid=1000) by (uid=0)
Jun 26 00:35:42 p14s login[1174]: gkr-pam: unable to locate daemon control file
Jun 26 00:35:42 p14s login[1174]: gkr-pam: stashed password to try later in open session
Jun 26 00:35:42 p14s login[1174]: pam_unix(login:session): session opened for user laur(uid=1000) by LOGIN(uid=0)
Jun 26 00:35:42 p14s systemd-logind[1003]: New session 2 of user laur.
Jun 26 00:35:42 p14s login[1174]: gkr-pam: unlocked login keyring <----- this should be success, right?
Jun 26 00:35:42 p14s su[2005]: pam_unix(su:session): session closed for user laur
Jun 26 00:35:42 p14s su[2078]: (to laur) root on none
Jun 26 00:35:42 p14s su[2078]: pam_unix(su:session): session opened for user laur(uid=1000) by (uid=0)
Jun 26 00:35:42 p14s su[2078]: pam_unix(su:session): session closed for user laur
Jun 26 00:35:45 p14s polkitd(authority=local): Registered Authentication Agent for unix-session:2 (system bus name :1.81 [/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Jun 26 00:35:46 p14s gnome-keyring-daemon[2026]: The Secret Service was already initialized
Jun 26 00:35:46 p14s gnome-keyring-daemon[3062]: discover_other_daemon: 1
Jun 26 00:35:48 p14s su[4284]: (to laur) root on none
Jun 26 00:35:48 p14s su[4284]: pam_unix(su-l:session): session opened for user laur(uid=1000) by (uid=0)
Jun 26 00:35:50 p14s su[4284]: pam_unix(su-l:session): session closed for user laur
Jun 26 00:35:50 p14s su[4365]: (to laur) root on none
Jun 26 00:35:50 p14s su[4365]: pam_unix(su-l:session): session opened for user laur(uid=1000) by (uid=0)
Jun 26 00:35:50 p14s su[4365]: pam_unix(su-l:session): session closed for user laur
Jun 26 00:35:50 p14s su[4402]: (to laur) root on none
Jun 26 00:35:50 p14s su[4402]: pam_unix(su-l:session): session opened for user laur(uid=1000) by (uid=0)Did also try deleting existing keyring(s), to be re-created. Keyring has same password as my user login.
Still no joy. How to approach this in 2022?
| unlock gnome-keyring on login |
To have a GUI that exists only in memory, I would suggest using Xvfb (X Virtual Frame Buffer). I have written an answer on this previously, so I will just reproduce the same here with some minor edits.
Xvfb (X Virtual Frame Buffer) allows you to have a display that exists only in-memory, so that tests/operations with graphical dependencies can be completed without actually using a GUI.
On CentOS, you can install Xvfb from the core CentOS repository with yum:
yum install xorg-x11-server-XvfbOnce Xvfb is installed, prefix your command with xvfb-run to use it:
xvfb-run /path/to/your/applicationxvfb-run is a wrapper command that does a few useful things. First, it initializes an Xvfb display and passes it to your command for execution. Once the command runs to completion, the display is also gracefully shut down.
|
I need to run a program that I haven't developed, the issue is that even if it doesn't run any GUI interface (can be used on silent mode) it still requires an X server running because of the way it's coded.
I have struggled to, not install, but go and start an X server on a Centos 7 system. I don't want it to do anything, just be running like on the background.
Is such a thing possible?
| Starting just an X server on a minimal installation |
**Also I like to hide my mouse pointer and my windows borders but don't know how?You can append -- -nocursor to your startx to hide mouse pointer:
exec startx -- -nocursorThere are files ~/.config/openbox/rc.xml and /etc/xdg/openbox/rc.xml for you to edit (ref: http://openbox.org/wiki/Help:Configuration) , e.g. (bottom in that files):
...
</menu>
<applications> <application class="*">
<decor>no</decor>
<position force="yes">
<x>50</x>
<y>50</y>
<monitor>1</monitor>
</position>
<size>
<width>300</width>
<height>300</height>
</size>
<focus>yes</focus>
<desktop>1</desktop>
<layer>normal</layer>
<iconic>no</iconic>
<skip_pager>no</skip_pager>
<skip_taskbar>no</skip_taskbar>
<fullscreen>no</fullscreen>
<maximized>false</maximized>
</application></applications>
</openbox_config>In which <decor>no</decor> above will make the image app become borderless. Adjust the <width> and <height> if you found your image doesn't show the complete size. You can also adjust <x>, <y> of the app.
There are more, e.g. comment out the menu tags (there are multiple <context tags has this <menu> entry):
<mousebind button="Right" action="Press">
<action name="ShowMenu">
<!-- menu>root-menu</menu -->
</action>
</mousebind>It will disable the right-click to shows menu (startx -- -nocursor hide mouse cursor not prevent you to right-click open menu).
There are also openbox/menu.xml to customize the right-click menu item, e.g.:
<item label="Run Image app">
<action name="Execute"><execute>/home/m/img</execute></action>
</item>You can choose right-click menu item Reconfigure once menu.xml or rc.xml edited to take effect.
I also posted answer here, to solve auto start issue as non-root.
|
I have Ubuntu-server 16.04. Installed gtk3 and can execute my program manually by this command: ./img when I go to it's directory /home/m.But when I tried to add this line to my /etc/rc.local file:
/home/m/img &It didn't work. This is my rc.local full content:
startx
/home/m/img &
exit 0Then I tried to create ~/.xinitrc file with this content:
#!/usr/bin/env bash
/home/m/img &
exec openbox-sessionThen made it executable by this command:
chmod +x ~/.xinitrc
But I got nothing(even it didn't show my openbox after reboot), So I executed this command too:
ln -s ~/.xinitrc ~/.xsessionAfter that my openbox came back but my program didn't start after boot! or any other time!My goal is this: when I turned on my board, after boot, it runs my
gtk-based program and shows my image. It's something like Kiosk but a
c++ program should only show an image!How should I do that?
EDIT: I did add this line:
/home/m/img &
to my /etc/xdg/openbox/autostart file, and it works after login but doesn't show my image, it shows only a file icon at center of the screen. But when I go to this address /home/m/ and run this command ./img it shows my image in full screen!
Why this happens?
**Also I like to hide my mouse pointer and my windows borders but don't know how?
EDIT2: This is what I see after boot:And this is what I see after trying this command(in write buttom corner an icon appears): /home/m/img & | My ubuntu-server doesn't execute my gtk-based program at startup! |
The root Window is a special Window of the X server. It doesn't have an associated application.
The wiki improperly refers to the root window here. What they meant is a Window that masks/hides the root Window like typically found in modern desktop environments (usually referred to as the Desktop, and often implemented by a file manager showing you the content of a ~/Desktop folder).
Those xscreensaver widgets actually work by updating the content of the root Window. So you need to remove that Desktop window that would hide it and any other Window that is displayed on top of the root window.
What you could try looking for is the process id of the windows that register a "Window Type" of "Desktop" with the window manager. You could do something like:
xwininfo -tree -root |
pcregrep -o '^\s+\K0x\S+' |
xargs -n1 xwininfo -wm -id |
pcregrep -Mo '(?s)Window type:\s+Desktop.*?Process id: \K\d+' |
sort -u(xwininfo -tree to list all the windows, the first pcregrep to extract their window id, the second xwininfo to retrieve the WM properties (including Window type and pid) of each and then the second pcregrep to extract the PID of those Desktop windows).
You could also run:
xprop _NET_WM_PIDAnd click on the desktop. Or even:
xkillAnd click on the desktop to kill that window.
In any case, note that it may not be safe to kill that window/process as it may very well be handled by some essential process like the window manager.
In the case of cinnamon, at least on a default desktop environment on Linux mint 18.1 cinnamon edition, it seems to be nemo though (the cinnamon file manager), so there's little harm killing it.
|
I'm trying to get an xscreensaver to run as my desktop background / wallpaper using the method described here: https://wiki.archlinux.org/index.php/XScreenSaver#Animated_wallpaper and the first step is killing the process that controls the root X window, but I have no idea what process that is.
Ideally I'd like to learn how to obtain the name of this program myself [incidentally ps aux | grep root doesn't really help] and from there figure out how to stop this program from starting at boot or asserting control of the root X window.
However, anyone who knows offhand what program this would be in Cinnamon can help me solve the problem and naturally any additional information about stopping / disabling this program or starting / enabling /usr/lib/xscrensaver/glmatrix -root would also be appreciated.
| How can I find which process is controlling the root window? |
The command source is not portable. That is a bash-specific (possibly also some other shells) alias to the standard POSIX shell command .. So, it looks like your .profile is being read by something other than bash which means you should use . and not source.
Also, you can't be sure that $HOME will be set (it may well be in this case, but it might not) so use an absolute path instead, to be on the safe side. Finally, you don't need to send that to the background, it will just read the file and exit. Putting all that together, try using this instead:
. /home/alex/.bashrcAlso note that environment variables are better placed in ~/.profile and not ~/.bashrc since ~/.bashrc is only read by the bash shell and only for interactive, non-login shell sessions.
|
I'm using archlinux, dwm and dwmblocks. At startup dwmblocks shows only the icons of the blocks', without loading the scripts output. If I run
$ killall dwmblocksand restart
$ dwmblocks &it loads all required modules flawlessly.
For me, as a nonprofessional, it seems that the $PATH is not read before startx. So in .xinitrc I've sourced the bashrc (where the $PATH is extended) with
source $HOME/.bashrc &before running dwmblocks &.
Also I've tried to delay the execution of dwmblocks by placing sleep 2 a line above. This doesn't help either.
Searching for the Xorg log-files wasn't a success eather. I've found them as indicated by archwiki, however the file dowsen't seem to give any clue about dwmblocks.
| dwmblocks not reading $PATH |
From xdotool(1):key [options] keystroke [keystroke ...]
Options:
--window window
Send keystrokes to a specific window id. You can use ``WINDOW STACK'' references like ``%1'' and ``%@'' here. If there is a window stack, then ``%1'' is the default, otherwise the current window is used. In your ssh test, you had already focused the Firefox window, so it received the keypress. In the script, the xte mousemove ... left it unfocused.
You can chain xdotool search with other commands. Searching for firefox may return multiple windows. The manpage uses the example --classname Navigator, which works for the version I tested (47.0.1). Failing that, you could use xprop to find some other string specific to the relevant window.
xdotool search --classname Navigator windowfocus key F11 |
I have a RPi running raspbian jessie which I use in kiosk mode: I start in /etc/rc.local
/usr/bin/xinit /opt/domotique/xinitrc > /root/xinitrc-errors 2>&1and /opt/domotique/xinitrc is
date > /tmp/date.txt
export DISPLAY=':0'
xset s off
xset -dpms
xset s noblank
setxkbmap fr
/usr/bin/matchbox-window-manager -use_titlebar no -use_cursor no &
# wait for the window manager to start
sleep 10
rm -fr /root/.config /root/.cache
/usr/bin/firefox http://127.0.0.1:8081/infoscreen/infoscreen.html &
# let the browser start
sleep 10
/usr/bin/xte 'mousemove 10000 10000'
sleep 2
/usr/bin/xdotool key F11
date >> /tmp/date.txt
sleep 40000000The idea is to start a minimal window manager, then firefox and then programatically move the mouse away and press F11 to go fullscreen.
Everything works fine, except that the F11 key is not "pressed" - I am left with firefox together with its chrome.
If I ssh to the host and run at the root prompt
export DISPLAY=':0'
/usr/bin/xdotool key F11then firefox is correctly switched to full screen. Same if I use xte. The control file /tmp/date.txt has two date lines and there are no errors in /root/xinitrc-errors.
What could be the reason for this strange behaviour?
| why would a command run at the prompt and not in a script? |
The xset command is executed, but something in KDE overrides these settings afterwards.
The easiest solution would be to find the place in KDE where you can set the mouse acceleration. There may not be one though.
If you can't find a GUI way, you'll have to arrange for your xset command to run after KDE sets its own unmodifiable preferences. Add an autostart script.
|
I need to set some trackpoint settings automatically. I don't know the best file in which to place these commands, but I used .xsessionrc. The commands are properly executed (I can verify that by adding set -x in the script, I see the xset command being executed). The xinput command have their intended effect, but the xset command has no effect.
Can anyone help me figure out how to run all these commands, including xset, automatically?
Here are my commands:
xinput set-prop "Synaptics Inc. Composite TouchPad / TrackPoint (Stick)" "Device Accel Profile" 7
xinput set-prop "Synaptics Inc. Composite TouchPad / TrackPoint (Stick)" "Device Accel Constant Deceleration" 1.45
xinput set-prop "Synaptics Inc. Composite TouchPad / TrackPoint (Stick)" "Device Accel Adaptive Deceleration" 40
xinput set-prop "Synaptics Inc. Composite TouchPad / TrackPoint (Stick)" "Device Accel Velocity Scaling" 40
xset m 40 80I can run the exact same xset command after I log in and it works as intended.
I run KDE (Kubuntu 14.10). Its GUI configuration doesn't have a way to set the parameters I want to set.
| xset not having any effect in my .xsessionrc file |
Finally managed to find a solution for that, for some reason, the problem was in the fact that i was:Forcing TTY allocation, had to remove -tt flag from SSH client
Requesting Docker to allocate a pseudo-tty and run in interactive mode, had to remove -it flags from Docker CLI on the SSH server sideThe points above only applies to graphical applications, like st and firefox, containers that are interactive, but not graphical (fish shell and neovim) still needs both flags above, -tt on the SSH client and -t on Docker CLI |
I have a SSH server that is responsible for running dwm binary through X forwarding, on my client computer, i have a shell script that replaces the dwm binary on /usr/local/bin, inside that script, i simply make a call to the server requesting it to run the original dwm:
ssh -q -tt [emailprotected] dwm $@With only a single -t, i get the following error:
Pseudo-terminal will not be allocated because stdin is not a terminalOn the SSH server side, i'm making use of ForceCommand to pass the parameters received through a container_runner script, it looks like this:
#!/bin/sh
/usr/local/bin/$SSH_ORIGINAL_COMMANDThe reason for the ForceCommand here is to limit the possibility of running anything else other than a set of Docker container initialization scripts (located on /usr/local/bin)
Here's an example of one of those scripts, the one below runs the dwm Docker image:
#!/bin/sh
docker run \
--pull=never \
--rm \
-v container-scripts:/container-scripts \
-v ssh-keys:/home/dwm/.ssh \
-v x11-shared:/tmp/.X11-unix \
-it \
-e DISPLAY=:1 \
-e XAUTHORITY=/tmp/.X11-unix/container-cookie \
dwm \
$@ 2>/dev/nullcontainer-scripts - volume containing a set of scripts that will allow running others sibling containers inside containers
ssh-keys - the SSH keys in order to be able to run containers from inside other containers
x11-shared - X11 shared data (X11 socket and xauth cookie)My ssh_config looks like this:
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
ForwardX11 yes
ForwardX11Trusted yes
PreferredAuthentications=publickeyThings started to get inconsistent after i disabled SSH multiplexing from my ssh_config, previously with the settings below, it worked fine all the time (which makes no sense, as far as i know, SSH multiplexing shouldn't interfere in that), settings below:
ControlPath /tmp/%r@%h:%p
ControlMaster auto
ControlPersist yesWhat happens is that whenever i try to run startx passing as argument my dwm script that makes a request to the SSH server to run the actual dwm, i just get a black screen, and nothing happens, it just stays like that, example below:
startx /usr/local/bin/dwm -- :1But, if i run the same command above, slightly differently, using shell command substitution alongside with the shell noop operator, it works fine (just takes a few more seconds to show dwm than usual, probably due to the ugly hack)
: $(startx /usr/local/bin/dwm -- :1) | startx inconsistent behavior |
The way I got this working was to put an & after the sleep/xmodmap command (i.e. running it in the background), and put the full command before gnome-session (and the sleep command was necessary):
sleep 20 && xmodmap ~/.xmodmap &
exec gnome-sessionI believe exec gnome-session or something else is resetting my keyboard layout.
|
I am trying to figure out how to use my .xinitrc file to load an xmodmap configuration file. Although this seems to be a popular problem around the internet, I can't seem to get it working. I am running Arch Linux and am using Gnome as my desktop environment. Initially, all that was in my .xinitrc file was exec gnome-session. I have tried putting the xmodmap command (which works if I manually run it in a terminal) before and after the gnome-session command:
xmodmap ~/.xmodmap
exec gnome-sessionand
exec gnome-session
xmodmap ~/.xmodmapbut neither worked. As suggested elsewhere on the internet, I also tried doing this with a sleep before the xmodmap command:
sleep 20 && xmodmap ~/.xmodmap
exec gnome-sessionand
exec gnome-session
sleep 20 && xmodmap ~/.xmodmapbut neither worked.
| how to load an xmodmap configuration file using .xinitrc |
Ok after fiddling around the system I found that startlxde-pi exists so and it is actually what launches the default raspbian session (with openbox). Running
xinit startlxde-pi does the job.
Now I need to investigate how is that being called by startx when .xinitrc is missing.
|
I am trying to configure my .xinitrc to be able to choose different window managers before starting X but I cannot reproduce the same environment as when I just run startx without a .xinitrc file in my home dir.
case $session in
awesome ) exec awesome;;
ob ) exec openbox-lxde-pi;;
# No known session, try to run it as command
*) exec $1;;
esacI am able to run either of my options on the file. The problem is that when I run openbox I don't enter to the default X session with all the menus and background processes running.
What is the exact command that happens when you run startx (and you have no .xinitrc)?
Is there a conf file that I need to specify to open box so I get the default session?
EDIT: I have checked the system wide file that startx runs in the case of an absent .xinitrc at home. These are it's contents:
#!/bin/sh# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)# invoke global X session script
. /etc/X11/Xsessionand the file /etc/X11/Xsession never shows any call to start any window manager.
| What is the exact command to start the openbox-lxde default session in raspbian? |
The resources are stored on the X server. So if you are using a remote X server on Windows, the best way would be to copy your .Xresources file to Windows, and load it into the X server whenever you start the X server.
If this doesn't work for you, because you want to have your .Xresources on the CentOS machine, then the only way to do it would be to check on every login, e.g. inside .profile. Make sure to also check DISPLAY, and all call xrdb if DISPLAY is set. It's also nice to have some sort of check to make sure this only gets called when you are logging in remotely. Finally, if you have several connections at once, you may want to use xrdb first to see if the resources are already loaded, and only load them when they are missing.The X resources are used by the X clients (application programs, but probably not your MobaXTerm, which is Windows), but they are stored on the X server.
So when you run xrdb, it connects to the X server like all X clients do, and makes changes to the stored value.
If the X server used is running is on your windows machine (no matter if it's provided by MobaXTerm, or if it's some other X server running on Windows, like VcXsrv), then that's where the resources are.
I had a quick look at the MobaXTerm documentation, but it's not obvious how to access the in-built X server locally. Possibly you can do it through a "local terminal" and then use Cygwin or WSL to execute xrdb on your Windows machine.
|
I added an .Xresources file to my home directory and when I load it from my shell prompt with xrdb -merge ~/.Xresources the resource settings are recognized (for X programs started afterwards).
However I would like to have these resources applied all the time when i login to my user account. I thought the X11 system would look for the ~/.Xresources file by default, but it doesn't.
The machine runs CentOS 6 and I connect to it remotely from MobaXterm (MS Windows) which provides a X server and shows the windows of each CentOS app in MS Windows windows.
So where do I put the merge command best? Shell initialization or ~/.xinitrc? Or somewhere else?
| .XResources are not loaded automatically. - Where should I put my xrdb -merge ~/.Xresources initialisation? |
The xinitrc file is a shell script. The exec statement in a shell script says "replace this running program (the shell running the script) with the given program". Assuming the given program can be run, the shell won't be around to run anything after the first exec; anything that comes after the first successful exec is effectively ignored.
To make it clear, I would comment out anything that you don't want to run by placing a # character in front of it:
# exec i3
exec dwmThat way, if you want/need to switch back, it's easy to remember what the previous value was.
|
I have i3 installed as my primary window manager; now I want to test dwm. My xinitrc has only one line: exec i3. If I want dwm to launch and not i3 do I have to delete this line completely or do I have to just put exec dwm above this line?
| Is there a preference rule for exec in xinitrc? |
In your .xinitrc you need to execute xrdb first and then launch i3. E.g:
#!/bin/shxrdb -merge ~/.Xresources
exec i3 | I'm using fresh install of Arch with i3; after logging into I type in startx and i3 is starting with default settings, despite the configuration of my .xinitrc:
#!/bin/sh
exec i3
exec xrdb ~/.XresourcesBut when I run xrdb ~/.Xresources from the terminal, the colors change to values configured in .Xresources
| .xinitrc not loading .Xresources [closed] |
The solution is in the comment from @steeldriver:Is your .xinitrc a bash script, or a sh script? the [[ ... ]] extended
test syntax may not be supported in the latter |
I have a condition in .xinitrc that is not met, and I don't understand why:
I have the .Xresources file in my ~ (with read permissions), and my ~/.xinitrc contains a line with
[[ -f ~/.Xresources ]] && xrdb -load ~/.Xresources &However the condition between double brackets is not met. Why is that? The file exists and is located in my home!
If I change the line to this,
xrdb -load ~/.Xresources &Then it works, and also works if I run [[ -f ~/.Xresources ]] && xrdb -load ~/.Xresources from bash.
Why is not working in .xinitrc?
My solution for the moment was to put directly the second line, however I don't understand why the condition is not met.
| condition in .xinitrc not satisfied, don't know why |
On exec dwm, the shell process that is executing the .xinitrc script will be replaced with dwm, and so any commands in .xinitrc after that will be totally ignored.
Will it work if you just swap the order of those two lines?
wal -i "/home/joe/pictures/wallpapers" &
exec dwmOr does this have some undesirable side effects, like flickering as the window manager starts up? If so, you'll need to find some way to have dwm run the wal ... command, as the .xinitrc script interpreter process simply won't exist any more after exec dwm is executed.
|
I'm having some trouble starting pywal through .xinitrc
Currently my .xinitrc is:
exec dwm
wal -i "/home/joe/pictures/wallpapers" &Anyone know what I could have messed up?
| pywal wont run on startx |
EDIT:
Please use the upvoted answer and not this one.
OLD ANSWER:
I found this bug and some workarounds here:
https://bugzilla.redhat.com/show_bug.cgi?id=1149893
More specific you have to place a .rules file in
/etc/polkit-1/rules.d/
(Select a filename and just givr the .rules extension)
and give the rules:
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" ||
action.id == "org.freedesktop.color-manager.create-profile" ||
action.id == "org.freedesktop.color-manager.delete-device" ||
action.id == "org.freedesktop.color-manager.delete-profile" ||
action.id == "org.freedesktop.color-manager.modify-device" ||
action.id == "org.freedesktop.color-manager.modify-profile") &&
subject.isInGroup("ATTENTION")) {
return polkit.Result.YES;
}
});Then you have to Replace the word "ATTENTION" with your user's group.
|
I am running a fresh install of CentOS 7 GNOME
so I could RDP from Windows. Ifollowed the “Connect to GNOME desktop environment via XRDP” instructions,
but when I connect I get an additional login that says
authentication is required to create a color profileHow do I remove this additional login?
In an attempt to solve this problem I tried
a solution at “Griffon's IT Library”, but it did not work
because link is a lot more then just a solution to this problem.
Ipasted thesolution below.When you login into your system via remote session, you will see this
message popping up. You can simply cancel and you will be able to
proceed till the next time you login and start a new session.
To avoid this prompt, we will need to change the polkit configuration.
Using admin privileges, create a file called 02-allow-colord.conf
under the following directory /etc/polkit-1/localauthority.conf.d/
The file should contains [sic] the following instructions
and you should not be prompted anymore
with such authentication request while remoting into your system
polkit.addRule(function(action, subject) {
if ((action.id == “org.freedesktop.color-manager.create-device” ||
action.id == “org.freedesktop.color-manager.create-profile” ||
action.id == “org.freedesktop.color-manager.delete-device” ||
action.id == “org.freedesktop.color-manager.delete-profile” ||
action.id == “org.freedesktop.color-manager.modify-device” ||
action.id == “org.freedesktop.color-manager.modify-profile”) &&
subject.isInGroup(“{group}”)) {
return polkit.Result.YES;
}
}); | Authentication is required to create a color profile |
I solved the issue myself, hopefully someone else will find it usefull. I took a look at ~/.xsession-errors, it contained:
(imsettings-check:16467): IMSettings-WARNING **: 04:42:56.491: Could not connect: Connection refused(imsettings-check:16467): GLib-GIO-CRITICAL **: 04:42:56.491: g_dbus_proxy_call_sync_internal: assertion 'G_IS_DBUS_PROXY (proxy)' failed
GLib-GIO-Message: 04:42:56.807: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.** (process:16260): WARNING **: 04:42:56.824: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=GNOME environment variable: Could not connect: Connection refusedand then I've googled a rootcause, miniconda installation has broken PATH in .bashrc file, I have removed this line and it has fixed it:
export PATH="/home/stiv/miniconda3/bin:$PATH"UPDATE: Later I've found x2go, which works way more reliable and faster then XRDP.
|
This is my xrdp config:
[Globals]
ini_version=1
fork=true
port=3389
use_vsock=false
tcp_nodelay=true
tcp_keepalive=true
security_layer=negotiate
crypt_level=high
certificate=
key_file=
ssl_protocols=TLSv1.2, TLSv1.3
autorun=
allow_channels=true
allow_multimon=true
bitmap_cache=true
bitmap_compression=true
bulk_compression=true
max_bpp=128
use_compression=yes
new_cursors=true
use_fastpath=both
blue=009cb5
grey=dedede
ls_top_window_bg_color=009cb5
ls_width=350
ls_height=430
ls_bg_color=dedede
ls_logo_filename=
ls_logo_x_pos=55
ls_logo_y_pos=50
ls_label_x_pos=30
ls_label_width=65
ls_input_x_pos=110
ls_input_width=210
ls_input_y_pos=220
ls_btn_ok_x_pos=142
ls_btn_ok_y_pos=370
ls_btn_ok_width=85
ls_btn_ok_height=30
ls_btn_cancel_x_pos=237
ls_btn_cancel_y_pos=370
ls_btn_cancel_width=85
ls_btn_cancel_height=30
[Logging]
LogFile=xrdp.log
LogLevel=DEBUG
EnableSyslog=true
SyslogLevel=DEBUG
[Channels]
rdpdr=true
rdpsnd=true
drdynvc=true
cliprdr=true
rail=true
xrdpvr=true
tcutils=true
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20I am trying to connect with mstsc to this machine (this is after fresh pc restart, noone has logged in):while in this login box, no disconnect happens:after I put there correct login/password, I get black screen first and then mstsc window closes. I tried to connect from KDE remote connection application, but it also failed same way. xrdp.log doesn't seem to contain anything interesting:
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20190606-04:14:36] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20190606-04:14:36] [DEBUG] return value from xrdp_mm_connect 0
[20190606-04:14:36] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC started connecting
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC connecting to 127.0.0.1 5910
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC tcp connected
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC security level is 2 (1 = none, 2 = standard)
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC password ok
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending share flag
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving server init
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving pixel format
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving name length
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC receiving name
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending pixel format
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending encodings
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending framebuffer update request
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC sending cursor
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: VNC connection complete, connected ok
[20190606-04:14:36] [DEBUG] xrdp_wm_log_msg: connected ok
[20190606-04:14:36] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20190606-04:14:36] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:47744)
[20190606-04:14:37] [DEBUG] Closed socket 20 (AF_UNIX)
[20190606-04:14:37] [DEBUG] Closed socket 12 (AF_INET 127.0.0.1:3389)
[20190606-04:14:37] [DEBUG] xrdp_mm_module_cleanup
[20190606-04:14:37] [DEBUG] VNC mod_exit
[20190606-04:14:37] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:40224)How can I fix that?
| xrdp disconnects immediately after connection from Windows10/Centos to Centos7 |
after looking around at the internet for a way to fix that, i found a temporary solution
looks like the cause is a problem with the 18.04 version of ubuntu itself
the way to fix it is quite simple, after logging in, the first thing you should do is umounting the thinclient thing, i did that by terminal using
sudo umount -f thinclient_drivesafter that, you must rename the thinclient_drives to .thinclient_drives
just add a dot before and it will fix everything, however, looks like ubuntu isnt umounting correctly when finishing the session, so, you gotta umount manualy every time, that way, it will work and mount correctly the next time you log in
im gonna try to see now if its possible to run some kind of command before logging off, if it is, then ill fix it by setting a command to umount everytime b4 login out
|
I had to install a Linux based server, so after facing many problems over and over again, I finally managed to overcome all of them
So now I was configuring xrdp and at the first look, everything worked fine, but then came the problem I can't find a way to fix it at all:
Here at my work, we have lots of computers, and only 2 of them run Linux, the rest is all Windows, and the problem is at te remote conection from Windows to Linux.
When someone use Windows's native remote app, that person can connect without problems, you can even share files with the remote computer (the server one) by the thin client thing, but only the very first time.
When a user ends his session, later, after coming back and starting a new session, at trying to open the thin client drives again, it no longer works.
The user receives the following error:error message without handling: error getting information for the
file. Endpoint transport is not connected.I don't get it at all, because the first time someone logs in, it works perfectly, you can even quit the remote connection without ending your session and come back later, and everything will still working.
However, if you do finish your session and log back again later, it doesn't work anymore until server reboot.
I tried lots of stuff. I first thought it was some hidden session left behind, I even tried restarting xrdp, but the problem didn't get fixed at all.
I also tried umounting, but it doesn't let me umount the thin client.
I tried the command ps aux to see all process running, and killed a lot of them, trying to fix without reboot, but no success.
No matter how hard i try, I cant find whats is going on, I know it might be some hidden process left I can't see or something else, but I don't know how to find it if it is something like that.
The only solution for now is not fishing a session while leaving the remote connection, otherwise the server has to be rebooted.
After reboot, thin client works fine again, but just once, then the same thing happens all over again.
Any tips on what's causing all of that or how to fix it?
| File sharing over xrdp only works the first time |
TL;DR:The user you're connecting with must be logged out
xrdp must be running on system startup, not when you're logged in
Your network connection should be available to all users (i.e. at the system startup)The user you're connecting with must be logged outThe following error is observed in /home/{username}/.xsession-errorsstartkde: Starting up...
kdeinit5: preparing to launch '/usr/lib/x86_64-linux-gnu/libexec/kf5/klauncher'
kdeinit5: Launched KLauncher, pid = 3943, result = 0
Waiting for already running klauncher to exit.
Waiting for already running klauncher to exit.
Another instance of klauncher is already running!
kdeinit5: Communication error with launcher. Exiting!
kdeinit5_wrapper: Warning: connect(/run/user/1000/kdeinit5__10) failed: : Connection refusedThe KDE session must be unique. This is happening because I'm currently physically logged on in that machine. To solve this we need to log out.xrdp must be running on system startup, not when you're logged in
If we're logging out the xrdp server stops running. There's a simple fix:$ sudo systemctl enable xrdp
$ sudo systemctl restart xrdpYour network connection should be available to all users (i.e. at the system startup)After this is done, there are still problems in connecting. My Debian machine uses a Wifi connection, which is instantiated only after I log in into the system. When I'm at the SDDM Login Screen, the wifi connection is not established.
I had to do the following (from this answer): go into Network Manager > Edit Connections. Select your connection, click Edit and check Available to all users.
|
I am trying to connect to Debian 10 machine with KDE from Windows 10 using RDP. I am able to connect as root, but not as a less privileged user. The connection drops after I type the correct credentials in the login screenI've done a standard xrdp installation on my Debian machine, which is:
$ sudo apt install xrdp
$ sudo adduser xrdp ssl-cert
$ sudo systemctl restart xrdpI wasn't able to find the solution online and turns out there were several problems, so I'm posting the solution below for everyone's use.
| Can't connect to xrdp as normal user, connecting as root is fine |
This bug report has the same symptoms as described in the question. Seems xserver-xorg-legacy package is the culprit. So to make it work, it boils down to the following two commands:
apt-get purge xserver-xorg-legacy
apt-get install xrdpThe required services are started automatically after install. No need to reboot. Connecting and authenticating should automatically show the desktop.
I do not know though what the consequences are of removing xserver-xorg-legacy. In the bug report it is mentioned to remove if not needed.
|
According to xrdp docs it should be possible to connect remotely without using a local VNC server: xrdp can connect to a locally created X.org session
with the xorgxrdp drivers [my emphasis], to a VNC X11 server, and forward to
another RDP server. I can connect with RDP from Windows: Then I select Xorg session and supply username and password. After some timeout an error pops up about an unknown connection problem. This is tail /var/log/xrdp.log and tail /var/log/xrdp-sesman.log output:
[DEBUG] Closed socket 17 (AF_UNIX)
...
[DEBUG] Closed socket 17 (AF_UNIX)
[DEBUG] xrdp_wm_log_msg: some problem
[DEBUG] xrdp_mm_module_cleanup
[DEBUG] Closed socket 16 (AF_INET6 ::1 port 38094)dmesg doesn't show any problems nor references to Xorg or similar. ps -A | grep rdp shows xrdp and xrdp-sesman processes running. Tried connecting with Windows 7 to Debian: same problem. xrdp.ini and sasman.ini:In sesman.ini the AlwaysGroupCheck=false. The startwm.sh:Any ideas? Running on a virtualized minimal, clean Debian 9.1 installation. Only only lxde-core and xrdp installed with apt-get. (No errors during installation.) xorgxrdp drivers installed (since they depend on xrdp).
| Using XRDP without local VNC server |
xrdp writes to 1, that is stdout as shown by strace but it looks that it buffers its output for some reasons. Try this:
$ unbuffer xrdp -v | grep Version
Version 0.9.4Alternatively you can use stdbuf:
$ stdbuf -o0 xrdp -v | grep Version
Version 0.9.4 |
Not able to grep xrdp version line by running below command on ubuntu 14.04
$ sudo xrdp -v | grep -i "version"Output : Blank
$ sudo xrdp -v Output :
logging configuration:
LogFile: /var/log/xrdp.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2004-2014
See http://www.xrdp.org for more information.
Version 0.9.0Where as when try with other program like below perl command
$ sudo perl -V | grep "version"Output :
Summary of my perl5 (revision 5 version 18 subversion 2) configuration:How to get version 0.9.0 as output of command !
| How to grep XRDP version number? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.