ssh - How to do X11 forwarding to a virtual machine running on a remote linux host? -


i running virtual machine on remote linux host:

my machine -> linux host -> virtual machine running on linux host

i have x11 forwarding enabled on linux host, , on virtual machine. trying run jvisualvm on virtual machine on own machine launched using ssh command (with ssh -x).

the ssh command i'm using is:

ssh -x -t root@linux_host -l 29998:localhost:29999 ssh -x -t -i /root/.ssh/my_key user@virtual_machine -l 29999:localhost:9999 

once i'm connected set display variable with:

display=<my machine's ip address>:0.0 

then run jvisualvm this, expecting window open on own machine:

/usr/java/jdk1.7.0_95/bin/jvisualvm -cp:a /opt/jboss/bin/client/jboss-cli-client.jar --jdkhome /usr/java/jdk1.7.0_95/ 

but either error display not set, or jvisual exits after few seconds error code of 2.

since you're using ssh -x you're apparently expecting use secure x forwarding ssh. in case, ssh sould set display variable , should not override setting display manually. if display not being set ssh, means ssh server setup has x forwarding disabled (for whatever reason), , should fix if @ possible.

if don't want (or can't) use ssh x forwarding, can use direct connection (by setting display doing), need open x server on machine remote connections. xhost on local machine:

xhost <linux host address> 

note however, opens local machine acces linux host, or can spoof host address (which means everywhere, unless , linux machine inside firewall), not idea.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -