using Xvfb on virtual remote ssh server to have X graphical programs work

Install xvfb

apt install xvfb
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
  libxfont1 libxkbfile1 x11-xkb-utils xauth xfonts-base xfonts-encodings xfonts-utils xserver-common
The following NEW packages will be installed:
  libxfont1 libxkbfile1 x11-xkb-utils xauth xfonts-base xfonts-encodings xfonts-utils xserver-common
  xvfb
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 7703 kB of archives.
After this operation, 13.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 xauth amd64 1:1.0.9-1ubuntu2 [22.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxfont1 amd64 1:1.5.1-1ubuntu0.16.04.4 [95.0 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 libxkbfile1 amd64 1:1.0.9-0ubuntu1 [65.1 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial/main amd64 x11-xkb-utils amd64 7.7+2 [153 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/main amd64 xfonts-encodings all 1:1.0.4-2 [573 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 xfonts-utils amd64 1:7.7+3ubuntu0.16.04.2 [74.6 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 xfonts-base all 1:1.0.4+nmu1 [5914 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 xserver-common all 2:1.18.4-0ubuntu0.8 [27.7 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 xvfb amd64 2:1.18.4-0ubuntu0.8 [777 kB]
Fetched 7703 kB in 1s (4446 kB/s)
Selecting previously unselected package xauth.
(Reading database ... 51038 files and directories currently installed.)
Preparing to unpack .../xauth_1%3a1.0.9-1ubuntu2_amd64.deb ...
Unpacking xauth (1:1.0.9-1ubuntu2) ...
Selecting previously unselected package libxfont1:amd64.
Preparing to unpack .../libxfont1_1%3a1.5.1-1ubuntu0.16.04.4_amd64.deb ...
Unpacking libxfont1:amd64 (1:1.5.1-1ubuntu0.16.04.4) ...
Selecting previously unselected package libxkbfile1:amd64.
Preparing to unpack .../libxkbfile1_1%3a1.0.9-0ubuntu1_amd64.deb ...
Unpacking libxkbfile1:amd64 (1:1.0.9-0ubuntu1) ...
Selecting previously unselected package x11-xkb-utils.
Preparing to unpack .../x11-xkb-utils_7.7+2_amd64.deb ...
Unpacking x11-xkb-utils (7.7+2) ...
Selecting previously unselected package xfonts-encodings.
Preparing to unpack .../xfonts-encodings_1%3a1.0.4-2_all.deb ...
Unpacking xfonts-encodings (1:1.0.4-2) ...
Selecting previously unselected package xfonts-utils.
Preparing to unpack .../xfonts-utils_1%3a7.7+3ubuntu0.16.04.2_amd64.deb ...
Unpacking xfonts-utils (1:7.7+3ubuntu0.16.04.2) ...
Selecting previously unselected package xfonts-base.
Preparing to unpack .../xfonts-base_1%3a1.0.4+nmu1_all.deb ...
Unpacking xfonts-base (1:1.0.4+nmu1) ...
Selecting previously unselected package xserver-common.
Preparing to unpack .../xserver-common_2%3a1.18.4-0ubuntu0.8_all.deb ...
Unpacking xserver-common (2:1.18.4-0ubuntu0.8) ...
Selecting previously unselected package xvfb.
Preparing to unpack .../xvfb_2%3a1.18.4-0ubuntu0.8_amd64.deb ...
Unpacking xvfb (2:1.18.4-0ubuntu0.8) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Processing triggers for fontconfig (2.11.94-0ubuntu1.1) ...
Setting up xauth (1:1.0.9-1ubuntu2) ...
Setting up libxfont1:amd64 (1:1.5.1-1ubuntu0.16.04.4) ...
Setting up libxkbfile1:amd64 (1:1.0.9-0ubuntu1) ...
Setting up x11-xkb-utils (7.7+2) ...
Setting up xfonts-encodings (1:1.0.4-2) ...
Setting up xfonts-utils (1:7.7+3ubuntu0.16.04.2) ...
Setting up xfonts-base (1:1.0.4+nmu1) ...
Setting up xserver-common (2:1.18.4-0ubuntu0.8) ...
Setting up xvfb (2:1.18.4-0ubuntu0.8) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...

Configure and run xvfb

First start the Xvfb server:

Xvfb&

Then use the xvfb-run command to start any program that needs graphical capabilities

xvfb-run someprogram


Tags:

xvfb, virtual, ssh, server, graphical, programs, workinstall, apt, install, lists, dependency, additional, packages, installed, libxfont, libxkbfile, xkb, utils, xauth, xfonts, encodings, xserver, upgraded, newly, kb, archives, mb, disk, http, archive, ubuntu, xenial, amd, updates, nmu, fetched, selecting, previously, unselected, database, directories, currently, preparing, unpack, xauth_, _amd, deb, unpacking, _, utils_, encodings_, _all, base_, common_, xvfb_, processing, triggers, db, libc, bin, fontconfig, configure, capabilities, someprogram,

Latest Articles

  • CentOS 6 impossible to compile a newer libguestfs
  • chroot
  • How To Get Started on Ubuntu with gpt-2 OpenAI Text Prediction
  • Remove cloud-init in your VM
  • QEMU-KVM KVM Command Line Practical Guide
  • Linux How To Change NIC Name to eth0 instead of enps33 or enp0s25
  • virt-resize: error: libguestfs error: could not create appliance through libvirt.
  • Asterisk Does Not Retry When Authentication Fails
  • Linux Debian Ubuntu How To Install PEPPER Faster and Latest Adobe Flash Player in Firefox
  • How To Speed Up Linux Ubuntu and Debian Based Computers By Improving CPU Performance and Changing the CPU Governor
  • Convert data or file to base64 on a single line
  • Linux Mint Ubuntu Debian radeon slow 2D performance issues radeon_dp_aux_transfer_native: 158 callbacks suppressed
  • mdadm: super0.90 cannot open /dev/sdb1: Device or resource busy mdadm: /dev/sdb1 is not suitable for this array.
  • How To Install NextCloud on Centos 7 and Centos 8
  • AH01630: client denied by server configuration:
  • ERROR: Could not find a version that satisfies the requirement PIL (from versions: none) ERROR: No matching distribution found for PIL
  • ZTE Camera Cannot Work unable to connect to camera. Camera has been disabled becaue of security policies or is being used by other apps
  • QEMU KVM how to boot off a physical CD/DVD/BDROM Drive
  • How To Install OpenProject on Centos 7 Step-by-Step Guide
  • Ubuntu Debian Linux Cannot Install Wine Solution - wine1.6 : Depends: wine1.6-i386 (= 1:1.6.2-0ubuntu14.2) but it is not installable wine1.4 : Depends: wine1.6 but it is not going to be installed