create a link to chrome inside WSL. this will only run after Creators Update
echo '#!/bin/bash
cd /mnt/c
exec "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe" "$@"
' > /usr/local/bin/chrome
chmod a+x /usr/local/bin/chrome
create server keys:
cd /etc/ssh
ssh-keygen -A
rm -f *.pub
vi sshd_config
edit this, save.
Port 22
ListenAddress ::
ListenAddress 0.0.0.0
start sshd:
/usr/sbin/sshd
save this file to /usr/local/bin/chrome.
#!/bin/bash
if [[ "$*" =~ "127.0.0.1" ]] || [[ "$*" =~ "localhost" ]] ; then
ARGS=()
HOST=$(hostname)
for i in "$@"; do
ARGS+=(\
$(echo "$i" | sed "s/^127.0.0.1$/$HOST/g;s/^localhost$/$HOST/g" )
)
done
else
ARGS=("$@")
fi
/usr/local/bin/remote-open /usr/local/bin/chrome "${ARGS[@]}"
RUN:
echo -e '#!/bin/bash\n\nssh -i ~/.ssh/gongt.me-home $SSH_CLIENT_IP "$@"' > /usr/local/bin/remote-open
chmod a+x /usr/local/bin/remote-open /usr/local/bin/chrome
($SSH_CLIENT_IP comes from linux tool box)