hongy19’s blog

remote desktop on linux


  • xrdp
  • this one seems only work for Xwindows, not wayland.
  • Wayland
  • Not all wayland application support RDP, some only support VNC.
  • sway doesn’t support rdp but only vnc, see link.
  • On the target linux device, install freerdp and weston
  • pacman -S freerdp
  • pacman -S weston
  • On the target linux device, generate RDP certificates
  • sudo mkdir -p /etc/freerdp/keys/
  • sudo winpr-makecert -rdp -path /etc/freerdp/keys/
  • On the target linux device, start weston
  • weston –backend=rdp-backend.so –rdp-tls-cert=/etc/freerdp/keys/server.crt –rdp-tls-key=/etc/freerdp/keys/server.key
  • On the windows side, start “Remote Desktop Connection” and fill in targe linux server ip.
  • waypipe, see link.
  • installed waypipe on both the local and remote computers
  • yay -Y waypipe
  • run waypipe on local linux/wsl
  • waypipe ssh user@theserver weston-terminal
Read more ⟶

clash


  • clash (link) 可以在linux/windows/Android上使用。它通过定义proxy group and rule来实现基于rule的traffic分发。简单的说,proxy group是proxy的集合,并可以通过type来定义怎么从一组proxy中找到一个proxy用于traffic proxy。rule就是根据ip/url把traffic mapping到不同的proxy group.
  • clash configuration file is config.yaml. 各种机场需要提高相应的config.yaml for proxy group and rule.
  • 用wget下载bywa机场的订阅链接,得到的是base64 encode的ss serverlist,不是clash config.yaml。可以通过"curl -H “User-Agent: ClashForAndroid/2.0.0” “得到clash config.yaml,详见link
  • 或者使用订阅转换服务,将其它订阅转换为 Clash 订阅。
  • web interface
  • update config.yaml
  • external-controller: :9090
  • # A relative path to the configuration directory or an absolute path to a
  • # directory in which you put some static web resource. Clash core will then
  • #**serve it at http://{{external-controller}}/ui**.
  • external-ui: ui
  • get clash-dashboard
  • visit 192.168.1.4:9090/ui for control
  • clt control interface
  • good guideline: link
Read more ⟶

X11 forwarding


 I tried to ssh to linux server (Archlinux) from wsl2 and run X-windows application on wsls. Here comes summary

  • wsl2 support wslg by default, see link. You could close it by setting “guiApplications=false” in  .wslconfig  on windows side
  • on linux server side
  • enable “X11Forwarding yes " in /etc/ssh/sshd_config” and restart sshd.
  • install xauth by “pacman -S xorg-xauth”
  • on wsl2 side
  • enable “ForwardX11 yes” and “ForwardX11Trusted yes” on .ssh/config
  • no need to install xauth on wsl2 side
  • DISPLAY variable
  • host:display[.screen], for example: localhost:10.0
  • see linkfor detail
  • answer from kenorb at linkgives a good summary.

At beginning, I always fail since I use “ssh -X linux-server” but actually I should use “ssh -Y linux-server”. -X is untrust X11 forwarding and  -Y is trust X11 forwarding. untrust X11 forwarding need X server support and I guess wsl2 doesn’t support it. See detail onlink1, link2.* from link1, “Untrusted X11 forwarding was meant to be a way to allow logins to unknown or insecure systems.  It generates a cookie with xauth and uses the Security extension to limit what the remote client is allowed to do. But this is widely considered to be not useful, because the Security extension uses an arbitrary and limited access control policy, which results in a lot of applications not working correctly and what is really a false sense of security.”

Read more ⟶