2

I am trying to connect to a remote ubuntu server running TigerVNC servers. I can login through PuTTy to the machine fine and CLI is working great. However, I do run some applications that require a GUI, so I'm trying to get the remote GUI visible on my local computer. Linux users are able to run the following script to SSH tunnel the VNC through to their local machines, and everything is working fine:

#/bin/bash
# X == the X11 display number for VNC server
ssh -f -L 5901:localhost:590X username@remote.name.here sleep 1
vncviewer Quality=Medium FullScreen=1 UserName=FOO_BAR localhost:1

However, I don't have a local linux machine, but a Windows 10 machine. Unfortunately the TigerVNC Windows viewer is unmaintained and doesn't work on my machine. So I figured I could use WSL (my Windows is up to date, so I assume that means WSL2, but I did first install WSL 3 years ago) to emulate a linux machine on my Windows, but things aren't working successfully. If someone could help me figure out how to make this happen, I'd appreciate it tremendously.

I've tried (1) installing VcXsrv on my machine. I believe this requires me to add

DISPLAY=:0.0
export DISPLAY

to my ~/.bashrc in WSL. Then I (2) run VcXsrv in fullscreen mode where it doesn't start a client, and then (3) run the aforementioned script in WSL, but in my VcXsrv window, a pop up appears saying "This connection is not secure" and asks for a password. Which password is this supposed to be? Regardless, all my passwords for this setup are the same (security risk, I know), so I'm able to get past this step and I arrive (4) on what appears to be a GUI Linux sign-in page. While I can click around, I can't actually type in anything (namely: a password for the login page), so I can't confirm what machine this is or what is going on. Has this occurred to anyone else or am I doing something wrong here?

Alternatively, if someone has any alternatives to this VcXsrv setup, I'm all ears. This isn't exactly the most stable setup I've used before (RealVNC used to work fine, but we don't pay for it anymore). Thanks for any help.

1 Answers1

1

I was able to solve this with 2 slight modifications to the above described method. In (1), I actually have to set DISPLAY=localhost:0.0 as per this stackexchange link. I also have to load VcXsrv in fullscreen mode where I choose "Start a program" instead of not starting any client. I've been choosing "start local xclock" just as a way to debug it, but when I run the ssh bash script, it overwrites xclock with the VNC anyway, so I don't think my choice of program is important.

I believe the password for the login page requested is the TigerVNC password, but I don't have any definite proof of this still.

I can now successfully type in the X window loaded from within WSL and GUI applications seem to be working. This is the most jerry rigged setup I've ever used to date, but at least it works and it's all with FOSS, so it should be dependable for years to come. Hope this helped anyone else out there who was struggling similarly to me! I won't accept this as an answer because I feel like there must be a better way to do this. So if you have an alternative solution, I'm still quite interested.