问题解决了。
- 感谢 _geph 的提示,即自己编译迷雾通。
- 运行
sudo geph4-client
就能使用全局 VPN 。
目标是在 wsl2 中使用迷雾通的全局 vpn 功能,这样才能用 openAI api 。。。
第一个问题是:在 windows 中开启迷雾通后,wsl 无法 ping 百度。询问 chatgpt ,修改 /etc/resolv.conf
为
nameserver 8.8.8.8
nameserver 8.8.4.4
然后可以 ping 百度。
第二个问题是 dbus 。
运行 flatpak run io.geph.GephGui
得到:
error: Could not connect: No such file or directory
根据 网页 ,运行
sudo mkdir /run/dbus
sudo dbus-daemon --system
然后可以运行,报错:
Jun 04 18:20:58.660 DEBUG agent_thread{id=0}: isahc::agent: agent took 2.427184ms to start up
(gephgui-wry:2): Gdk-WARNING **: 18:20:58.667: Settings portal not found: Error spawning command line “dbus-launch --autolaunch=6c6769cbb94f53376685f6ca63df8967 --binary-syntax --close-stderr”: Child process exited with code 1
(gephgui-wry:2): libappindicator-WARNING **: 18:20:58.806: Unable to get the session bus: Error spawning command line “dbus-launch --autolaunch=6c6769cbb94f53376685f6ca63df8967 --binary-syntax --close-stderr”: Child process exited with code 1
(gephgui-wry:2): LIBDBUSMENU-GLIB-WARNING **: 18:20:58.806: Unable to get session bus: Error spawning command line “dbus-launch --autolaunch=6c6769cbb94f53376685f6ca63df8967 --binary-syntax --close-stderr”: Child process exited with code 1
Jun 04 18:20:58.806 INFO gephgui_wry: Wry has started!
(WebKitWebProcess:37): Gdk-WARNING **: 18:20:58.852: Settings portal not found: Error spawning command line “dbus-launch --autolaunch=6c6769cbb94f53376685f6ca63df8967 --binary-syntax --close-stderr”: Child process exited with code 1
由 chatgpt ,运行 eval $(dbus-launch --sh-syntax)
可以解决上述问题,但是报错:
Portal call failed: The name org.freedesktop.Flatpak was not provided by any .service files
网页中的办法无效。不过运行 /usr/libexec/xdg-desktop-portal -r
得到:
(/usr/libexec/xdg-desktop-portal:11986): GLib-GIO-ERROR **: 21:01:37.236: No GSettings schemas are installed on the system
Trace/breakpoint trap
这说明 /usr/libexec/xdg-desktop-portal
其实根本没有被正确安装。
由网页 ,设置
export XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
然后再次运行 flatpak run ...
,报错:
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address