从 WSL (Debian) 开始 Google Chrome

Start Google Chrome from WSL (Debian)

我一直在尝试找到一种从 WSL (Debian) 启动 Google Chrome 的方法, Chrome 安装在我的 Windows 10 系统上。

例如在 Debian 终端中输入 google chrome。

我只找到与 Ubuntu / Git Bash / CMD 有关如何解决此问题的答案。

感谢任何帮助!

首先,您可以在 Debian 中通过 运行 命令 echo $PATH 检查路径中的内容。 如果没有与 Chrome 相关的内容,您可以创建一个指向 Chrome.

路径的别名

建议先定位到Chrome目录,然后用pwd打印路径复制过来

然后导航至 ~,使用您选择的文本编辑器(例如 nano)打开 .bashrc 文件 并添加以下行:

别名google="/mnt/c/Program\Files/Google/Chrome/Application/chrome.exe"

您可以用您选择的名称替换“google”,在我的例子中,Google Chrome 的路径如上,但 这可能因版本和系统而异,因此请确保根据您的系统找到 Chrome 的正确路径。

保存您的编辑,您现在应该可以使用您选择的命令启动 chrome。