Xterm – How to Copy Text in Awesome, Debian, VirtualBox

clipboardvirtualboxx11xterm

I ran the minimal Debian installation inside a VirtualBox instance, installed X11 and Awesome window manager manually (without any custom configuration yet) and installed VirtualBox additions as well (and enabled shared clipboard in settings). However, copy-pasting text from xterm terminal still doesn't seem to work: CTRL+C is sent as a signal to a terminal, and Shift+Insert inserts the text that I had selected (which probably means that it got copied to some buffer somehow), but it is still unavailable from the host operating system.

Best Answer

X11 uses two buffers: PRIMARY and CLIPBOARD. To copy/paste to the CLIPBOARD buffer you can often use CTRL-C and CTRL-V. You can insert to the PRIMARY buffer by selecting a text and paste from it by pressing the middle mouse button.

If you want to use the CLIPBOARD buffer, put this in your ~/.Xresources file and use Ctrl+Shift+C and Ctrl+Shift+V to copy/paste from/to the CLIPBOARD buffer in xterm:

xterm*VT100.Translations: #override \
                 Ctrl Shift <Key>V:    insert-selection(CLIPBOARD) \n\
                 Ctrl Shift <Key>C:    copy-selection(CLIPBOARD)

You need to run xrdb -merge ~/.Xresources after putting that into the file.

Related Question