• Stars
    star
    297
  • Rank 140,075 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WSL Daemon - Stable X11 connection and time synchronisation for WSL2

WSLD: WSL Daemon

CI

Persist X11 connection when network changes or PC resumes from disconencted sleep/hibernation, and keep your WSL time in sync.

Formerly called x11-over-vsock; renamed to wsld as it gained extra functionality.

Implementation detail can be found here.

Build

This program is written in Rust. If you do not have Rust toolchain installed you can get it from https://rustup.rs/. Building on Windows also requires Visual C++ toolchain.

Install in WSL using cargo install --locked --git https://github.com/nbdd0121/wsld wsld and install in Windows using cargo install --locked --git https://github.com/nbdd0121/wsld wsldhost (The binary will be installed to ~/.cargo/bin/wsld and %USERPROFILE%\.cargo\bin\wsldhost.exe).

You can also download pre-built binaries from releases, which are automatically compiled using GitHub Actions.

Usage

In WSL, you will need to put config file .wsld.toml in your home directory. It should look like this:

# Leave out this section to disable X11 forwarding
[x11]
# X11 display number to listen *inside* WSL. The X server in Windows can specified as argument when running wsldhost.exe.
# Default to 0, can be omitted.
display = 0
# Whether to override existing X11 sockets. If your setup does not clean up /tmp automatically, then you probably want to set this to true.
# Default to false.
force = true

# Leave out this section to disable time synchronisation
# If you need time synchronisation, you should either run wsld with root, or give it `cap_sys_time` capability using `sudo setcap cap_sys_time+eip <PATH to wsld>`.
[time]
# Interval between syncs
# Default to 10min, can be omitted
interval = "1hr"

# Leave out this section to disable TCP port forwarding
# This feature is experimental, feedbacks and suggestions welcome.
# This feature will WSL localhost to Windows localhost, so you can connect
# servers running in Windows in WSL. This feature requires interaction with
# iptables, so you need to either run wsld as root or allow wsld to use sudo.
[tcp_forward]
# iptables command to use. nftables seem not to work so you need to have
# the legacy one. If you are not using Debian it is likely you need to change it.
iptables_cmd = "sudo iptables-legacy"
# Ports to forward
ports = [ 1234 ]

# Leave out this section to disable SSH agent forwarding
[ssh_agent]
# Default to the path below, can be omitted if unchanged
# Set `SSH_AUTH_SOCK` to the path you specified.
ssh_auth_sock = "/tmp/.wsld/ssh_auth_sock"

then run wsld and set DISPLAY=:0.

In Windows, start a X server (e.g. VcXsrv) on TCP port 6000, and execute wsldhost.exe --daemon with administrator privilege. To know why administrator privilege is needed, check out implementation detail. If your X server runs on a different port, you can add --display localhost:<port> to arguments.

To automatically start both services without manual intervention, see here.

More Repositories

1

unwinding

Stack unwinding library in Rust
Rust
98
star
2

r2vm

Rust RISC-V Virtual Machine
Rust
84
star
3

stackful

Free conversion between async and sync in Rust
Assembly
51
star
4

MW-FlowThread

A commenting system for MediaWiki
PHP
37
star
5

nfq-rs

Rust library for dealing with NetFilter queue
Rust
28
star
6

MW-Avatar

Yet another avatar architecture for MediaWiki
PHP
14
star
7

TLBSim

Fast TLB simulator for RISC-V systems
C++
13
star
8

MW-PinyinSort

Provide pinyin collation for category sorting for MediaWiki
PHP
10
star
9

GenerationalGC

Precise Generational Garbage Collector For C++
C++
8
star
10

ELFSharedLibrary

ELF Shared Library Loader
C
8
star
11

OpenIP

Open source IP collection
SystemVerilog
7
star
12

muntjac-soc

SoC for muntjac
SystemVerilog
7
star
13

sdhci

Open-source SD host controller interface
SystemVerilog
6
star
14

riscv-dbt

A RISC-V to AMD64 dynamic binary translator.
C++
5
star
15

es-error-stack

ECMAScript Error Stacktrace Proposal
HTML
5
star
16

softfp

Software floating point operation library
Rust
5
star
17

sv-elaborator

A SystemVerilog elaborator
Rust
5
star
18

InterCoreBench

Intercore performance benchmark
Rust
4
star
19

AMLInterpreter

C++ based AML(ACPI Machine Language) interpreter
C++
4
star
20

DeltaDB

A delta-based blob storage system
JavaScript
3
star
21

vyatta-tayga

TAYGA port for VyOS/EdgeOS
Makefile
3
star
22

rust-os-barebone

Assembly
3
star
23

pin-init

Safe pinned-initialization in Rust
Rust
3
star
24

PreciseGC

Precise Mark-Compact GC
C
2
star
25

node-style-guide-chinese

Translation of https://github.com/felixge/node-style-guide
2
star
26

edgeos-patch

A simple patch to make EdgeOS better.
Perl
2
star
27

NorlitOS

32 bit OS projects in progress before 2014. Now deprecated, and this repository is used as an archive.
C
2
star
28

display_controller

Open-source Display Controller
SystemVerilog
1
star
29

norlit-libc

C11 conforming libc from scratch
C
1
star
30

NorlitIRInfrastructure

A Compiler Infrastructure
Java
1
star
31

field-projection

Field projection experiment
Rust
1
star
32

lowrisc-videox

Video accelerator for lowRISC SoC
SystemVerilog
1
star
33

SakiOS

Saki Operating System Project
C
1
star
34

AppMover

Move installed application by brute-force replacing registry entries and shortcuts
C#
1
star
35

ntp-client

A simple NTP client implemented in Java, for Distributed Systems course
Java
1
star
36

NodokaJS

A new started JS project using bytecode
C++
1
star
37

SATVocab

A web app help to recite sat vocab
JavaScript
1
star
38

MW-DeltaDB

MediaWiki extension to allow DeltaDB to be used as the text storage
PHP
1
star
39

JS-Text-Preprocessor

JavaScript Text Preprocessing Tool / Servlet Page Server
JavaScript
1
star
40

Encoding

Implementation of whatwg's Encoding specification
JavaScript
1
star