How to access an open terminal session - linux

I would like to know if it is possible on any OS to be able to remotely connect to a terminal prompt session which is already open as it gets quite annoying when switching to the iPad using the prompt app and not being able to connect to that already open session.

Have you looked into the screen program? It allows you to run multiple sessions at once and connect to them from other devices/sessions.
http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

Related

Ubuntu 20.04 x11vnc blank (not black) screen after session login

I have a remote headless server without a monitor attached with SSH access.
From what I found out the hard way, the default install does not support VNC (using vino) without a monitor attached.
Tried several things to get this working this without success.
I followed this guide on setting up x11vnc and lightdm: https://www.crazy-logic.co.uk/projects/computing/how-to-install-x11vnc-vnc-server-as-a-service-on-ubuntu-20-04-for-remote-access-or-screen-sharing
I then also tried to install xubuntu-desktop, which did not help.
The issue is:
VNC asks for password and connects. All good.
I see the session login window (with the panel at the top), everything looks ok. All good.
screenshot1
After login I only see a blank screen. Nothing responds. Right click on the desktop does not open a context menu. Not good.
screenshot2
Expected would be to see the desktop, panels, menus...etc.
How would one solve this? And what exactly is happening here. The session logs show everything is ok, no errors. But the computer is unresponsive on VNC, only the background is visible.
Note: I do not have physical access to this server. A solution via SSH would be best.

Pyautogui on RDP

I am using pyautogui in Windows 10 with Python 3, in a virtual machine accessed by remote desktop.
Unfortunately, the program stops execution when I close remote connection, giving "OSError: screen grab failed".
I've searched for a solution online, but the only workaround that I've found is from this link
Use a remote desktop client that allows you to keep outputting the display, even if you minimise the window/close your PC. I used terminals (https://terminals.codeplex.com/ - not affiliated with them at all just recommending as it solved this issue for me).You can set this up to persist the display, and your code should then run fine.
The problem is that I can't find a setting for persisting display. I've also found this:
pyautogui._pyautogui_x11._display = Xlib.display.Display(
os.environ['DISPLAY']
)
... but it doesn't seems to work either (gives me errors...).
Do you have some workaround to do the trick?
Based on an answer from here:
when you disconnect from RDP, Windows lock the computer and does not render the screen any more so any automation apps which needs GUI fails to work.
To disconnect from RDP without losing the screen you can disconnect using following commands as administrator (its better to make a bat file and run that file as administrator when you need to disconnect from RDP):
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console )
I have resolved using TightVNC instead of remote desktop and detaching mouse cursor.

typewrite(),press() on pyautogui is not working on Remote Desktop

I am using my host where i used to connect to the Remote machine where i want to fetch some data.
I am using pyautogui for press operation and typewrite() to enter some values.
The remote server is configured and application i want to operate will be always open when i connect to remote machine.
I am able to login through pyautogui.
after that when i write below code:
pyautogui.press('esc')
pyautogui.press('f1')
pyautogui.typewrite("T")
Its not typing T on the application that is opened on remote server.
Please suggest me some python way so that i can overcome from this issue.
Thanks
Simun
go and change the type of the keyboard , i faced the same situation by typing a full url in ubuntu terminal , i solved by changing the type of keyboard in the system to US

Opening multiple terminal with remote access

I am using remotely logged in to my work server through SSH. I have to work on terminal and it will be helpful if I can pull up multiple terminal to access multiple directories and files. How can I do that? I am a beginner. So, any help will be greatly appreciated.
screen is a great tool for this.
screen -m
will open a daemonized screen window and you can detach it to return to your primary shell with
Ctrl+A , then press D
To resume the screen use
screen -r
You can create multiple screens with names and resume them individually. Checkout the manpages for more info
You can use "screen" on you server to open more shell session in a "dedicated" environment so you can even disconnect from the server without loosing your shells (in case of idle, for example).
see http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

Run application when start vnc server

I want to automatically launch an application when access to the VNC session. The scenario is that when open the VNC session, the application will be run as a popup automatically. I think I need to modify the ~/.vnc/xstartup.turbovnc file, but I don't know where do I need to start.
Thank you.

Resources