LoginSignup
11
11

More than 5 years have passed since last update.

さくらのVPSとCentOS6.5とXvfbとFirefoxでGUIなしでスクショ

Posted at

やることは

  1. X-Server(ざっくり言えばGUI)を入れる
  2. 仮想ディスプレイ(Xvfb)を入れる
  3. 仮想ディスプレイを指定してブラウザ(Firefox)を起動

さくらのVPS CentOS6.5でFirefoxがコアを吐いてNO-GUIで動かない。

process 24046: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": そのようなファイルやディレクトリはありません
See the manual page for dbus-uuidgen to correct this issue.
  D-Bus not built with -rdynamic so unable to print a backtrace
アボートしました (コアダンプ)

http://d.hatena.ne.jp/syuu1228/20081210/1228895490
http://d.hatena.ne.jp/jog2038/20080226
なんか動作にはUUID的なものがいるらしい。

# dbus-uuidgen > /var/lib/dbus/machine-id

テスト

# Xvfb :1 &
# export DISPLAY=:1
# firefox -display :1 -remote "openurl(http://www.phalanxware.com)" &
# import -window root test.png

これでスクショとれたので

$ scp your-sakuravps.com:test.png ./
$ open test.png

www.phalanxware.com のスクリーンショットがとれているのを確認する。

11
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11