8

windows 远程 archlinux + i3wm 最佳实践?

 2 years ago
source link: https://www.v2ex.com/t/867916
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

公司不让用虚拟机,要用 windows + 安全管理软件 ,但可以 申请 远程 虚拟机环境 ,我平时都是用 i3wm+ archlinux 开发 ,i3wm 切换程序 窗口很方便 ,所以想到 用 本机 win+ 远程 虚拟机 archlinux 的 开发模式

alacritty , xkeysnail , webstorm , goland ,chrome 等等

xkeysnail 是用来映射按键的 ,好让我盲打 编程中常用的符号,现在 已经离不开了,具体可以看 V2EX 如何打符号的帖子

i3wm 配置

i3wm 基本没有配置 就配置了 个 i3 status bar ,改了 快捷键 也没有装 sddm 登录软件 ,目前 arch 的启动流程是

  1. 进入命令行页面 ,输入 startx ,进入 i3wm 桌面环境
  2. 启动 alacritty ,chrome 等软件 ,在 alacritty 中 启动 xkeysnail 使用 自定义的 按键 映射 来快速打符号

远程软件安装

安装 了 xrdp tigervnc 两个软件 ,然后 启动 xrdp 服务

在 windows 下 打开 mstsc , 输入 linux 的 ip , 会进入一个 蓝色 的背景页面

会有 session , username ,和 password 三个 表格 字段

session 有 xorg , xvnc ,vnc-any , neutrinordp-any 4 个选项

其中 使用 xorg 选项 输入 用户名密码后 , 就还是一样的蓝背景 ,过一会 说 连接拒绝之类的 ,无法 远程

选择 xvnc 选项,输入用户名密码后, 可以 进 远程 的 i3wm 桌面

选择 vnc-any 和 neutrinordp-any 后 ,都提示要 输入 ip port 和 密码 ,但是我看 对应的端口号 我应该是没有起来 ,所以 输入了 也是黑屏 ,这两个方法 先放弃

使用 xvnc 的方式 远程连接 i3wm 遇到的问题

使用 xvnc 方式 远程连接 i3wm 后 ,正常的 webstorm , chrome 软件 都能打开 ,但是 alacritty 却打不开了 ,还好我还有别的 terminal 备用 , 我打开 了 cool-retro-term 终端 然后输入 alacritty

$ alacritty
thread 'main' panicked at 'Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: XOpenDisplayFailed', /build/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:619:9 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

然后 我又尝试启动 xkeysnail 按键 映射软件 ,也无法打开 ,报错为

Traceback (most recent call last): [8/4707] File "/usr/lib/python3.10/site-packages/Xlib/support/unix_connect.py", line 119, in get_socket
s = _get_unix_socket(address)
File "/usr/lib/python3.10/site-packages/Xlib/support/unix_connect.py", line 98, in _get_unix_socket
s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/Xlib/support/unix_connect.py", line 123, in get_socket s = _get_tcp_socket(host, dno) File "/usr/lib/python3.10/site-packages/Xlib/support/unix_connect.py", line 93, in _get_tcp_socket s.connect((host, 6000 + dno)) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/xkeysnail", line 6, in <module> cli_main() File "/usr/lib/python3.10/site-packages/xkeysnail/init.py", line 62, in cli_main eval_file(args.config) File "/usr/lib/python3.10/site-packages/xkeysnail/init.py", line 6, in eval_file exec(compile(file.read(), path, 'exec'), globals()) File ".config.py", line 4, in <module> from xkeysnail.transform import * File "/usr/lib/python3.10/site-packages/xkeysnail/transform.py", line 16, in <module> def get_active_window_wm_class(display=Xlib.display.Display()): File "/usr/lib/python3.10/site-packages/Xlib/display.py", line 89, in init self.display = _BaseDisplay(display) File "/usr/lib/python3.10/site-packages/Xlib/display.py", line 71, in init protocol_display.Display.init(self, *args, **keys) File "/usr/lib/python3.10/site-packages/Xlib/protocol/display.py", line 89, in init self.socket = connect.get_socket(name, protocol, host, displayno)

File "/usr/lib/python3.10/site-packages/Xlib/support/connect.py", line 87, in get_socket return mod.get_socket(dname, protocol, host, dno) File "/usr/lib/python3.10/site-packages/Xlib/support/unix_connect.py", line 127, in get_socket raise error.DisplayConnectionError(dname, str(val)) Xlib.error.DisplayConnectionError: Can't connect to display ":0": [Errno 111] Connection refused

问题原因猜测

alacritty 和 xkeysnail 在正常的 linux + i3wm 都能打开的

远程 使用 xvnc 的方式 却打不开 ,感觉是 因为 xserver 的环境 变了么 ?

  1. 现在大家都是怎么用 win 远程 i3wm 桌面环境 的呢 ? 需要安装哪些软件
  2. 有在 远程环境下 启动 xkeysnail 和 alacritty 成功的么 ?或者 说 这两个软件 限制如此 ,那么 ,linux 下还有没有其他 按键映射软件 是能在 远程环境下 能 正常工作的 ?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK