I have this nice alias which works well within my Ubuntu when I need to copy some terminal output right into my clipboard:

alias xclip='xargs echo -n | xclip -selection clipboard'

Now something like cat myfile | xclip and I have output in the clipboard ready to be pasted within Ubuntu, which is really handy.

However, this does not work if I want to paste into my Windows 10 host (I am using Ubuntu VM). I always select and Ctrl+Shift+C, but I would love to be able to copy command output straight into clipboard just like selecting and Ctrl+Shift+C. Is there similar thing to xclip where I can copy/paste from Ubuntu to Windows 10 without mouse selection?

  • Take a look at program xcutsel. Linux has more than one clipboard, and vmware/virtualbox copy automatically only one. – Ipor Sircer Aug 30 '16 at 15:28

Using the primary clipboard as target works for me (Ubuntu). I can paste the string into my VMware host (provided that clipboard sharing is configured correctly):

echo hello | xclip -selection p

or shorter:

echo hello | xclip -i

  • i tried this and the mouse selected (i.e. copied into the clip board in linux vm) did not get to shared on windows. – Minnie Shi Nov 1 '18 at 11:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.