Installing and Configuring xvfb

后端 未结 5 1215
生来不讨喜
生来不讨喜 2021-02-12 13:38

I\'m trying to find a Ubuntu operating system, version of xorg, and version of xvfb that are compatible. Can anyone help me with directions to install xvfb without getting a han

相关标签:
5条回答
  • 2021-02-12 13:46

    Here is what I do:

    apt install xvfb

    Xvfb&

    xvfb-run someprogram

    Source: http://realtechtalk.com/using_Xvfb_on_virtual_remote_ssh_server_to_have_X_graphical_programs_work-2287-articles

    0 讨论(0)
  • 2021-02-12 13:49

    You can try pyvirtualdisplay LINK HERE. Further, This may be helpful: LINK

    0 讨论(0)
  • 2021-02-12 13:52

    in my log files i see everything is okay up to Initializing built-in extension GLX but then it is followed by

    The XKEYBOARD keymap compiler (xkbcomp) reports:
    > Internal error:   Could not resolve keysym XF86AudioMicMute
    Errors from xkbcomp are not fatal to the X server
    

    may be the key issue is with xkbcomp?

    0 讨论(0)
  • 2021-02-12 13:54

    Install Xvfb or Xephyr or Xvnc. Also install pyvirtualdisplay python module. This is for Ubuntu 14.04 and tested on 16.04 as well.

    sudo apt-get install python-pip
    sudo apt-get install xvfb xserver-xephyr vnc4server
    sudo pip install pyvirtualdisplay
    # optional
    sudo apt-get install python-pil scrot
    sudo pip install pyscreenshot
    

    Now you can start Xvfb from your python script. It will start Xvfb when your script will be executed. Add the following lines to your code.

    from pyvirtualdisplay import Display
    display = Display(visible=0, size=(1366, 768))
    display.start()
    

    Here is the example code.

    from pyvirtualdisplay import Display
    from selenium import webdriver
    
    display = Display(visible=0, size=(1366, 768))
    display.start()
    browser = webdriver.Firefox()
    browser.get('http://www.google.com')
    print browser.title
    browser.quit()
    
    display.stop()
    
    0 讨论(0)
  • 2021-02-12 13:58

    The output means xvfb works fine. It should run as a background process (or service).

    0 讨论(0)
提交回复
热议问题