尝试在 Centos (Rhel 7.5) 上运行 google-chrome 时无法打开 X 显示 [英] Unable to open X display when trying to run google-chrome on Centos (Rhel 7.5)

查看:59
本文介绍了尝试在 Centos (Rhel 7.5) 上运行 google-chrome 时无法打开 X 显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用 SSH 在虚拟机上远程运行 Google Chrome.我不想要 xforwarding - 我想利用 vm 上可用的 GPU.当我尝试运行 google-chrome 时,出现以下错误:

I need to run Google Chrome remotely on a virtual machine using SSH. I do not want xforwarding - I want to utilize the GPU available on the vm. When I try running google-chrome I get following error:

[19615:19615:0219/152933.751028:ERROR:browser_main_loop.cc(1512)] Unable to open X display.

我尝试将我的 DISPLAY env 值设置为各种值:

I've tried to setting my DISPLAY env value to various values:

export DISPLAY=localhost:0.0
export DISPLAY=127.0.0.1:0.0
export DISPLAY=:0.0

我也尝试用不同的值替换以上示例中的 0.0.

I've also tried replacing 0.0 in abowe examples with different values.

我在/etc/ssh/sshd_config 中有 ForwardX11 no我尝试像这样设置目标:

I have ForwardX11 no in /etc/ssh/sshd_config I tried setting up target like this:

systemctl isolate multi-user.target

当我尝试运行 sudo lshw -C display 我得到以下输出:

When I try to run sudo lshw -C display i get folowing output:

   *-display
       description: VGA compatible controller
       product: Hyper-V virtual VGA
       vendor: Microsoft Corporation
       physical id: 8
       bus info: pci@0000:00:08.0
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: vga_controller bus_master rom
       configuration: driver=hyperv_fb latency=0
       resources: irq:11 memory:f8000000-fbffffff
  *-display UNCLAIMED
       description: VGA compatible controller
       product: GM204GL [Tesla M60]
       vendor: NVIDIA Corporation
       physical id: 1
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list
       configuration: latency=0
       resources: iomemory:f0-ef iomemory:f0-ef memory:41000000-41ffffff memory:fe0000000-fefffffff memory:ff0000000-ff1ffffff

我尝试通过以下方式更新我的 GPU 驱动程序:

I've tried to update my gpu drivers by:

wget https://www.nvidia.com/content/DriverDownload-March2009/confirmation.php?url=/tesla/375.66/nvidia-diag-driver-local-repo-rhel7-375.66-1.x86_64.rpm
yum -y install nvidia-diag-driver-local-repo-rhel7-375.66-1.x86_64.rpm

但在那之后我仍然在我的 NVIDIA GPU 旁边看到 UNCLIMED.Aby 想法?

But after that I still see UNCLIMED next to my NVIDIA gpu. Aby ideas?

推荐答案

你可以试试 Xvfb.它不需要额外的硬件.

You can try with Xvfb. it does not require additional hardware.

如果您还没有安装 Xvfb,请安装它并执行以下步骤.

sudo apt-get install -y xvfb

使无头"的依赖项铬/硒工作:

sudo apt-get -y install xorg xvfb gtk2-engines-pixbuf
sudo apt-get -y install dbus-x11 xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable

可选但很漂亮:用于捕获 Xvfb 显示的屏幕截图:

sudo apt-get -y install imagemagick x11-apps

确保每次启动 box/vm 时 Xvfb 都启动:

Xvfb -ac :99 -screen 0 1280x1024x16 &
export DISPLAY=:99

运行谷歌浏览器

google-chrome

这篇关于尝试在 Centos (Rhel 7.5) 上运行 google-chrome 时无法打开 X 显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆