Posted inTips and Tricks / linux / Software

qxcbconnection: could not connect to display – How To Fix qxcbconnection: could not connect to display?

Solved – (qxcbconnection: could not connect to display) QXcbConnection could not connect to display wkhtmltopdf ubuntu Just install xvfb from apt and then, you can run: xvfb-run wkhtmltopdf

QXcbConnection: Could not connect to display

wkhtmltopdf – QXcbConnection: Could not connect to display – qt.qpa.screen: QXcbConnection: Could not connect to display localhost:0.0 Could not connect to any X display.

Install wkhtmltopdf

sudo apt-get update
sudo apt-get install wkhtmltopdf

Generate PDF File using wkhtmltopdf

wkhtmltopdf https://google.com google.pdf

Get Error Like bellow:

qt.qpa.screen: QXcbConnection: Could not connect to display

Could not connect to any X display.

Best Solution for : qxcbconnection: could not connect to display

step 1 : Install xvfb:

sudo apt-get update
sudo apt-get install xvfb

step 2 : Generate PDF File using xvfb wkhtmltopdf:

xvfb-run wkhtmltopdf https://google.com google.pdf

After that it should generate pdf file using xvfb wkhtmltopdf:.

you can also make simply step to alias for xvfb-run wkhtmltopdf as like bellow Example:

Don’t Miss : 419 Page Expired

Step 3: Make Alias:

alias wkhtmltopdf='xvfb-run wkhtmltopdf'

Step 4: Use Alias:

wkhtmltopdf https://google.com google.pdf

I hope you get an idea about qxcbconnection: could not connect to display.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I'm a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.

Leave a Reply

Your email address will not be published. Required fields are marked *

We accept paid guest Posting on our Site : Guest Post Chat with Us On Skype