我正在我的 Windows 10 机器上使用 WSL2/Ubuntu 开发一个 rails 应用程序,这很棒!问题是我无法从同一网络中的另一台计算机连接到我的服务器。
为了更清楚,我在 localhost:3000 上运行 Puma 服务器
我尝试了以下方法:
rails s -b 172.26.208.1 -p 3000到目前为止,以上都没有奏效......我想做的是:
至少有什么我遗漏的吗?(以及对 VScode 部分的任何评论将不胜感激)
是否有任何工具,除了KCacheGrind,能够查看callgrind结果?对于Windows平台最好?
如何从 Windows 10 的 Bash Shell 运行图形 Linux 桌面应用程序?
首先,我按照此处所示的步骤安装了适用于 Linux 的 Windows 子系统 (WSL) ,如下所示:
(1) 安装了 Windows 10 Pro Insider Preview Build 19619。
(2) 安装了 Ubuntu Linux 发行版。
(3) 将发行版本从 WSL 1 更改为 WSL 2。
其次,使从Windows 10的bash shell的Linux图形桌面应用程序,我也跟着下面的步骤如图所示位置如下:
(4) 我安装了一个X Server,它是Xming
(5) 安装基于 GTK 的图形 vim 编辑器作为测试使用:
sudo apt-get install vim-gtk
(6) 设置我的显示环境变量
export DISPLAY=:0
(7) 启动应用程序
gvim
但是,这并没有使应用程序午餐,我收到以下错误:
E233: cannot open display
Press ENTER or type command to continue
E852: The child process …Run Code Online (Sandbox Code Playgroud) 如何在 Windows 10 上设置 VcXSrv.exe 以与 WSL2 配合使用而不禁用访问控制?互联网上的每个描述都显示禁用访问控制,但这允许本地网络上的任何程序记录您的击键和鼠标移动等。
当我尝试在适用于 Linux WSL2 / Ubuntu 20.04 的 Windows 子系统上运行 JavaFX 15 应用程序时,我遇到了困难,需要有关后续尝试步骤的建议。
到目前为止,我已经能够在 WSL 内运行我通常在 Windows/JDK15 上执行的所有 Java 构建,包括那些具有 Swing/AWT 依赖项的构建。AWT / Swing 测试应用程序在 WSL 中成功运行并引用 JDK15,并在 Windows 10 上运行 X Windows。但是我无法运行任何 JavaFX 应用程序,甚至是HelloFX示例:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class HelloFX extends Application {
public void start(Stage stage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " …Run Code Online (Sandbox Code Playgroud) 我在 WSL2 实例中运行 Jupyter 笔记本时遇到了一个奇怪的问题。每次我启动一个新笔记本时,我的第一次连接localhost:8888(或localhost:XXXX任何其他端口号)都需要很长时间才能连接,例如 5-10 分钟。然而,一旦与该端口建立了一个连接,所有后续连接都会以正常速度发生。据我所知,延迟并不是专门发生在 Jupyter 服务器内的,因为服务器输出GET在等待期间没有显示任何请求:
> jupyter notebook .
[I 08:29:21.282 NotebookApp] Authentication of /metrics is OFF, since other authentication is disabled.
[W 08:29:21.729 NotebookApp] All authentication is disabled. Anyone who can connect to this server will be able to run code.
[I 08:29:21.732 NotebookApp] Serving notebooks from local directory: /home/peter/jade_poplar/code/python
[I 08:29:21.732 NotebookApp] Jupyter Notebook 6.4.0 is running at:
[I 08:29:21.732 NotebookApp] http://localhost:8888/
[I 08:29:21.732 NotebookApp] Use Control-C to …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的 WSL2 上配置 Xming 显示,经过大量的故障排除尝试后,我很无能为力。
详情:
系统: WSL2 on Windows10Pro
Xming:已安装。日志中的一些希望相关的行:
我尝试过的:(在 WSL2 终端上)
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
export LIBGL_ALWAYS_INDIRECT=1
Run Code Online (Sandbox Code Playgroud)
如图所示这里
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
Run Code Online (Sandbox Code Playgroud)
如图所示,此处的后续链接
export DISPLAY=172.27.16.1 (/:0/:0.0)
取自 Xming 日志。
到目前为止的结果:在所有情况下我都得到
No protocol specified
Error: Can't …Run Code Online (Sandbox Code Playgroud)