X session, but only remote - linux

I would like to setup a small computer (Raspberry Pi) running Arch Linux to accept remote X sessions. Doing this usually means setting up Xorg server and running one of the Display Managers. I have done this before, and I will go this route if I have to. However, since the machine is very underpowered, and it is actually not connected to a physical monitor, I was hoping to setup the X server to accept only remote sessions. This way no memory would be wasted on managing the local graphics card, video memory etc, since they are not being used. Is it possible to setup the X server to accept only remote sessions without going into local graphical mode? And how?

It's possible to set up a *ix to remote display to a system you're sitting in front of, without an X server on the machine running the app.
You need X11 libraries, one or more X11 applications, and you probably want openssh set up for remote X11 forwarding - all on the raspberry pi. You'll also want an X server running on the machine you're sitting in front of.
On the Raspberry Pi, change your sshd_config to include "X11Forwarding yes". After making this change, restart sshd or reboot.
Then apt-get or yum your X11 libraries and app(s).
When you connect to the Raspberry Pi machine, use "ssh -Y" instead of just ssh to pass along xauth data.
Good luck!

Disable automatic start of the login manager and X server, instructions are googlable, say http://www.debianadmin.com/howto-boot-debian-in-text-mode-instead-of-graphical-mode-gui.html. From personal experience running X apps on raspberry remotely is not too good either.

Related

Run any kind of browser on Raspberry pi 3 without GUI

The goal is to open a web browser in my home network from a from a remote location with ssh tunnelling.
SSH tunnel is okay, I just want to somehow run a browser on my RPI3 in my home network.
Is it possible somehow?
I use my pi as a media server, only kodi is running on it, there isn't any GUI operating system on it (raspbian for example).
All kind of solution is interested.

Cloning display output via ssh

Is it possible to clone image from display via ssh? I want to see what is on my first laptop display from another laptop, but without any additional software like teamviewer or vnc.
The short answer is: Yes, but you may be unhappy with the results.
The protocol you are looking for is called X11 Forwarding. This option must be enabled on your server by setting X11Forwarding yes in /etc/ssh/sshd_config, then reloading the daemon.
Once enabled on the server, the client must initiate their ssh session using the -x flag.
The major limitations of this technology are that:
The data is not optimized for transfer over the wire. For most environments you end up with a low framerate and/or graphical artifacts. As long as you're doing something like running a GUI installer it should not be a problem, but do not expect to be able to stream video / play a game using X11 forwarding.
The client must have an X server installed. If you are connecting from a Windows machine (or another machine that does not have an X server installed), you may need to use a project such as Xming in order to actually interpret the data once you get it to the client.

How do I force a higher resolution on Windows 7?

I have a laptop, and I want to force the native screen to display 1080p. I know the display driver is capable of that because I have connected it to a 1080p screen before and it worked.
I am doing this because I want to establish a remote connection from my Raspberry Pi to the laptop. The Pi (an ARM linux machine) is connected to the 1080p screen. At the moment, the remote connection only covers part of the screen, as the laptop is only displaying 1366x768 (or something).
I want a software solution, if possible. Also, I want a server-side solution (that is, on the windows machine) as finding and using Linux software that works on the pi is a bit of a nightmare!
I am using TightVNC, though am prepared to try any package is free and which works well, as a server for Windows and client for ARM Linux.
Solutions I have tried that don't work:
'show all modes' on control panel (still didn't show the mode 1920x1080, which I know the graphics adapter can do)
ZoneScreen OS (wouldn't let me create a higher resolution)
Demoforge Mirage (um... didn't do anything. Maybe I didn't get how you're supposed to use it)
To force the raspberry pi to have a certain display. Go on boot folder cd /boot/
After that, open the config file with your editor (I use geany sudo apt-get install geany)
sudo geany config.txt
In this file, it should have two line that you have to uncomment it:
framebuffer_width=800
framebuffer_height=600
Just change the values of those variables and save the file.
You may have to reboot your raspberry pi

How can I run an OpenGL application installed on a linux machine from my windows machine?

In the spirit of being helpful, this is a problem I had and solved, so I will answer the question here.
Problem
I have:
An application that has to be installed on on Redhat or SuSE enterprise.
It has huge system requirements and requires OpenGL.
It is part of a suite of tools that need to operate together on one machine.
This application is used for a time intensive task in terms of man hours.
I don't want to sit in the server room working on this application.
So, the question came up... how do I run this application from a remote windows machine?
I'll outline my solution. Feel free to comment on alternatives. This solution should work for simpler environments as well. My case is somewhat extreme.
Solution
I installed two pieces of software:
PuTTY
XMing-mesa The mesa part is important.
PuTTY configuration
Connection->Seconds Between Keepalives: 30
Connection->Enable TCP Keepalives: Yes
Connection->SSH->X11->Enable X11 forwarding: Yes
Connection->SSH->X11->X display location: localhost:0:0
Lauching
Run Xming which will put simply start a process and put an icon in your system tray.
Launch putty, pointing to your linux box, with the above configuration.
Run program
Hopefully, Success!
If you want the OpenGL rendering to be performed on your local machine, using a Windows X server, like Xming is a good solution. However, if you want rendering to be done on the remote end with just images sent to the local machine, you want a specialized VNC system that can handle remote OpenGL rendering, like VirtualGL.
You could also use VNC ( like cross platform remote desktop )
X is more efficent since it only sends draw commands rather than pixels, but if you are using opengl it is likely that most of the data is a rendered image anyway.
Another big advantage of VNC is that you can start the program locally on the server and then connect to it with VNC, drop the connection, reconnect from another machine etc without disturbing the main running program.
For OpenGL, running an X server is definitely a better solution. Just make sure the application is developed to be networked. It should NOT use immediate mode for rendering and textures should be RARELY transferred.
Why is X server a better solution in this case (as opposed to VNC)? Because you get acceleration on workstation, while VNC'ed solution is usually not even accelerated on the mainframe. So as long as data is buffered on the X server (using vertex arrays, vertex buffer objects, texture objects, etc) you should get much higher speed than using VNC, especially with complex scenes since VNC has to analyze, transfer and decode them as pixels.
If you need server glx version 1.2 the free version of Xming (Mesa 2007) works fine. But if your application needs version 1.4, example qt5, the X Server from Cygwin works free to run it use this commands:
[On server]
sudo vi /etc/ssh/ssh_config
Add:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalHost no
AllowTcpForwarding yes
TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 10000
sudo vi ~/.bashrc
Add:
export DISPLAY=ip_from_remote:0
Now restart ssh server
[On Client slide]
Install Cygwin64 (with support to X package) after that run this command:
d:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/xinit /etc/X11/xinit/startxwinrc -- /usr/bin/XWin :0 -ac -multiwindow -listen tcp"
Now execute ssh client:
d:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -e /usr/bin/ssh -Y user_name#ip_from_server

Re-attatching an X server view of a lost process

I'm running Xorg and my (Qt) program daemonises itself. Now I log out and restart the X server. When I log in again my process is still running fine, but I can't see it.
Is there a way of attatching the new incarnation of the X server to the old process?
If I don't restart the whole server, but log out and in again, is there a way to look at the old process?
Thanks
xpra should achieve your requirement. And it can also start tcp connection (without need of ssh). Start it on the you server:
xpra start :100 --start-child=xterm --bind-tcp=0.0.0.0:10000
Connect it on your client:
xpra attach tcp:SERVERHOST:10000
You can also use mac or windows xpra app to connect it. I tried in on win7 and osx10.10.2. The download link:
windows: https://www.xpra.org/dists/windows/Xpra_Setup.exe
mac: https://www.xpra.org/dists/osx/x86/Xpra.dmg
After the connection to the X server is lost, it is not possible to regain it.
There was an xserver proxy called xmove, but it is quite deprecated and doesn't work with several newer X extension, which are likely used by modern toolkits.
You could try to run your process in another virtual X server like xvnc or (better) NX. NX is a X proxy technology developed by NoMachine. There exist free implementations of NX servers as well.
If you run your program inside such a server, it is possible to attach and detach from it from arbitrary graphical environments.
Use something like Xpra: it allows you to run applications on an off-screen X11 server to which you can re-attach whenever needed, and from remote machines too. It supports "seamless" sessions too so the windows will appear just like local windows.
Practical example:
xpra start :10 --start-child=/bin/YOURAPP
Then whenever you want to re-attach (say after an X11 server restart):
xpra attach :10
Or from a remote machine:
xpra attach ssh://THESERVERHOSTNAMEORIP/10

Resources