VirtualBox

Changes between Version 1 and Version 2 of X11Clipboard


Ignore:
Timestamp:
Feb 25, 2013 2:48:55 PM (12 years ago)
Author:
Michael Thayer
Comment:

Debugging the X11 clipboard, second iteration.

Legend:

Unmodified
Added
Removed
Modified
  • X11Clipboard

    v1 v2  
    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
     3If 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.
    24
    35For background, the shared clipboard mechanism is made up of a component running on the host and one running on the guest which communicate using !VirtualBox's host-to-guest communication mechanism.  The host component represents all applications running on the guest and vice versa.  Some examples of what this means are:
     
    1416 * The other component has announced that it an application at its end is taking control of the clipboard, so this component should take control of the clipboard at its end to represent the remote application.
    1517 * An application at this end has taken control of the clipboard, so this component has relinquished control and asked the other end to take control over the clipboard there to represent the application.
     18
     19== Enabling logging on the host component == #HostLogging
     20
     21To 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{{{
     23VBOX_RELEASE_LOG=+shared_clipboard.e.l.f
     24}}}
     25set (see the description of the [wiki:VBoxLogging logging facility] for more background).
     26
     27== Enabling logging in the guest component == #GuestLogging
     28
     29On 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
     32user   123 [...] VBoxClient --display
     33user   124 [...] VBoxClient --clipboard
     34[...]
     35}}}
     36To 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}}}
     40and 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}}}
     44Now the logging will go to a file called `/tmp/clipboard.log` on the guest.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette