Remote debugging .net core 2.0 console app over ssh - visual-studio-2017

I am building a .net core 2.0 console app on windows 10 but I want to debug it on a remote linux server running debian 9.
I found this article:
https://blogs.msdn.microsoft.com/devops/2017/01/26/debugging-net-core-on-unix-over-ssh/
but where I get stuck is selecting the SSH connection. My remote server has authentication and if I enter the user#ip:port it doesn't find anything.
I found some mention of using SSH tunnelling but as there is no dotnet process listening on the server (it's installed but it doesn't have any listening service running I can see) I am unsure exactly what port I'm meant to be tunnelling or even which direction to tunnel it.
What do I need to do to get my SSH connection visible in the debugger?

I just tried this and I found that the Find.. button doesn't do anything either.
First you enable SSH connections in your Linux host (in my case, Ubuntu, I had to run sudo ufw allow ssh). Test things out by opening cmd on Windows and doing ssh user#host.
Then, on Visual Studio, in the SSH attach to process window, make sure you hit "refresh" and check the "show processes from all users" box. You should see the "dotnet" process running.
EDIT: you should be prompted for the remote host's password at some point. Here's the dialog shown when I changed the password on the remote host and then attempted to debug.

Related

Access GCP Debian VM in GUI mode

** I am not a Linux expert.
I have spun a Debian 10 VM in GCP which i need to access like in a GUI mode and be able to download and install some required applications for development and experiment purposes.
I think i have installed xrdp, display GUI packages, firefox, apache2 etc, but not able to land into GUI mode or browser mode.
1- I can't invoke/run firefox with "Display" error - Error: no DISPLAY environment variable specified
2- RDP from my local laptop also being refused with "connection refused" error.
Need some help.

Google Cloud virtual instance: Chrome remote desktop indicates remote computer is offline, however Google Cloud Platform shows instance is running

I am running a virtual machine in Google Cloud. I have installed the default Debian OS, and configured the desktop environment for remote connection, as explained here: https://cloud.google.com/solutions/chrome-desktop-remote-on-compute-engine
I have been able to connect to the instance via Chrome Remote Desktop, however periodically I have the problem that the Remote Desktop says the vm instance is online, however if I try to connect to it I get:
Looking at the Google Cloud console, the instance is clearly running. Normally if I restart the instance the problem is solved, however I have processes running on the instance that I do not want to stop.
UPDATE:
Following the advice from Serhii Rohoza I ran
sudo systemctl status chrome-remote-desktop
The status looked normal, listing:
Active: active (exited) since...
I then ran
sudo systemctl restart chrome-remote-desktop
and this solved the problem, I could log into remote desktop again, but it seemed the VM instance had restarted, which is a big problem since I am running processes on it that should not shut down. I guess this is a problem to send to Google Cloud Services support.
UPDATE 2:
I'm still running into this problem. I normally have a Jupyter Notebook running on the VM - this Notebook must keep running. When I saw the message saying that the remote computer is offline, I logged in via ssh and checked if the Jupyter Notebook is running:
jupyter notebook list
This returned:
http://localhost:8888/?token=9110bf40789971b5e252a272e9497039b4f3b45e506348df :: /home/qgenixtech
So the Notebook was running. I then ran:
sudo systemctl restart chrome-remote-desktop
and after that again:
jupyter notebook list
and then it shows no Notebooks running. So the restart command closed down the Notebook (and also all other open windows on the desktop).
UPDATE 3:
I spoke to a support technician at Google. The problem is on the Remote Desktop side, not the virtual machine. According to the technician this is a known problem, by he didn't have a solution for it. He referred me to these two links from Google Support:
https://support.google.com/chrome/thread/10213547?hl=en
https://support.google.com/chrome/thread/3333421?hl=en
The next option for me is to look at something like X2go
To solve your issue you should follow documentation Troubleshooting and check status of the Chrome Remote Desktop service with command:
sudo systemctl status chrome-remote-desktop
and check log messages at /tmp/chrome_remote_desktop_DATE_TIME_*.
To investigate why your VM instance was restarted you should look for some clues at the logs:
Go to Compute Engine -> VM instances -> click on NAME_OF_YOUR_VM -> find section Logs -> click on Stackdriver Logging. More information you can find in the documentation Viewing logs (Classic)
Go to Compute Engine -> VM instances -> click on NAME_OF_YOUR_VM -> find section Logs -> click on Serial port 1 (console). More information in the documentation Viewing Serial Port Output
You can contact with Google Cloud Support as well.
In addition, have a look at the documentation Setting instance availability policies.
same issue. when checking logs i see:
2021-01-05 14:29:38,319:INFO:Starting Xvfb on display :20
xdpyinfo: unable to open display ":20".
2021-01-05 14:29:40,837:INFO:X server is active.
restarting service or even VM doesn't work.
i need to delete connection on "client" and re-auth with /headless link

How to set a remote django develop environment?

I have to set a development environment on a ubuntu machine(16.04).
It's django+postgresql+Nginx, I.think I could install all these things together on that machine,but I totally don't have any idea about how to connect it by using pycharm running on my pc, and how to manipulate the database.
Is there anyone could tell me how to connect it. This is the first time I have to use a remote machine.
By the way, my pc and ubuntu machine are in the same LAN, but there is another person who were asked to write db are not.
I hope I could get some suggestions from the community.
One of the best and common way is to use SSH.
Here you can find an official guide on how to enable SSH server on Ubuntu 16.04
You can use Putty to connect from Windows PC to your SSH server or if you're using Mac or Linux, there should be already installed SSH client. So, just ssh username#servername
Use SSH. Assuming you're on Linux, open a terminal and type:
ssh username#local-ip-address-of-machine
and then type your password when prompted. Your terminal window essentially acts as a terminal on your remote machine. From here, I suggest you research Docker in order to set up a custom environment for your Django project. I have only told you how to connect since that's your question, and there are plenty of tutorials on setting up Django and Docker. If the other person wants to connect, you will need to port forward on your router port 22 on the local IP of the machine.
If you haven't got SSH set up, this page tells you how.

Unable to connect remotely from other devices + Vorlon

Vorlon dashboard is not showing all connected devices.
I have desktop and installed a Vorlon, I am using localhost of this desktop from laptop or ipad its displays webpage but it is not showing devices in vorlon, but it show if i open from the same desktop.
I was my bad. I am using localhost:1337 to load vorlon.js. We have to use ip address instead of localhost from other machine
There can be a few different problems at play here.
First you need to find the IP address of the computer that is hosting your application/site i.e. 192.168.10.4.
start vorlon
c:/> vorlon -v
start webserver, ensure you use the same IP address found above
c:/>python web2py.py --i 192.168.10.4 -p 8000
add script tag for vorlon
Both python and nodejs have to be allowed through the firewall, so next add rules for both the python executable you are using (which could be a virtualenv) and nodejs.
Finally you need to ensure that there are no other firewall rules that match the ports or applications you use, this is critical as I had a conflicting firewall rule for nodejs that was blocking the connection to nodejs and hence the script /vorlon.js cannot be found.
Hope this helps.

Running Python GUI apps on C9.io

Does anyone know if it is possible to run python-gui apps, like wxPython, on a c9.io remote server? I have my home server set up with c9 via SSH, and no issues logging in and running apps in the terminal on the VM. However, when I try to run GUI apps, I get the following error message.
Unable to access the X Display, is $DISPLAY set properly?
After searching and searching, I can't seem to find a guide or anything in the docs that detail how to set $DISPLAY in the script. X display is installed and active on my server, but I don't know how to configure the c9 script to access it properly. Any assistance would be appreciated!
I don't know if Cloud9 supports it but normally to run a remote GUI application you would have ssh forward the X11 communication over the ssh connection via a tunnel. So basically the application is running on the remote system and it is communicating with a local X11 server which provides you with the display and handling of the mouse and keyboard.
If you run ssh with the -X parameter then it will attempt to set up the X11 tunnel and set $DISPLAY in the remote shell so any GUI applications you run there will know how to connect to the X11 tunnel. Bw aware however that this is something that can be turned off on the remote end, so ultimately it is up to Cloud9 whether they will allow you to do this.