Sunday, January 16, 2011

How to set up X11 Forwarding on Ubuntu Server

Hi Folks,


This is a trick that i've used before and forget to add here. Sometimes you need to run a wireshark within a server which has no GUI. X11 forwarding is here for rescue. To able to forward your X11, follow the instruction below.


1) Let's install wireshark first with "apt-get install wireshark". This will install wireshark and its all dependences to your Ubuntu server.
2) Let's change sshd for X11 forwarding,


To do that,


vi /etc/ssh/sshd_config


and change following,



X11Forwarding yes
X11DisplayOffset 10


3) Let's configure X server on your Ubuntu server so it can serve X11 to your Windows machine.


 To do that you will need to use xhost to configure it.


Consider your Ubuntu server has 192.168.1.2 and your Windows machine which we will install XMing client to get X11 streaming has 192.168.1.3.



set DISPLAY=192.168.1.2:0
xhost +192.168.1.3
export DISPLAY=192.168.1.2:0



Therefore we allow 192.168.1.3 to get X11 forwarding from 192.168.1.2:0


4) In putty you should set X11 Forwarding true, which can be found in Connection/SSH/X11 click X11 Forwarding every time you would like to conect with X11 abilities.
5) Install XMing to your windows machine (Nothing tricky about it)
6) Run wireshark from Ubuntu shell from X11 forwarding enabled putty.


That's all, if everthing is ok you should be able to see wirehark opening in your windows machine.


Cheers


I hope you find it useful


Typhoon Master



2 comments: