I have a SSH address that I connect through command line, but I would like to have a GUI option to make my work easier. So is it possible to connect through ssh using remote desktop on Lubuntu 11.10? Thanks
This may be what you're looking for:
https://wiki.edubuntu.org/Lubuntu/RemoteDesktop
x11vnc server for use with Lubuntu. Download via Synaptic.
It can be run for single use from a terminal:-
x11vnc -display :0
It is more useful when run like:
x11vnc -forever -display :0
...so you can connect/disconnect/reconnect when needed.
I run it from a simple script that auto runs on startup. Create a new file called "startvnc.sh" and add this:-
#!/bin/sh x11vnc -forever -display :0
...then put it in /usr/bin (which is in the $PATH) and make it executable.
Then to autostart, in terminal:-
sudo leafpad /etc/xdg/lxsession/Lubuntu/autostart
...and add this at the end of this file:-
#startvnc.sh
You should be able to connect via almost any remote vnc client like this: {IP}::{port}
e.g. 192.168.0.7::5902
Related
I want to use my cygwin configuration for SSH ou SFTP connection but doesn't work.
My configucation file "config" is in directory C:\cygwin64\home\<username>\.ssh. This configuration file define an SSH proxy jump and send some environment variables. This configuration file work fine in cygwin to connect in SSH or SFTP.
In PhpStorm settings I've specified the shell path in Tools > Terminal to be C:\cygwin64\bin\bash.exe --login -i. All local terminal use cygwin fine. But the ssh connection don't use my configuration file. I tried copying configuration in C:\Users\<username>\.ssh directory but that does not work.
Can you help me?
Generally, creating %USERPROFILE%/.ssh/config file pointing to the actual location of keys (using a valid Windows path) should help. But PhpStorm does not support ProxyJump and ProxyCommand instructions in it because there is no support for it from OpenSSH client's Windows port and we cannot use Cygwin or MinGW OpenSSH clients, which support proxying, but require running in theirs own shell subsystem. Here's a related bug report: https://youtrack.jetbrains.com/issue/IDEA-214679
I found the solution. You need to install the latest version of OpenSSH. To achieve this, I did the following actions:
Installing the scoop package manager (https://scoop.sh/) using PowerShell
$ Set-ExecutionPolicy RemoteSigned -scope CurrentUser Answer Y
$ Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
Installing OpenSSH
$ scoop install win32-openssh
normally the installation modifies the environment variable %PATH% to add the path something like C:\Users\<username>\scoop\shims. Otherwise you have to add it.
Modification of the environment variable %PATH% to remove the path C:\Windows\System32\OpenSSH
Enable the "OpenSSH Authentication Agent" service
On keyboard press Windows + R
Type: services.msc and press Enter.
Double click on the "OpenSSH Authentication Agent" service
Select the "Automatic" start type and start the service.
After these actions, I was able to connect from the Windows cmd terminal. I tested from PhpStorm and it works too.
The Question
I'm trying to enable X11 forwarding through the PyCharm SSH Terminal which can be executed via
"Tools -> Start SSH session..."
Unfortunately, It seems there is no way of specifying the flags like I would do in my shell for enabling the X11 Forwarding:
ssh -X user#remotehost
Do you know some clever way of achieving this?
Current dirty solution
The only dirty hack I found is to open an external ssh connection with X11 forwarding and than manually update the environment variable DISPLAY.
For example I can run on my external ssh session:
vincenzo#remotehost:$ echo $DISPLAY
localhost:10.0
And than set on my PyCharm terminal:
export DISPLAY=localhost:10.0
or update the DISPLAY variable in the Run/Debug Configuration, if I want to run the program from the GUI.
However, I really don't like this solution of using an external ssh terminal and manually update the DISPLAY variable and I'm sure there's a better way of achieving this!
Any help would be much appreciated.
P.s. Making an alias like:
alias ssh='ssh -X'
in my .bashrc doesn't force PyCharm to enable X11 forwarding.
So I was able to patch up jsch and test this out and it worked great.
Using X11 forwarding
You will need to do the following to use X11 forwarding in PyCharm:
- Install an X Server if you don't already have one. On Windows this might be the VcXsrv project, on Mac OS X the XQuartz project.
- Download or compile the jsch package. See instructions for compilation below.
- Backup jsch-0.1.54.jar in your pycharm's lib folder and replace it with the patched version. Start Pycharm with a remote environment and make sure to remove any instances of the DISPLAY environment variable you might have set in the run/debug configuration.
Compilation
Here is what you need to do on a Mac OS or Linux system with Maven installed.
wget http://sourceforge.net/projects/jsch/files/jsch/0.1.54/jsch-0.1.54.zip/download
unzip download
cd jsch-0.1.54
sed -e 's|x11_forwarding=false|x11_forwarding=true|g' -e 's|xforwading=false|xforwading=true|g' -i src/main/java/com/jcraft/jsch/*.java
sed -e 's|<version>0.1.53</version>|<version>0.1.54</version>|g' -i pom.xml
mvn clean package
This will create jsch-0.1.54.jar in target folder.
Update 2020:
I found a very easy solution. It may be due to the updated PyCharm version (2020.1).
Ensure that X11Forwarding is enabled on server: In /etc/ssh/sshd_config set
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
On client (MacOS for me): In ~/.ssh/config set
ForwardX11 yes
In PyCharm deselect Include system environment variables. This resolves the issue that the DISPLAY variable gets set to the system variable.
EDIT: As seen in the below image it works. For example I used the PyTorch implementation of DeepLab and visualize sample images from PASCAL VOC:
X11 forwarding was implemented in 2021.1 for all IntelliJ-based IDEs. If it still doesn't work, please consider creating a new issue at youtrack.jetbrains.com.
By the way, the piece of advice about patching jsch won't work for any IDE newer than 2019.1.
In parallel, open MobaXTerm and connect while X11 forwarding checkbox is enabled. Now PyCharm will forward the display through MobaXTerm X11 server.
This until PyCharm add this 'simple' feature.
Also, set DISPLAY environment variable in PyCharm run configuration like this:
DISPLAY=localhost:10.0
(the right hand side should be obtained with the command echo $DISPLAY in the server side)
Update 2022: for PyCharm newer than 2022.1: Plotting in SciView works by only setting ForwardX11 yes in .ssh/config (my laptop OS is ubuntu 22.04). I did not set any other parameters either on the server or local side.
Whenever I try to connect to VM using virsh console <vm name> my screen hangs and displays:
Connected to domain <vm name>
Escape character is ^]
I have found many solutions on the internet but nothing has worked for me and I am even not able to find the /etc/init directory as CentOS 7 has a different directory structure.
I need /etc/init directory to create a script which I found on the internet as a solution.
I am using only ssh connection and no GUI and I do not have any access to the physical machine.
I think you should start a console (e.g. ttyS0 ).
For example on my Debian 8 I enable it with systemd:
systemctl enable getty#tty1.service
Enable Serial Console on CentOS/RHEL 7
On the virtual machine, add ‘console=ttyS0‘ at the end of the kernel lines in the /boot/grub2/grub.cfg file:
grubby --update-kernel=ALL --args="console=ttyS0"
Note: Alternatively, you can edit the /etc/default/grub file, add console=ttyS0 to the GRUB_CMDLINE_LINUX variable and execute
grub2-mkconfig -o /boot/grub2/grub.cfg
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial –speed115200 –unit=0 –word=8 –parity=no –stop=1"
I had the same issue right after virt-install, then after trying to connect to the guest, too. I tried all the suggested solutions but none of them helped. Then I realized that I forgot to install KVM. A simple 'yum -y install kvm' resolved the issue.
I need to run multiple Fitnesse Tests from the command line at the same time. How can I get around the Port resrtriction? Right now, I start the first .bat file to run one suite. When I try to start the second .bat file I get an error that the Port is in use. My .bat files consist of the following command.
java -jar fitnesse-standalone.jar -p 80 -c "MeasureTestSuite.COLighting?suite&format=text".
You can change the port of the wiki with the -p switch, and use -DSLIM_PORT= to control the port used by the Slim server (if you use the Slim test system):
java -DSLIM_PORT=5555 -jar fitnesse-standalone.jar -p 8080 -c MeasureTestSuite.COLighting?suite&format=text
Setting the Slim port is only needed if the runs really start concurrently, not when there is a couple of seconds between the execution of the commands (FitNesse tries to find a free port, but does this a bit awkwardly).
P.S. The next release of FitNesse will no longer require manual configuration of the Slim port for concurrent runs, IF Slim is run in-process (i.e. DEBUG mode). So, for instance, you can have multiple concurrent test runs by a build server using the jUnit integration (which already removes the need to select a wiki port) without having to worry about ports at all.
You can change the port with the -p switch:
java -jar fitnesse-standalone.jar -p 8080 -c MeasureTestSuite.COLighting?suite&format=text"
I have a server that I am experimenting with, and sometimes I want to work from home so I installed the 'ssh daemon' (namely, 'sshd') and I can ssh to the server. This works fine. But when I try to run a virtual machine on the server with 'qemu', I get the following error Could not initialize SDL(No available video device) - exiting.
Is it possible to run qemu via ssh connection?
Note, I do not want to see the visual interface to the VM that I'm launching. I just want to to run.
Try qemu -curses
or qemu -nographic
to bypass the SDL
Best way to resolve this is to add -X to your ssh parameters.
e.g. ssh -X user#server
This will allow the window created by QEMU to be X-Forwarded through SSH to you. It doesn't matter if you want to view the window or not, if QEMU can't open it, it will consider it a fatal error and you will get the error you described.
You can disable the video card:
qemu -vga none (...options...)
You could also pipe the screen to VNC instead of SDL - the following will provide a VNC server on port 5901:
qemu -vnc :1 (...options...)
qemu-system-i386 -curses works like charm..
And to exit from that, use ESC + 2 then q + ENTER.
I had this problem too.
I think bitwise can't open a new terminal window like qemu does.
You can write make clean qemu-nox in terminal, instead of just make clean qemu and it will launch it in the same window.
This worked for me