Connecting local Spyder IDE (on Windows) to remote kernel on Google Cloud - python-3.x

I have followed the instructions here:
(including the paramiko packgage).
The putty connection works.
I have also downloaded the kernel .json file from the VM.
Into Spyder I go:
Consoles / Connect to existing kernel
Point toward the .json file (located in the local /jupyter/runtime folder)
Check this is a remote kernel
username#location:port (same as in Putty connection)
Enter the remote user password
Ok ...
Connecting to kernel ....
Appears in the Ipython console. And spins and spins. No timeout, nothing.

Related

How to use terminal in pycharm remote development seassion

I'm using the remote development feature of pycharm, and I have successfully connected and am able to do changes to the files, but when I open the terminal I get this error :
you have no permission to access the terminal. to execute commands request the full access permission from the host
Notes
The server is ubuntu 16 Linux

VS Code SSH Remote Connection issues

I have been using VS Code and connecting remotely from home on my MacBookPro to work on a college project for the past month and for some reason it will not connect to the Computer Lab Server anymore. No idea why this is happening but it just stopped working today. I tried re-installing vs code and also installed it on my wife's computer but it still wont connect through remote ssh. No idea why this is happening but now I have no way to debug my code and have to just edit everything using emacs through the terminal app on my mac. I didn't make any changes from last night to this morning.. I can still ssh into the Computer Lab server from terminal fine. Bellow is some of the log that seems to repeat itself while it is trying to connect using the extension: remote ssh.
Any help on this would be greatly appreciated, or are there other IDE's that are somewhat easy to connect remotely through ssh available for Mac?
MY LOG:
17:09:21.150] Log Level: 2
[17:09:21.152] remote-ssh#0.55.0
[17:09:21.152] darwin x64
[17:09:21.153] SSH Resolver called for "ssh- remote+7b22686f73744e616d65223a226c696e75782e63732e75736d2e6d61696e652e656475222c2275736572223a22746b7766c6b227d", attempt 1
[17:09:21.154] SSH Resolver called for host: tkwilk#linux.cs.usm.maine.edu
[17:09:21.154] Setting up SSH remote "linux.cs.usm.maine.edu"
[17:09:21.158] Acquiring local install lock: /var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-remote-ssh-tkwilk#linux.cs.usm.maine.edu-install.lock
[17:09:21.192] Looking for existing server data file at /Users/twilk31888 1/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-tkwilk#linux.cs.usm.maine.edu-93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3-0.55.0/data.json
[17:09:21.194] Using commit id "93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3" and quality "stable" for server
[17:09:21.195] Install and start server if needed
[17:09:21.220] Checking ssh with "ssh -V"
[17:09:21.233] > OpenSSH_8.1p1, LibreSSL 2.7.3
[17:09:21.249] askpass server listening on /var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-ssh-askpass-a45a56dcf061823c964fa6ae7ff720ac39d2477f.sock
[17:09:21.249] Spawning local server with {"ipcHandlePath":"/var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-ssh-askpass-c1cf58194111018972f9cf0cd413a94b7293bda9.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","54601","-o","ConnectTimeout=15","tkwilk#linux.cs.usm.maine.edu"],"dataFilePath":"/Users/twilk31888 1/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-tkwilk#linux.cs.usm.maine.edu-93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3-0.55.0/data.json"}
[17:09:21.249] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/twilk31888 1/.vscode/extensions/ms-vscode-remote.remote-ssh-0.55.0/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer)","VSCODE_SSH_ASKPASS_MAIN":"/Users/twilk31888 1/.vscode/extensions/ms-vscode-remote.remote-ssh-0.55.0/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/9y/scfwvr0577qfgs_l_c5ym13m0000gq/T/vscode-ssh-askpass-a45a56dcf061823c964fa6ae7ff720ac39d2477f.sock"}
[17:09:21.262] Spawned 4239
[17:09:21.373] > local-server> Spawned ssh: 4240
[17:09:21.379] stderr> OpenSSH_8.1p1, LibreSSL 2.7.3
[17:09:21.756] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:wny4SU/uVC6y9cUUH5kJnRe5SVWpBhWGABpWSYzMNG0
[17:09:22.132] stderr> Authenticated to linux.cs.usm.maine.edu ([130.111.131.121]:22).
[17:09:22.490] > ready: 946b80caa0f2
[17:09:22.553] > Linux 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020
[17:09:22.554] Platform: linux
[17:09:22.685] > 946b80caa0f2: running
[17:09:22.713] > Acquiring lock on /home/students/tkwilk/.vscode-server/bin/93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3/vscode-remote-lock.tkwilk.93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
> Installation already in progress...
> 946b80caa0f2##24##
[17:09:22.714] Received install output: 946b80caa0f2##24##
[17:09:22.714] Server installation process already in progress - waiting and retrying
[17:09:22.714] Terminating local server
[17:09:22.740] Local server exit: 15
The key info is provided at the line
[17:09:22.713] > Acquiring lock on /home/students/tkwilk/.vscode-server/bin/93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3/vscode-remote-lock.tkwilk.93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
If you could ssh into the server and remove the file by
rm -rf /home/students/tkwilk/.vscode-server/bin/93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3/vscode-remote-lock.tkwilk.93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
then reboot the vscode and try to connect, things should be fine.
Encountered the same problem on two servers with two different causes:
One problem is solved by referring to this issue: #2805
Command Palette -> Select "Remote-SSH: Kill VS Code Server on Host..."
Remove the directory of "~/.vscode-server" on remote server.
The other problems, is caused by running out of storage quota on that server. And the issue was automatically solved when the quota was increased.
Most of the microsoft/vscode-remote-release I see, like issue 2901, are about a failed symlink on the target server.
If you can ssh in command line, try and rename /home/students/tkwilk/.vscode-server in order to force a complete re-installation of the SSH remote plugin by VSCode.
mv ~/.vscode-server ~/.vscode-server-old
Try and connect to that server through VSCode and see if the issue persists, when it tries to redo the complete vscode-server SSH setup.
I found a new reason, but it may be rare:
Before I found this problem, I had updated and modified the linux kernel of the remote virtual machine, and modified the UTS_SYSNAME located in /include/linux/uts.h;
#define UTS_SYSNAME "Linux Clstilmldy-LZM"
// #define UTS_SYSNAME "Linux"
So I met this problem, but I never found a feasible solution;
I carefully looked at the vscode output and found that vscode remote ssh: Unsupported platform: Linux Clstilmldy LZM;
[16:38:25.333] SSH Resolver called for host: Ubuntu
[16:38:25.334] Setting up SSH remote "Ubuntu"
...
[16:38:35.555] Got password response
[16:38:35.555] "install" wrote data to terminal: "******"
[16:38:35.574] >
[16:38:36.069] > ac25402ecd5f: running
[16:38:36.086] > Unsupported platform: Linux Clstilmldy-LZM
[16:38:36.096] > ac25402ecd5f: start
I guess that vscode remote ssh does not recognize system names other than Linux, Mac, and Windows, so I changed this line back.
I recompile and install the kernel.
okkk, I solve the problem.
Another answer, since none of these worked for me. Try toggling off the following setting in VSCode: remote.SSH.useFlock

How can we add an application to startup remotely (Linux)

I have an application which executes on a remote Linux system. How can I add this application to startup of that remote system from my local linux system. I know the path of executable (application) on remote system.
I searched a lot on different sources but didnt get any idea ?
Edit: What am I doing is:
I have developed a desktop-application (using qt).
I have loaded this application on remote system (using libssh).
I am able to execute this application remotely.
Now, I want to add this application to startup of that system remotely (stucked here).
Any Idea how to complete 4th step ??
Create Executable.desktop file (on local machine)
Open ssh connection and get remote machine root access
Copy this Executable.desktop file to "etc/xdg/autostart" on remote system (using ssh and commonds )
Reboot the remote system (using ssh and commonds )
Note: The solution will work if we know the location of executable/application on remote system

How to run Jprofiler from Windows machine to Remote Linux JVM

Kindly let me know how to run Jprofiler from Windows machine to Remote Linux JVM.
Thanks a lot in advance.
1) Go to the download page, download the .tar.gz distribution and extract it on the remote Linux machine.
2) On the remote Linux machine, start the command line utility bin/jpintegrate, then follow the steps in the command line wizard.
3) Transfer the generated JProfiler config file to your local Windows machine.
4) On your local Windows machine, start the JProfiler GUI and import the config file with Session->Import Session Settings
5) Start the profiled JVM on the remote Linux machine and the imported session in the JProfiler GUI on the Windows machine.
For remote connect to jprofiler on Windows with remote machine JVM(Centos 7)
Download (.tar.gz) the Linux version jprofiler on centos. Both the Windows and remote machine jprofiling agent are of the same version. If bots are not same version then it will not create with the jprofiler on Windows.
Untar the .tar.gz file.
tar xvzf folder_name
Go to /bin path.
cd folder_name/bin
Run following command to enable profiling agent to connect JVMTI data on a specific port.
./jpenable
On running the above command it gives all list of process running on the JVM. Select the process which you required for profiling. (eg. lets i have to stream 6th process out of 8 process. Then enter 6).
Select tthe GUI mode or offline mode. Enter 1. (This option does not exist on old version).
Enter the port on which you want to listen. (Eg 33668)
Now your VM is ready for connection from Windows jprofiler.
Connection setting on window jprofiler
Click on start center.
Select a new Session.
Click on attach and select “Attach to remote machine” radio button.
Set ssh tunnel from the drop down.
Slick edit button and configure the direct ssh tunneling connection.
Click next and provide the VM credential.
Manually configure the profiling port. It should be defined at the time of configuring profiling agent.
16.Click finish.
17.Select ‘ok’ button and enter the key you received through mail.
If the credential is correct, following prompt will show up. Click “configure” button. Select “CPU data”, “Call tracer” and “allocation stack” check box. Click ok.
Click ‘ok’ button. Congratulation !! Now your remote VM is connected with your Windows jprofiler.
for remote connect to jprofiler you can following this steps:
download linux version of jprofiler.
install it on linux system.
go to folder bin and run ./jpenable. follow the wizard for choose the process id of jvm you want to profiled. after that it give you a port number.
install the jprofiler in local machine like windows.
in start center menu choose quick attach and chose the another computer. enter the host address and port number in step "3" then you can remotely connect to jprofiler

Cygwin home directory on target system inconsistent

I am having difficulty connecting to a remote Windows system running cygwin.
When I connect from a linux box to cygwin, it connects fine and "sees" the
remote home directory as /home/userID
When I connect from Windows cygwin to the remote windows cygwin, it sees
the home directory as /cygdrive/c/Documents and Settings/UserID
Finally, when I am logged onto the remote Windows machine (the one with the problem)
home is /home/UseID but the value for cygpath -H is
$ echo $(cygpath -H)
/cygdrive/c/Documents and Settings
This seems to be causing my connection problem from windows to windows
and no problem from linux to windows
Any ideas how to fix it?
Since you have the correct path in /etc/passwd, one possibility is that perhaps the SSH client you are using from your Windows systems is sending custom environment values.
If you're using PuTTY, before connecting, look in the tree panel on the left hand side of the dialog. There should be an entry called Connection and a sub-entry called Data which will bring you to an option screen that has a section called Environment variables. Check if the HOME var is being overridden there and if so, remove it.
If you're using a different SSH client, check its configuration to see if its using the SendEnv option. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config.
Or you could try blocking off custom environments on the destination/server side by disabling AcceptEnv in the SSHd configuration on the system you're connecting to. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config.
Hope this helps.

Resources