Monday, June 1, 2015

Connect in graphical mode to remote linux server from Cygwin/X

Connect in graphical mode to remote linux server from Cygwin/X 
(and from windows terminal services client and vncviewer clients)


A very simple and basic howto
(last updated on jun 2 2015) 

 
Environment:
Windows "client" with a local installation of cygwin/X (download from cygwin.com).
Remote linux server, with graphical display capability.

Basic application access
  1. on remote linux, you need to have the "X11Forwarding yes" line in /etc/ssh/ssd_config
  2. run cygwin64 terminal on workstation, from there launch "startx"
  3. open a local terminal in the Cygwin/X:0.0 window (right click, open terminal here). From the terminal, the command "set | grep DISPLAY" should show DISPLAY=:0.0 (these 0.0 represent the display number and the visual number)
  4. from the terminal, run "ssh -Y user@remotelinux-address" and insert password. You should now get to the remote system in the same terminal window.
  5. from the terminal window, run "xterm", or any other graphical application. After a moment you should see the window come up.

Connection to main graphical login screen (to properly see complete desktop)
This setup requires proper configuration of XDMCP (X display Manager Control Protocol)
  1. On the remote linux you need to run a display manager that talks xdmcp. I was successful using xdm or gdm3. (for gdm3, on kali linux, I had to set enable=true in the [xdmcp] section of /etc/gdm3/daemon.conf)
  2. From windows cygwin command prompt run xlaunch (do not run startx), then choose open session via XDMCP. this sends some UDP datagrams to port 177 of linux server, after a while, traffic starts flowing in towards local workstation tcp port 6000 (X traffic). You need to have quite an open routing between the workstation and the remote server in order for this traffic to work. A non working symptom is that you just see a black window on your workstation screen.
  3. With these steps I had the keyboard perfectly working in the graphical terminal, and cut and paste to and from the graphical terminal is working well, even with non-ascii accented characters.


My configuration: 
Workstation: Windows 8.1 64 bit english
Remote linux: kali linux 1.1.0

references:
http://x.cygwin.com/docs/faq/cygwin-x-faq.html



Other remote graphical options:
the following options do not require the cygwin/X environment, but just a simple graphical bitmap client.

- xrdp: remote desktop protocol
  1. install xrdp on remote linux server 
  2. in remote linux server, start the xrdp service with "service xrdp start" (this starts the listener on the tcp:3389 port)
  3. from windows workstation, run mstsc (remote desktop connection), and login on the graphical page you will get. This will allow graphical login and full remote desktop visibility, with menu and applications

- xvncserver / vnc4server: virtual network computer
  1. install vnc4server on remote linux server
  2. launch vnc4server on remote linux server from a terminal session, define graphic resolution and define a password, and take note of the port identifier assigned to the new session listener. be it n. This starts the listener on tcp port 5900+n
  3. from windows workstation, launch vncviewer client and direct it to open a session on the linux server host, on the destination tcp port 5900+n. If n=1 then it is 5901
  4. when done, remember to kill the vnc4server with "vnc4server -kill :n"




Monday, February 23, 2015

Thinkpad T540p hissing noise in windows 8.1 64bit



Lenovo Thinkpad T540p/T440s/W540 loudspeaker constant hissing noise in Windows 8.1 64bit

last update 2015.feb.24


I recently got a Lenovo Thinkpad T540p to replace my old Lenovo Thinkpad T510 that after 5 years of service, was starting to be too old and slowish.

It is always the case, when we need to get used to new tools, that in the first period we still love more the old and worn out ones. It was indeed. Now, after a few weeks, it is getting better. My T510 was really well engineered.

Yesterday I solved an issue that was quite annoying.

My Thinkpad laptop T540p, in Windows 8.1 64 bits, produced a constant hiss from the right side loudspeaker. This sound was not loud, but very clearly audible when I use the notebook in my bedroom desk, in the evening silence.

There is a thread on the Lenovo thinkpad forum where many people complain about this problem, impacting at least Thinkpad T440s, Thinkpad T540p, Thinkpad W540

My understanding is that it affects all owners of these machines.
Lenovo, despite some declarations, was not releasing any official statement, and some people were very disappointed, because these laptops are quite expensive (my one was costing about 1700euros) and such problems are not to be expected on high end products.

I did my personal analysis, and noticed that I dont suffer the problem when booting in Ubuntu Linux.
Also I noticed that the hissing sound became louder and lasted for about 5 seconds just after any short sound was played thru the loudspeakers (like windows error sound).
Unwanted noise was there all the time, independently from loudspeakers volume, and always disappeared only when muting audio thru the Fn/F1 key.
Noise was also independent from power cord connected or not, and from battery power level.
Fiddling with advanced sound properties, like equalizer, dolby, etc did not produce any effect.

The Windows 8.1 OS that was available on the accompanying CDs was installing some Realtek High Definition Audio drivers that in my case were (maybe after some updates) at the 6.0.7188 level (mar 4, 2014)
Release check can be done via device manager, then selecting audio devices, then Realtek.


The main component of the Realtek audio driver is the file  RTKWHDA.SYS The release number shown in audio properties windows comes from this file.

Despite Lenovo update tool is not offering any new related download, but on Realtek website ( http://www.realtek.com.tw/downloads/downloadsCheck.aspx?Langid=1&PNid=24&PFid=24&Level=4&Conn=3&DownTypeID=3&GetDown=false#High%20Definition%20Audio%20Codecs ), an update is available, bringing RTKWHDA.SYS to 6.0.1.7246 (did this on feb 22.2015 - check the readme pdf)


After downloading and updating the driver for my Windows 8.1 x64 operating system, and going thru a couple of reboot, the problem disappeared.

----
Edit feb 23 2015: the problem is greatly reduced but did not disappear completely:
Play some sound (a song) with windows media player. Stop the playback, the noise can now be heard. Close media player: the noise goes away after about 6 seconds.




@mgua


.