博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
DOcker 启动chrome问题解决
阅读量:2385 次
发布时间:2019-05-10

本文共 2278 字,大约阅读时间需要 7 分钟。

注意:在docker里,尽量不要以root身份运行chrome,会报一些错误

1. "Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted".

docker run 时加上参数: --privileged

Why --privileged?

Chrome uses sandboxing, therefore if you try and run Chrome within a non-privileged container you will receive the following message:

"Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted".

The flag gives the container almost the same privileges to the host machine resources as other processes running outside the container, which is required for the sandboxing to run smoothly.

FYI, https://hub.docker.com/r/webnicer/protractor-headless/

2.

root下执行命令:

xhost +

FYI, http://stackoverflow.com/questions/28392949/running-chromium-inside-docker-gtk-cannot-open-display-0

3.linux下xhost命令报错:unable to open display的解决办法

FYI, http://www.jb51.net/LINUXjishu/412923.html

linux系统中执行xhost命令报错,具体内容为,unable to open display,该怎么办呢?出现这个问题是因为,linux 下通过xhost进入图形界面,经常会出现报错“unable to open display”,详细解决办法请看下文
linux下执行xhost命令报错:unable to open display,解决方法,linux 下通过xhost进入图形界面,经常会出现报错“unable to  open display”

linux下的操作步骤如下:

1、复制代码:

复制内容到剪贴板
  1. [root@localhost ~]# vncserver   
  2.   
  3.         New 'localhost:1 (root)' desktop is localhost:1   
  4.   
  5.         Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost:1.log   
  6.   
  7. [root@localhost ~]# export DISPLAY=localhost:1   
  8.   
  9. [root@localhost ~]# xhost +   
  10.   
  11.         access control disabled, clients can connect from any host   

在设置xhost时,出现unable to open display 的问题一般都能用上述方法搞定

2、以root用户登录

输入命令xdpyinfo,记录下里面的name of display:后的字符串,如 name of display:127.0.0.1:1.0

在执行xhost +命令(使得所有客户都可以访问)

返回信息为: access control disabled,clients can connect from any host

如果xhost +不能执行,可以输入命令export DISPLAY=:0执行一下

再执行xhost +

xhost + ip (name表示那个ip机器可以使用该服务)

以oracle用户登录

如果前面root登录下执行xdpyinfo后的name of display:后的字符串是127.0.0.1:1.0

那么在该oracle用户下执行一下export DISPLAY=:1.0

然后再执行xdpyinfo命令,如果能出现信息说明你已经成功了

这样估计就可以解决linux下安装oracle出现的xhost问题

3、电脑上下载安装Xshell 5

4、选择需要连接到哪一个Linux系统

5、输入用于连接的用户名和密码

6、输入用于连接的密码

7、单击这里的确定,开始连接

8、连接成功

9、命令startx提示信息

3.

Failed to connect to socket /var/run/dbus/system_bus_socket:No such file or directory

solution:

1> sudo apt-get install dbus

2>sudo /etc/init.d/dbus start

转载地址:http://bojab.baihongyu.com/

你可能感兴趣的文章
Next Permutation
查看>>
sys文件系统
查看>>
Mysql常用命令大全
查看>>
辞职后五险一金怎么处理?
查看>>
几种开源的TCP/IP协议栈对比
查看>>
C语言之断言
查看>>
程序员技术练级攻略
查看>>
#define
查看>>
C语言之if...else PK switch...case
查看>>
关于SVN方面的问题
查看>>
深入理解C语言
查看>>
编程成就:开发人员如何升级
查看>>
如何防止代码腐烂
查看>>
va_start va_end 的使用和原理
查看>>
Linux 中的零拷贝技术,第 2 部分
查看>>
零拷贝技术的研究与实现
查看>>
零拷贝与 sendfile
查看>>
directfb显示中文
查看>>
关于SIGPIPE导致的程序退出
查看>>
setsockopt()函数用法
查看>>