注意:在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 --privileged
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.Running Chromium inside Docker - Gtk: cannot open display: :0
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下的操作步骤如下:
1、复制代码:
- [root@localhost ~]# vncserver
- New 'localhost:1 (root)' desktop is localhost:1
- Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/localhost:1.log
- [root@localhost ~]# export DISPLAY=localhost:1
- [root@localhost ~]# xhost +
- 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