1 | | If you are having problems with !VirtualBox's shared clipboard functionality and are using either an X11-based host system or an X11-based guest then it is possible to enable logging functionality which will give you a glimpse into what is happening inside. This glimpse will be from the point of view of the X11 clipboard component, so if you are for example running a Windows guest on a Linux host, you will see when the host component thinks that the guest component has asked for the clipboard contents, but not directly when an application on the guest has asked the guest component for data. |
| 1 | = Investigating shared clipboard problems on X11 guests or hosts = |
| 2 | |
| 3 | If you are having problems with !VirtualBox's shared clipboard functionality and are using either an X11-based host system or an X11-based guest then it is possible to enable logging functionality which will give you a glimpse into what is happening inside. (Before doing this, check that the shared clipboard is actually enabled of course. And be sure that you understand that X11 has two - or three - different clipboards, of which we only proxy one.) This glimpse will be from the point of view of the X11 clipboard component, so if you are for example running a Windows guest on a Linux host, you will see when the host component thinks that the guest component has asked for the clipboard contents, but not directly when an application on the guest has asked the guest component for data. |
| 18 | |
| 19 | == Enabling logging on the host component == #HostLogging |
| 20 | |
| 21 | To tell the host clipboard component on an X11-based host to add information to the virtual machine log file, run !VirtualBox from the command line with the environment variable |
| 22 | {{{ |
| 23 | VBOX_RELEASE_LOG=+shared_clipboard.e.l.f |
| 24 | }}} |
| 25 | set (see the description of the [wiki:VBoxLogging logging facility] for more background). |
| 26 | |
| 27 | == Enabling logging in the guest component == #GuestLogging |
| 28 | |
| 29 | On X11-based guest systems, the main part of the guest component is a daemon application (one which is started once and usually never stops, carrying on its work in the background) called !VBoxClient. You can see whether or not it is running (it should be) using the `ps` command: |
| 30 | {{{ |
| 31 | $ ps -f | grep Client |
| 32 | user 123 [...] VBoxClient --display |
| 33 | user 124 [...] VBoxClient --clipboard |
| 34 | [...] |
| 35 | }}} |
| 36 | To get it to produce logging, you can stop it (in this example, the process ID is 124, so you would execute |
| 37 | {{{ |
| 38 | $ kill 124 |
| 39 | }}} |
| 40 | and restart it (as the logged on user) with the `VBOX_RELEASE_LOG_DEST` environment variable set to point to a file, with `VBOX_RELEASE_LOG=+all.e.l.f` and with the `-d` flag which tells it not to become a daemon and disappear into the background: |
| 41 | {{{ |
| 42 | $ VBOX_RELEASE_LOG_DEST=file=/tmp/clipboard.log VBOX_RELEASE_LOG=+all.e.l.f VBoxClient -d --clipboard |
| 43 | }}} |
| 44 | Now the logging will go to a file called `/tmp/clipboard.log` on the guest. |