Successfully reported this slideshow.
Your SlideShare is downloading. ×

Vagrant boxes with x, export display, chrome headless

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
2.Accessing the Pi
2.Accessing the Pi
Loading in …3
×

Check these out next

1 of 21 Ad

Vagrant boxes with x, export display, chrome headless

Download to read offline

What is Xvfb ? Brief history of X System. How to use it with Vagrant Boxes ? Setup a Vagrant Box with Ubuntu and Mac OSX as host.

What is Xvfb ? Brief history of X System. How to use it with Vagrant Boxes ? Setup a Vagrant Box with Ubuntu and Mac OSX as host.

Advertisement
Advertisement

More Related Content

Similar to Vagrant boxes with x, export display, chrome headless (20)

Advertisement

Recently uploaded (20)

Vagrant boxes with x, export display, chrome headless

  1. 1. federico.panini@fazland.com - CTO https://www.x.org
  2. 2. federico.panini@fazland.com - CTO
  3. 3. federico.panini@fazland.com - CTO What is the X system ? The Idea of X-windows started in 1984 from Jim Gettys (of Project Athena) and Bob Scheifler (of the MIT Laboratory for Computer Science). The idea was to have a simple user interface to allow students access educational resources easily. At the time Gettys and Scheifler started working on X there were a lot of proprietary graphics management system but it was not possible to use it for free, so they started a free project called X. In fact Scheifler make a first port of W which had a synchronous protocol with an asynchronous one, making X two times faster than W.
  4. 4. federico.panini@fazland.com - CTO What is the X system ? From: rws@mit-bold (Robert W. Scheifler) To: window@athena Subject: window system X Date: 19 Jun 1984 0907-EDT (Tuesday) I've spent the last couple weeks writing a window system for the VS100. I stole a fair amount of code from W, surrounded it with an asynchronous rather than a synchronous interface, and called it X. Overall performance appears to be about twice that of W. The code seems fairly solid at this point, although there are still some deficiencies to be fixed up. We at LCS have stopped using W, and are now actively building applications on X. Anyone else using W should seriously consider switching. This is not the ultimate window system, but I believe it is a good starting point for experimentation. Right at the moment there is a CLU (and an Argus) interface to X; a C interface is in the works. The three existing applications are a text editor (TED), an Argus I/O interface, and a primitive window manager. There is no documentation yet; anyone crazy enough to volunteer? I may get around to it eventually. Anyone interested in seeing a demo can drop by NE43-531, although you may want to call 3-1945 first. Anyone who wants the code can come by with a tape. Anyone interested in hacking deficiencies, feel free to get in touch.
  5. 5. federico.panini@fazland.com - CTO XVFB https://www.x.org/archive/X11R7.7/doc/man/man1/Xvfb.1.xhtml
  6. 6. federico.panini@fazland.com - CTO XVFB https://www.x.org/archive/X11R7.7/doc/man/man1/Xvfb.1.xhtml Xvfb stands for “X virtual framebuffer”, it is used to execute X environment On hardware without proper graphics devices or video cards, as for example unix/linux server which have only SSH access. Xvfb uses virtual memory to recreate a dumb framebuffer, this allow to use Any graphical operations without showing it on screen. The idea behind Xvfb is to use the X11 protocol.
  7. 7. federico.panini@fazland.com - CTO Export display The x Window protocol allow to export display to remote client implementing Authentication and a network protocol. This could be really useful if we need to Test an application that could not run from CLI and should run on a remote server. The only possibility we have is to use X-window network protocol and export the display to a remote client.
  8. 8. federico.panini@fazland.com - CTO Export display Remember that you should have a graphical linux/unix client with an X-protocol to properly export the display. You have many options on Windows : - Cygwin/X (https://x.cygwin.com/)
 - Xming (https://sourceforge.net/projects/xming/)
 - Startnet (http://www.starnet.com/xwin32/)
  9. 9. federico.panini@fazland.com - CTO Export display https://www.xquartz.org/ Remember that you should have a graphical linux/unix client with an X-protocol to properly export the display. The Mac OSX solution is XQuartz :
  10. 10. federico.panini@fazland.com - CTO Export display from a vagrant Box pt.1 https://www.xquartz.org/ Download and install XQuartz then update the Security preferences to allow the vagrant box connect properly to the client :
  11. 11. federico.panini@fazland.com - CTO Export display from a vagrant Box pt.2 Check if the Vagrantfile has the property ForwardX11 set properly. VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| … config.ssh.forward_x11 = true end
  12. 12. federico.panini@fazland.com - CTO Export display from a vagrant Box pt.2 Check if the Vagrantfile has the property ForwardX11 set properly. sudo apt-get install xterm xterm
  13. 13. federico.panini@fazland.com - CTO Export display from a vagrant Box pt.2 Check if the Vagrantfile has the property ForwardX11 set properly. google-chrome
  14. 14. federico.panini@fazland.com - CTO Export display from a vagrant Box pt.2 Check if the Vagrantfile has the property ForwardX11 set properly. ssh -Y -p 2222 vagrant@localhost xterm
  15. 15. federico.panini@fazland.com - CTO Export display from a vagrant Box pt.2 Check if the Vagrantfile has the property ForwardX11 set properly.
  16. 16. federico.panini@fazland.com - CTO Export display what is it ? A Display consist of a : • keyboard • mouse • Screen Exporting the DISPLAY variable the X Window System knows where to route the X network traffic. The Display variable is : hostname.D.S Hostname : is the host used to sent the graphical output. If omitted is localhost D : is the screen number. Most workstations tend to only have one keyboard, and therefore, only one display. Larger, multi-user systems, however, frequently have several displays so that more than one person can be doing graphics work at once. To avoid confusion, each display on a machine is assigned a display number (beginning at 0) when the X server for that display is started. The display number must always be given in a display name.  S : Some displays share a single keyboard and pointer among two or more monitors. Since each monitor has its own set of windows, each screen is assigned a screen number (beginning at 0) when the X server for that display is started. If the screen number is not given, screen 0 will be used.
  17. 17. federico.panini@fazland.com - CTO Export display what is it ?
  18. 18. federico.panini@fazland.com - CTO Chrome 59 headless need X ??? NO! https://developers.google.com/web/updates/2017/04/headless-chrome
  19. 19. federico.panini@fazland.com - CTO Install Chrome 59 on Ubuntu Trusty https://developers.google.com/web/updates/2017/04/headless-chrome wget https://dl.google.com/linux/direct/google-chrome- stable_current_amd64.deb sudo apt-get update && sudo apt-get -f install gconf-service- backend libgtk2.0-common libgtk2.0-bin libdbusmenu-glib4 libdbusmenu-gtk4 libgtk2.0-0 libindicator7 gconf2-common gconf- service libnss3-nssdb libgconf-2-4 libnspr4 libxss1 fonts- liberation libappindicator1 libnss3 xdg-utils sudo dpkg -i google-chrome-stable_current_amd64.deb
  20. 20. federico.panini@fazland.com - CTO Install Chrome 59 on Ubuntu Trusty https://developers.google.com/web/updates/2017/04/headless-chrome gconf-service- backend GNOME configuration database system (D-Bus service) - [https://packages.ubuntu.com/trusty/ gconf-service-backend] gconf2-common GNOME configuration database system - [https://packages.ubuntu.com/trusty/gconf2-common] gconf-service GNOME configuration database system (D-Bus service) libgtk2.0-common common files for the GTK+ graphical user interface library libgtk2.0-bin programs for the GTK+ graphical user interface library libindicator7 panel indicator applet - shared library libnss3-nssdb Network Security Security libraries - shared databases - [https://packages.ubuntu.com/ trusty/libnss3-nssdb] libgconf-2-4 GNOME configuration database system (shared libraries) libnspr4 NetScape Portable Runtime Library libxss1 X11 Screen Saver extension library fonts-liberation Fonts with the same metrics as Times, Arial and Courier - [https://packages.ubuntu.com/ trusty/fonts-liberation] libappindicator1 Application Indicators - [https://packages.ubuntu.com/trusty/libappindicator1] libnss3 [https://packages.ubuntu.com/trusty/libnss3] xdg-utils desktop integration utilities from freedesktop.org - [https://packages.ubuntu.com/trusty/ xdg-utils]
  21. 21. federico.panini@fazland.com - CTO References • https://www.x.org/archive/X11R7.7/doc/man/man1/Xvfb.1.xhtml • https://www.x.org/wiki/ • https://stackoverflow.com/questions/20094118/ssh-into-vagrant-with-x-server-set- up • https://dyhr.com/2009/09/05/how-to-enable-x11-forwarding-with-ssh-on-mac-os-x- leopard/ • http://www.hungry.com/~jamie/xexport.html • https://askubuntu.com/questions/432255/what-is-display-environment-variable • https://developers.google.com/web/updates/2017/04/headless-chrome • https://coderwall.com/p/ozhfva/run-graphical-programs-within-vagrantboxes

×